jialh
昨天 dd6687b118561100e1677e88a9c2f5842a54c531
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="propertyWhiteListFlowDaoImplMapper">
    <insert id="savePropertyWhiteListFlow" parameterType="Map">
        INSERT INTO property_white_list_flow
        <trim prefix="(" suffix=")" suffixOverrides=",">
            charge_time,
            <if test="invoiceReceiptNo != null">invoice_receipt_no,</if>
            <if test="roomId != null">room_id,</if>
            <if test="propertyAddress != null">property_address,</if>
            <if test="doorRoomNum != null">door_room_num,</if>
            <if test="doorRoomNum != null">nong,</if>
            <if test="doorRoomNum != null">men,</if>
            <if test="doorRoomNum != null">shi,</if>
            <if test="secondaryFeeTypeCd != null">secondary_fee_type_cd,</if>
            <if test="chargeAmount != null">charge_amount,</if>
            <if test="charger != null">charger,</if>
            <if test="bankDepositDate != null">bank_deposit_date,</if>
            <if test="bankDepositor != null">bank_depositor,</if>
            <if test="splitBankDepositAmount != null">split_bank_deposit_amount,</if>
            <if test="bankDepositAmount != null">bank_deposit_amount,</if>
            <if test="checkAmount != null">check_amount,</if>
            <if test="whiteListArchiveNo != null">white_list_archive_no,</if>
            <if test="sheetCount != null">sheet_count,</if>
            <if test="financialReceiver != null">financial_receiver,</if>
            <if test="inputTime != null">input_time,</if>
            <if test="inputPerson != null">input_person,</if>
            <if test="orderNo != null">order_no,</if>
            <if test="licensePlate != null">license_plate,</if>
            <if test="category22 != null">category_22,</if>
            <if test="chargeStart != null">charge_start,</if>
            <if test="chargeEnd != null">charge_end,</if>
            <if test="communityId != null">community_id,</if>
            <if test="frequency != null">frequency,</if>
            <if test="receiptYearMonth != null">receipt_year_month,</if>
            <if test="receiptYear != null">receipt_year,</if>
            <if test="pendingProblem != null">pending_problem,</if>
            <if test="roomNumber != null">room_number</if>
        </trim> VALUES
        <trim prefix="(" suffix=")" suffixOverrides=",">
            #{chargeTime},
            <if test="invoiceReceiptNo != null">#{invoiceReceiptNo},</if>
            <if test="roomId != null">#{roomId},</if>
            <if test="propertyAddress != null">#{propertyAddress},</if>
            <if test="doorRoomNum != null">#{doorRoomNum},</if>
            <if test="doorRoomNum != null">SUBSTRING_INDEX(#{doorRoomNum}, '-', 1),</if>
            <if test="doorRoomNum != null">SUBSTRING_INDEX(SUBSTRING_INDEX(#{doorRoomNum}, '-', 2), '-', -1),</if>
            <if test="doorRoomNum != null">SUBSTRING_INDEX(#{doorRoomNum}, '-', -1),</if>
            <if test="secondaryFeeTypeCd != null">#{secondaryFeeTypeCd},</if>
            <if test="chargeAmount != null">#{chargeAmount},</if>
            <if test="charger != null">#{charger},</if>
            <if test="bankDepositDate != null">#{bankDepositDate},</if>
            <if test="bankDepositor != null">#{bankDepositor},</if>
            <if test="splitBankDepositAmount != null">#{splitBankDepositAmount},</if>
            <if test="bankDepositAmount != null">#{bankDepositAmount},</if>
            <if test="checkAmount != null">#{checkAmount},</if>
            <if test="whiteListArchiveNo != null">#{whiteListArchiveNo},</if>
            <if test="sheetCount != null">#{sheetCount},</if>
            <if test="financialReceiver != null">#{financialReceiver},</if>
            <if test="inputTime != null">#{inputTime},</if>
            <if test="inputPerson != null">#{inputPerson},</if>
            <if test="orderNo != null">#{orderNo},</if>
            <if test="licensePlate != null">#{licensePlate},</if>
            <if test="category22 != null">#{category22},</if>
            <if test="chargeStart != null">#{chargeStart},</if>
            <if test="chargeEnd != null">#{chargeEnd},</if>
            <if test="communityId != null">#{communityId},</if>
            <if test="frequency != null">#{frequency},</if>
            <if test="receiptYearMonth != null">#{receiptYearMonth},</if>
            <if test="receiptYear != null">#{receiptYear},</if>
            <if test="pendingProblem != null">#{pendingProblem},</if>
            <if test="roomNumber != null">#{roomNumber}</if>
        </trim>
    </insert>
 
    <select id="queryPropertyWhiteListFlow" parameterType="Map" resultType="Map">
        SELECT
        id,
        charge_time AS chargeTime,
        invoice_receipt_no AS invoiceReceiptNo,
        room_id AS roomId,
        property_address AS propertyAddress,
        door_room_num AS doorRoomNum,
        secondary_fee_type_cd AS secondaryFeeTypeCd,
        charge_amount AS chargeAmount,
        charger,
        bank_deposit_date AS bankDepositDate,
        bank_depositor AS bankDepositor,
        split_bank_deposit_amount AS splitBankDepositAmount,
        bank_deposit_amount AS bankDepositAmount,
        check_amount AS checkAmount,
        white_list_archive_no AS whiteListArchiveNo,
        sheet_count AS sheetCount,
        financial_receiver AS financialReceiver,
        input_time AS inputTime,
        input_person AS inputPerson,
        order_no AS orderNo,
        license_plate AS licensePlate,
        category_22 AS category22,
        charge_start AS chargeStart,
        charge_end AS chargeEnd,
        community_id AS communityId,
        frequency,
        receipt_year_month AS receiptYearMonth,
        receipt_year AS receiptYear,
        pending_problem AS pendingProblem,
        room_number AS roomNumber,
        financial_check AS financialCheck,
        check_date AS checkDate,
        nong,
        men,
        shi,
        SUBSTRING_INDEX(door_room_num, '-', 1) AS floorNum,
        SUBSTRING_INDEX(SUBSTRING_INDEX(door_room_num, '-', 2), '-', -1) AS unitNum,
        SUBSTRING_INDEX(door_room_num, '-', -1) AS roomNum,
        SUBSTRING_INDEX(frequency, '-', -1) as order_fre
        FROM
        property_white_list_flow
        <where>
            <if test="startChargeTime != null">
                AND charge_time >= #{startChargeTime}
            </if>
            <if test="endChargeTime != null">
                AND charge_time &lt;= #{endChargeTime}
            </if>
            <if test="frequencyLike != null">
                AND frequency like concat(#{frequencyLike},"%")
            </if>
            <if test="roomId != null and roomId != ''">
                AND room_id = #{roomId}
            </if>
            <if test="secondaryFeeTypeCd != null and secondaryFeeTypeCd != ''">
                AND secondary_fee_type_cd = #{secondaryFeeTypeCd}
            </if>
            <if test="invoiceReceiptNo != null">
                AND invoice_receipt_no = #{invoiceReceiptNo}
            </if>
            <if test="minChargeAmount != null">
                AND charge_amount >= #{minChargeAmount}
            </if>
            <if test="maxChargeAmount != null">
                AND charge_amount &lt;= #{maxChargeAmount}
            </if>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="licensePlate != null and licensePlate != ''">
                AND license_plate = #{licensePlate}
            </if>
            <if test="category22 != null and category22 != ''">
                AND category_22 = #{category22}
            </if>
            <if test="feeYear != null and feeYear != ''">
                and YEAR(charge_time) = #{feeYear}
            </if>
            <if test="communityId != null and communityId != ''">
                and community_id = #{communityId}
            </if>
            <if test="nong != null and nong != ''">
                AND nong = #{nong}
            </if>
            <if test="men != null and men != ''">
                AND men = #{men}
            </if>
            <if test="shi != null and shi != ''">
                AND shi = #{shi}
            </if>
            <if test="financialCheck != null">
                AND financial_check = #{financialCheck}
            </if>
            <if test="checkDate != null">
                AND check_date = #{checkDate}
            </if>
        </where>
        order by order_fre desc,door_room_num,secondary_fee_type_cd,charge_start
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
 
    <select id="countPropertyWhiteListFlow" parameterType="Map" resultType="Map">
 
        SELECT
        count(1)
        FROM
        property_white_list_flow
        <where>
            <if test="startChargeTime != null">
                AND charge_time >= #{startChargeTime}
            </if>
            <if test="endChargeTime != null">
                AND charge_time &lt;= #{endChargeTime}
            </if>
            <if test="roomId != null and roomId != ''">
                AND room_id = #{roomId}
            </if>
            <if test="secondaryFeeTypeCd != null and secondaryFeeTypeCd != ''">
                AND secondary_fee_type_cd = #{secondaryFeeTypeCd}
            </if>
            <if test="minChargeAmount != null">
                AND charge_amount >= #{minChargeAmount}
            </if>
            <if test="maxChargeAmount != null">
                AND charge_amount &lt;= #{maxChargeAmount}
            </if>
            <if test="orderNo != null and orderNo != ''">
                AND order_no = #{orderNo}
            </if>
            <if test="licensePlate != null and licensePlate != ''">
                AND license_plate = #{licensePlate}
            </if>
            <if test="category22 != null and category22 != ''">
                AND category_22 = #{category22}
            </if>
            <if test="feeYear != null and feeYear != ''">
                and YEAR(charge_time) = #{feeYear}
            </if>
            <if test="communityId != null and communityId != ''">
                and community_id = #{communityId}
            </if>
            <if test="nong != null and nong != ''">
                AND nong = #{nong}
            </if>
            <if test="men != null and men != ''">
                AND men = #{men}
            </if>
            <if test="shi != null and shi != ''">
                AND shi = #{shi}
            </if>
        </where>
    </select>
 
    <select id="countPropertyWhiteListFlowFilter" parameterType="Map" resultType="Map">
        SELECT
        count(1)
        FROM
        property_white_list_flow
        <where>
            <if test="communityId != null">
                AND community_id = #{communityId}
            </if>
            <if test="secondaryFeeTypeCd != null">
                AND secondary_fee_type_cd = #{secondaryFeeTypeCd}
            </if>
            <if test="roomId != null">
                AND room_id = #{roomId}
            </if>
            <if test="licensePlate != null">
                AND license_plate = #{licensePlate}
            </if>
            <if test="chargeAmount != null">
                AND charge_amount = #{chargeAmount}
            </if>
            <if test="chargeTime != null">
                AND charge_time = #{chargeTime}
            </if>
            <if test="invoiceReceiptNo != null">
                AND invoice_receipt_no = #{invoiceReceiptNo}
            </if>
            <if test="chargeStart != null">
                AND charge_start = #{chargeStart}
            </if>
            <if test="chargeEnd != null">
                AND charge_end = #{chargeEnd}
            </if>
            <if test="nong != null">
                AND nong = #{nong}
            </if>
            <if test="men != null">
                AND men = #{men}
            </if>
            <if test="shi != null">
                AND shi = #{shi}
            </if>
        </where>
    </select>
 
    <update id="updatePropertyWhiteListFlow">
        update property_white_list_flow set frequency = #{frequency} where id = #{id}
    </update>
</mapper>