chengf
2026-03-24 b2358fc44148073645def4e723c8153a98a701da
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
282
<?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="resourceResourceStoreV1ServiceDaoImpl">
 
    <!-- 保存物品信息信息 add by wuxw 2018-07-03 -->
    <insert id="saveResourceStoreInfo" parameterType="Map">
        insert into resource_store(
        sh_id, description, remark, store_id, res_id, parent_rst_id, warning_stock, rss_id,
        res_name, rst_id, out_low_price, price, mini_unit_stock, unit_code, res_code,
        mini_unit_code, average_price, stock, out_high_price, show_mobile, is_fixed,
        mini_stock, community_id, community_name,
        triple_waybill_no, system_name, model, brand, supplier,
        budget_approval, budget_quantity, budget_unit_price, budget_amount,
        apply_quantity_total, purchase_quantity_total, actual_delivery_quantity,
        payable_amount_total, paid_amount_total, unpaid_amount_total, is_occurred,
        -- 新增字段(按你提供的顺序补充)
        payable_amount, paid_amount, unpaid_amount, total_return_quantity,
        supplier1, supplier2, supplier3, rst_name
        )
        values (
        #{shId}, #{description}, #{remark}, #{storeId}, #{resId}, #{parentRstId}, #{warningStock}, #{rssId},
        #{resName}, #{rstId}, #{outLowPrice}, #{price}, #{miniUnitStock}, #{unitCode}, #{resCode},
        #{miniUnitCode}, #{averagePrice}, #{stock}, #{outHighPrice}, #{showMobile}, #{isFixed},
        #{miniStock}, #{communityId}, #{communityName},
        #{tripleWaybillNo}, #{systemName}, #{model}, #{brand}, #{supplier},
        #{budgetApproval}, #{budgetQuantity}, #{budgetUnitPrice}, #{budgetAmount},
        #{applyQuantityTotal}, #{purchaseQuantityTotal}, #{actualDeliveryQuantity},
        #{payableAmountTotal}, #{paidAmountTotal}, #{unpaidAmountTotal}, #{isOccurred},
        #{payableAmount}, #{paidAmount}, #{unpaidAmount}, #{totalReturnQuantity},
        #{supplier1}, #{supplier2}, #{supplier3}, #{rstName}
        );
    </insert>
 
    <!-- 查询物品信息信息 add by wuxw 2018-07-03 -->
    <select id="getResourceStoreInfo" parameterType="Map" resultType="Map">
        select t.sh_id,t.sh_id shId,t.description,t.status_cd,t.status_cd statusCd,t.remark,t.store_id,t.store_id
        storeId,t.res_id,t.res_id resId,t.parent_rst_id,t.parent_rst_id parentRstId,t.warning_stock,t.warning_stock
        warningStock,t.rss_id,t.rss_id rssId,t.res_name,t.res_name resName,t.rst_id,t.rst_id
        rstId,t.out_low_price,t.out_low_price outLowPrice,t.price,t.mini_unit_stock,t.mini_unit_stock
        miniUnitStock,t.unit_code,t.unit_code unitCode,t.res_code,t.res_code resCode,t.mini_unit_code,t.mini_unit_code
        miniUnitCode,t.average_price,t.average_price averagePrice,t.stock,t.out_high_price,t.out_high_price
        outHighPrice,t.show_mobile,t.show_mobile showMobile,t.is_fixed,t.is_fixed isFixed,t.mini_stock,t.mini_stock
        miniStock
        from resource_store t
        where 1 =1
        <if test="shId !=null and shId != ''">
            and t.sh_id= #{shId}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
        <if test="parentRstId !=null and parentRstId != ''">
            and t.parent_rst_id= #{parentRstId}
        </if>
        <if test="warningStock !=null and warningStock != ''">
            and t.warning_stock= #{warningStock}
        </if>
        <if test="rssId !=null and rssId != ''">
            and t.rss_id= #{rssId}
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name= #{resName}
        </if>
        <if test="rstId !=null and rstId != ''">
            and t.rst_id= #{rstId}
        </if>
        <if test="outLowPrice !=null and outLowPrice != ''">
            and t.out_low_price= #{outLowPrice}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="miniUnitStock !=null and miniUnitStock != ''">
            and t.mini_unit_stock= #{miniUnitStock}
        </if>
        <if test="unitCode !=null and unitCode != ''">
            and t.unit_code= #{unitCode}
        </if>
        <if test="resCode !=null and resCode != ''">
            and t.res_code= #{resCode}
        </if>
        <if test="miniUnitCode !=null and miniUnitCode != ''">
            and t.mini_unit_code= #{miniUnitCode}
        </if>
        <if test="averagePrice !=null and averagePrice != ''">
            and t.average_price= #{averagePrice}
        </if>
        <if test="stock !=null and stock != ''">
            and t.stock= #{stock}
        </if>
        <if test="outHighPrice !=null and outHighPrice != ''">
            and t.out_high_price= #{outHighPrice}
        </if>
        <if test="showMobile !=null and showMobile != ''">
            and t.show_mobile= #{showMobile}
        </if>
        <if test="isFixed !=null and isFixed != ''">
            and t.is_fixed= #{isFixed}
        </if>
        <if test="miniStock !=null and miniStock != ''">
            and t.mini_stock= #{miniStock}
        </if>
        order by t.create_time desc
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
    </select>
 
    <!-- 修改物品信息信息 add by wuxw 2018-07-03 -->
    <update id="updateResourceStoreInfo" parameterType="Map">
        update resource_store t set t.status_cd = #{statusCd}
        <if test="newBId != null and newBId != ''">
            ,t.b_id = #{newBId}
        </if>
        <if test="shId !=null and shId != ''">
            , t.sh_id= #{shId}
        </if>
        <if test="description !=null and description != ''">
            , t.description= #{description}
        </if>
        <if test="remark !=null and remark != ''">
            , t.remark= #{remark}
        </if>
 
        <if test="parentRstId !=null and parentRstId != ''">
            , t.parent_rst_id= #{parentRstId}
        </if>
        <if test="warningStock !=null and warningStock != ''">
            , t.warning_stock= #{warningStock}
        </if>
        <if test="rssId !=null and rssId != ''">
            , t.rss_id= #{rssId}
        </if>
        <if test="resName !=null and resName != ''">
            , t.res_name= #{resName}
        </if>
        <if test="rstId !=null and rstId != ''">
            , t.rst_id= #{rstId}
        </if>
        <if test="outLowPrice !=null and outLowPrice != ''">
            , t.out_low_price= #{outLowPrice}
        </if>
        <if test="price !=null and price != ''">
            , t.price= #{price}
        </if>
        <if test="miniUnitStock !=null and miniUnitStock != ''">
            , t.mini_unit_stock= #{miniUnitStock}
        </if>
        <if test="unitCode !=null and unitCode != ''">
            , t.unit_code= #{unitCode}
        </if>
        <if test="resCode !=null and resCode != ''">
            , t.res_code= #{resCode}
        </if>
        <if test="miniUnitCode !=null and miniUnitCode != ''">
            , t.mini_unit_code= #{miniUnitCode}
        </if>
        <if test="averagePrice !=null and averagePrice != ''">
            , t.average_price= #{averagePrice}
        </if>
        <if test="stock !=null and stock != ''">
            , t.stock= #{stock}
        </if>
        <if test="outHighPrice !=null and outHighPrice != ''">
            , t.out_high_price= #{outHighPrice}
        </if>
        <if test="showMobile !=null and showMobile != ''">
            , t.show_mobile= #{showMobile}
        </if>
        <if test="isFixed !=null and isFixed != ''">
            , t.is_fixed= #{isFixed}
        </if>
        <if test="miniStock !=null and miniStock != ''">
            , t.mini_stock= #{miniStock}
        </if>
        where 1=1
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
    </update>
 
    <!-- 查询物品信息数量 add by wuxw 2018-07-03 -->
    <select id="queryResourceStoresCount" parameterType="Map" resultType="Map">
        select count(1) count
        from resource_store t
        where 1 =1
        <if test="shId !=null and shId != ''">
            and t.sh_id= #{shId}
        </if>
        <if test="description !=null and description != ''">
            and t.description= #{description}
        </if>
        <if test="statusCd !=null and statusCd != ''">
            and t.status_cd= #{statusCd}
        </if>
        <if test="remark !=null and remark != ''">
            and t.remark= #{remark}
        </if>
        <if test="storeId !=null and storeId != ''">
            and t.store_id= #{storeId}
        </if>
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="resId !=null and resId != ''">
            and t.res_id= #{resId}
        </if>
        <if test="parentRstId !=null and parentRstId != ''">
            and t.parent_rst_id= #{parentRstId}
        </if>
        <if test="warningStock !=null and warningStock != ''">
            and t.warning_stock= #{warningStock}
        </if>
        <if test="rssId !=null and rssId != ''">
            and t.rss_id= #{rssId}
        </if>
        <if test="resName !=null and resName != ''">
            and t.res_name= #{resName}
        </if>
        <if test="rstId !=null and rstId != ''">
            and t.rst_id= #{rstId}
        </if>
        <if test="outLowPrice !=null and outLowPrice != ''">
            and t.out_low_price= #{outLowPrice}
        </if>
        <if test="price !=null and price != ''">
            and t.price= #{price}
        </if>
        <if test="miniUnitStock !=null and miniUnitStock != ''">
            and t.mini_unit_stock= #{miniUnitStock}
        </if>
        <if test="unitCode !=null and unitCode != ''">
            and t.unit_code= #{unitCode}
        </if>
        <if test="resCode !=null and resCode != ''">
            and t.res_code= #{resCode}
        </if>
        <if test="miniUnitCode !=null and miniUnitCode != ''">
            and t.mini_unit_code= #{miniUnitCode}
        </if>
        <if test="averagePrice !=null and averagePrice != ''">
            and t.average_price= #{averagePrice}
        </if>
        <if test="stock !=null and stock != ''">
            and t.stock= #{stock}
        </if>
        <if test="outHighPrice !=null and outHighPrice != ''">
            and t.out_high_price= #{outHighPrice}
        </if>
        <if test="showMobile !=null and showMobile != ''">
            and t.show_mobile= #{showMobile}
        </if>
        <if test="isFixed !=null and isFixed != ''">
            and t.is_fixed= #{isFixed}
        </if>
        <if test="miniStock !=null and miniStock != ''">
            and t.mini_stock= #{miniStock}
        </if>
    </select>
</mapper>