|
@@ -0,0 +1,534 @@
|
|
1
|
+<?xml version="1.0" encoding="UTF-8" ?>
|
|
2
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
|
|
3
|
+<mapper namespace="com.th.demo.mapping.ware.InStoreMapper" >
|
|
4
|
+ <resultMap id="BaseResultMap" type="com.th.demo.model.ware.InStore" >
|
|
5
|
+ <id column="id" property="id" jdbcType="VARCHAR" />
|
|
6
|
+ <result column="layer" property="layer" jdbcType="INTEGER" />
|
|
7
|
+ <result column="model" property="model" jdbcType="VARCHAR" />
|
|
8
|
+ <result column="plate_no" property="plateNo" jdbcType="VARCHAR" />
|
|
9
|
+ <result column="count" property="count" jdbcType="DOUBLE" />
|
|
10
|
+ <result column="weight" property="weight" jdbcType="DOUBLE" />
|
|
11
|
+ <result column="remark" property="remark" jdbcType="VARCHAR" />
|
|
12
|
+ <result column="add_id" property="addId" jdbcType="VARCHAR" />
|
|
13
|
+ <result column="add_time" property="addTime" jdbcType="TIMESTAMP" />
|
|
14
|
+ <result column="modify_id" property="modifyId" jdbcType="VARCHAR" />
|
|
15
|
+ <result column="modify_time" property="modifyTime" jdbcType="TIMESTAMP" />
|
|
16
|
+ <result column="cancel_id" property="cancelId" jdbcType="VARCHAR" />
|
|
17
|
+ <result column="cancel_time" property="cancelTime" jdbcType="TIMESTAMP" />
|
|
18
|
+ <result column="cancel_flag" property="cancelFlag" jdbcType="VARCHAR" />
|
|
19
|
+ <result column="belong_id" property="belongId" jdbcType="VARCHAR" />
|
|
20
|
+ <result column="in_id" property="inId" jdbcType="VARCHAR" />
|
|
21
|
+ <result column="out_id" property="outId" jdbcType="VARCHAR" />
|
|
22
|
+ <result column="receive_address" property="receiveAddress" jdbcType="VARCHAR" />
|
|
23
|
+ <result column="out_flag" property="outFlag" jdbcType="VARCHAR" />
|
|
24
|
+ <result column="lock_flag" property="lockFlag" jdbcType="VARCHAR" />
|
|
25
|
+
|
|
26
|
+ <result column="wgt_dcn_mtc_cd" property="wgtDcnMtcCd" jdbcType="VARCHAR" />
|
|
27
|
+ <result column="edge_ty" property="edgeTy" jdbcType="VARCHAR" />
|
|
28
|
+ <result column="production_place" property="productionPlace" jdbcType="VARCHAR" />
|
|
29
|
+ <result column="ord_no" property="ordNo" jdbcType="VARCHAR" />
|
|
30
|
+ <result column="car_no" property="carNo" jdbcType="VARCHAR" />
|
|
31
|
+ <result column="tally_people" property="tallyPeople" jdbcType="VARCHAR" />
|
|
32
|
+ <result column="fk_compony_id" property="fkComponyId" jdbcType="VARCHAR" />
|
|
33
|
+ <result column="invoice_price" property="invoicePrice" jdbcType="DOUBLE" />
|
|
34
|
+ <result column="contract_no" property="contractNo" jdbcType="VARCHAR" />
|
|
35
|
+ <result column="customer_name" property="customerName" jdbcType="VARCHAR" />
|
|
36
|
+
|
|
37
|
+ <association column="ware_id" property="ware" select="com.th.demo.mapping.maint.WareMapper.selectByPrimaryKey" />
|
|
38
|
+ <association column="stack_id" property="stack" select="com.th.demo.mapping.maint.StackMapper.selectByPrimaryKey" />
|
|
39
|
+ <association column="material_id" property="material" select="com.th.demo.mapping.maint.MaterialMapper.selectByPrimaryKey" />
|
|
40
|
+ <association column="customer_id" property="customer" select="com.th.demo.mapping.maint.CustomerMapper.selectByPrimaryKey" />
|
|
41
|
+ <association column="add_id" property="addUser" select="com.th.demo.mapping.system.SysUserMapper.selectByPrimaryKey" />
|
|
42
|
+ </resultMap>
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+ <resultMap id="StoreOfWareStack" type="com.th.demo.model.ware.StoreOfWareStack" >
|
|
47
|
+ <result column="ware_id" property="wareId" jdbcType="VARCHAR" />
|
|
48
|
+ <result column="stack_id" property="stackId" jdbcType="VARCHAR" />
|
|
49
|
+ </resultMap>
|
|
50
|
+
|
|
51
|
+ <resultMap id="TotalResultMap" type="com.th.demo.model.ware.TotalRecord">
|
|
52
|
+ <result column="total_amount" property="totalAmount" jdbcType="DOUBLE" />
|
|
53
|
+ <result column="total_weight" property="totalWeight" jdbcType="DOUBLE" />
|
|
54
|
+ </resultMap>
|
|
55
|
+
|
|
56
|
+ <sql id="Base_Column_List" >
|
|
57
|
+ id, ware_id, stack_id, layer, material_id, model, plate_no, customer_id, count, weight,
|
|
58
|
+ remark, add_id, add_time, modify_id, modify_time, cancel_id, cancel_time, cancel_flag,
|
|
59
|
+ belong_id, in_id, out_id, receive_address, out_flag, lock_flag,wgt_dcn_mtc_cd,edge_ty,production_place
|
|
60
|
+ </sql>
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
|
64
|
+ select
|
|
65
|
+ <include refid="Base_Column_List" />
|
|
66
|
+ from t_ware_store
|
|
67
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
68
|
+ </select>
|
|
69
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
|
|
70
|
+ delete from t_ware_store
|
|
71
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
72
|
+ </delete>
|
|
73
|
+
|
|
74
|
+ <insert id="insert" parameterType="com.th.demo.model.ware.Store" >
|
|
75
|
+
|
|
76
|
+ <selectKey keyProperty="id" order="BEFORE" resultType="java.lang.String">
|
|
77
|
+ SELECT REPLACE(UUID(),'-','') as id from dual
|
|
78
|
+ </selectKey>
|
|
79
|
+
|
|
80
|
+ insert into t_ware_store (id, ware_id, stack_id,
|
|
81
|
+ layer, material_id, model,
|
|
82
|
+ plate_no, customer_id, count,
|
|
83
|
+ weight, remark, add_id,
|
|
84
|
+ add_time, modify_id, modify_time,
|
|
85
|
+ cancel_id, cancel_time, cancel_flag,
|
|
86
|
+ belong_id, in_id, out_id,
|
|
87
|
+ receive_address, out_flag, lock_flag
|
|
88
|
+ ,wgt_dcn_mtc_cd,edge_ty,production_place,ord_no
|
|
89
|
+ ,car_no,tally_people,fk_compony_id,invoice_price
|
|
90
|
+ )
|
|
91
|
+ values (#{id,jdbcType=VARCHAR}, #{ware.id,jdbcType=VARCHAR}, #{stack.id,jdbcType=VARCHAR},
|
|
92
|
+ #{layer,jdbcType=INTEGER}, #{material.id,jdbcType=VARCHAR}, #{model,jdbcType=VARCHAR},
|
|
93
|
+ #{plateNo,jdbcType=VARCHAR}, #{customer.id,jdbcType=VARCHAR}, #{count,jdbcType=DOUBLE},
|
|
94
|
+ #{weight,jdbcType=DOUBLE}, #{remark,jdbcType=VARCHAR}, #{addId,jdbcType=VARCHAR},
|
|
95
|
+ #{addTime,jdbcType=TIMESTAMP}, #{modifyId,jdbcType=VARCHAR}, #{modifyTime,jdbcType=TIMESTAMP},
|
|
96
|
+ #{cancelId,jdbcType=VARCHAR}, #{cancelTime,jdbcType=TIMESTAMP}, #{cancelFlag,jdbcType=VARCHAR},
|
|
97
|
+ #{belongId,jdbcType=VARCHAR}, #{inId,jdbcType=VARCHAR}, #{outId,jdbcType=VARCHAR},
|
|
98
|
+ #{receiveAddress,jdbcType=VARCHAR}, #{outFlag,jdbcType=VARCHAR}, #{lockFlag,jdbcType=VARCHAR}
|
|
99
|
+ ,#{wgtDcnMtcCd,jdbcType=VARCHAR},#{edgeTy,jdbcType=VARCHAR},#{productionPlace,jdbcType=VARCHAR},#{ordNo,jdbcType=VARCHAR}
|
|
100
|
+ ,#{carNo,jdbcType=VARCHAR},#{tallyPeople,jdbcType=VARCHAR},#{fkComponyId,jdbcType=VARCHAR},#{invoicePrice,jdbcType=DOUBLE}
|
|
101
|
+ )
|
|
102
|
+ </insert>
|
|
103
|
+
|
|
104
|
+ <insert id="insertSelective" parameterType="com.th.demo.model.ware.Store" >
|
|
105
|
+ insert into t_ware_store
|
|
106
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
107
|
+ <if test="id != null" >
|
|
108
|
+ id,
|
|
109
|
+ </if>
|
|
110
|
+ <if test="wareName != null" >
|
|
111
|
+ ware_name,
|
|
112
|
+ </if>
|
|
113
|
+ <if test="stackName != null" >
|
|
114
|
+ stack_name,
|
|
115
|
+ </if>
|
|
116
|
+ <if test="layer != null" >
|
|
117
|
+ layer,
|
|
118
|
+ </if>
|
|
119
|
+ <if test="materialName != null" >
|
|
120
|
+ material_name,
|
|
121
|
+ </if>
|
|
122
|
+ <if test="materialNo != null" >
|
|
123
|
+ material_no,
|
|
124
|
+ </if>
|
|
125
|
+ <if test="standard != null" >
|
|
126
|
+ standard,
|
|
127
|
+ </if>
|
|
128
|
+ <if test="model != null" >
|
|
129
|
+ model,
|
|
130
|
+ </if>
|
|
131
|
+ <if test="customerName != null" >
|
|
132
|
+ customer_name,
|
|
133
|
+ </if>
|
|
134
|
+ <if test="customerNo != null" >
|
|
135
|
+ customer_no,
|
|
136
|
+ </if>
|
|
137
|
+ <if test="count != null" >
|
|
138
|
+ count,
|
|
139
|
+ </if>
|
|
140
|
+ <if test="weight != null" >
|
|
141
|
+ weight,
|
|
142
|
+ </if>
|
|
143
|
+ <if test="remark != null" >
|
|
144
|
+ remark,
|
|
145
|
+ </if>
|
|
146
|
+ <if test="addId != null" >
|
|
147
|
+ add_id,
|
|
148
|
+ </if>
|
|
149
|
+ <if test="addTime != null" >
|
|
150
|
+ add_time,
|
|
151
|
+ </if>
|
|
152
|
+ <if test="modifyId != null" >
|
|
153
|
+ modify_id,
|
|
154
|
+ </if>
|
|
155
|
+ <if test="modifyTime != null" >
|
|
156
|
+ modify_time,
|
|
157
|
+ </if>
|
|
158
|
+ <if test="cancelId != null" >
|
|
159
|
+ cancel_id,
|
|
160
|
+ </if>
|
|
161
|
+ <if test="cancelTime != null" >
|
|
162
|
+ cancel_time,
|
|
163
|
+ </if>
|
|
164
|
+ <if test="cancelFlag != null" >
|
|
165
|
+ cancel_flag,
|
|
166
|
+ </if>
|
|
167
|
+ <if test="belongId != null" >
|
|
168
|
+ belong_id,
|
|
169
|
+ </if>
|
|
170
|
+ </trim>
|
|
171
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
172
|
+ <if test="id != null" >
|
|
173
|
+ #{id,jdbcType=VARCHAR},
|
|
174
|
+ </if>
|
|
175
|
+ <if test="wareName != null" >
|
|
176
|
+ #{wareName,jdbcType=VARCHAR},
|
|
177
|
+ </if>
|
|
178
|
+ <if test="stackName != null" >
|
|
179
|
+ #{stackName,jdbcType=VARCHAR},
|
|
180
|
+ </if>
|
|
181
|
+ <if test="layer != null" >
|
|
182
|
+ #{layer,jdbcType=INTEGER},
|
|
183
|
+ </if>
|
|
184
|
+ <if test="materialName != null" >
|
|
185
|
+ #{materialName,jdbcType=VARCHAR},
|
|
186
|
+ </if>
|
|
187
|
+ <if test="materialNo != null" >
|
|
188
|
+ #{materialNo,jdbcType=VARCHAR},
|
|
189
|
+ </if>
|
|
190
|
+ <if test="standard != null" >
|
|
191
|
+ #{standard,jdbcType=VARCHAR},
|
|
192
|
+ </if>
|
|
193
|
+ <if test="model != null" >
|
|
194
|
+ #{model,jdbcType=VARCHAR},
|
|
195
|
+ </if>
|
|
196
|
+ <if test="customerName != null" >
|
|
197
|
+ #{customerName,jdbcType=VARCHAR},
|
|
198
|
+ </if>
|
|
199
|
+ <if test="customerNo != null" >
|
|
200
|
+ #{customerNo,jdbcType=VARCHAR},
|
|
201
|
+ </if>
|
|
202
|
+ <if test="count != null" >
|
|
203
|
+ #{count,jdbcType=DOUBLE},
|
|
204
|
+ </if>
|
|
205
|
+ <if test="weight != null" >
|
|
206
|
+ #{weight,jdbcType=DOUBLE},
|
|
207
|
+ </if>
|
|
208
|
+ <if test="remark != null" >
|
|
209
|
+ #{remark,jdbcType=VARCHAR},
|
|
210
|
+ </if>
|
|
211
|
+ <if test="addId != null" >
|
|
212
|
+ #{addId,jdbcType=VARCHAR},
|
|
213
|
+ </if>
|
|
214
|
+ <if test="addTime != null" >
|
|
215
|
+ #{addTime,jdbcType=TIMESTAMP},
|
|
216
|
+ </if>
|
|
217
|
+ <if test="modifyId != null" >
|
|
218
|
+ #{modifyId,jdbcType=VARCHAR},
|
|
219
|
+ </if>
|
|
220
|
+ <if test="modifyTime != null" >
|
|
221
|
+ #{modifyTime,jdbcType=TIMESTAMP},
|
|
222
|
+ </if>
|
|
223
|
+ <if test="cancelId != null" >
|
|
224
|
+ #{cancelId,jdbcType=VARCHAR},
|
|
225
|
+ </if>
|
|
226
|
+ <if test="cancelTime != null" >
|
|
227
|
+ #{cancelTime,jdbcType=TIMESTAMP},
|
|
228
|
+ </if>
|
|
229
|
+ <if test="cancelFlag != null" >
|
|
230
|
+ #{cancelFlag,jdbcType=VARCHAR},
|
|
231
|
+ </if>
|
|
232
|
+ <if test="belongId != null" >
|
|
233
|
+ #{belongId,jdbcType=VARCHAR},
|
|
234
|
+ </if>
|
|
235
|
+ </trim>
|
|
236
|
+ </insert>
|
|
237
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.th.demo.model.ware.Store" >
|
|
238
|
+ update t_ware_store
|
|
239
|
+ <set >
|
|
240
|
+ <if test="wareName != null" >
|
|
241
|
+ ware_name = #{wareName,jdbcType=VARCHAR},
|
|
242
|
+ </if>
|
|
243
|
+ <if test="stackName != null" >
|
|
244
|
+ stack_name = #{stackName,jdbcType=VARCHAR},
|
|
245
|
+ </if>
|
|
246
|
+ <if test="layer != null" >
|
|
247
|
+ layer = #{layer,jdbcType=INTEGER},
|
|
248
|
+ </if>
|
|
249
|
+ <if test="materialName != null" >
|
|
250
|
+ material_name = #{materialName,jdbcType=VARCHAR},
|
|
251
|
+ </if>
|
|
252
|
+ <if test="materialNo != null" >
|
|
253
|
+ material_no = #{materialNo,jdbcType=VARCHAR},
|
|
254
|
+ </if>
|
|
255
|
+ <if test="standard != null" >
|
|
256
|
+ standard = #{standard,jdbcType=VARCHAR},
|
|
257
|
+ </if>
|
|
258
|
+ <if test="model != null" >
|
|
259
|
+ model = #{model,jdbcType=VARCHAR},
|
|
260
|
+ </if>
|
|
261
|
+ <if test="customerName != null" >
|
|
262
|
+ customer_name = #{customerName,jdbcType=VARCHAR},
|
|
263
|
+ </if>
|
|
264
|
+ <if test="customerNo != null" >
|
|
265
|
+ customer_no = #{customerNo,jdbcType=VARCHAR},
|
|
266
|
+ </if>
|
|
267
|
+ <if test="count != null" >
|
|
268
|
+ count = #{count,jdbcType=DOUBLE},
|
|
269
|
+ </if>
|
|
270
|
+ <if test="weight != null" >
|
|
271
|
+ weight = #{weight,jdbcType=DOUBLE},
|
|
272
|
+ </if>
|
|
273
|
+ <if test="remark != null" >
|
|
274
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
275
|
+ </if>
|
|
276
|
+ <if test="addId != null" >
|
|
277
|
+ add_id = #{addId,jdbcType=VARCHAR},
|
|
278
|
+ </if>
|
|
279
|
+ <if test="addTime != null" >
|
|
280
|
+ add_time = #{addTime,jdbcType=TIMESTAMP},
|
|
281
|
+ </if>
|
|
282
|
+ <if test="modifyId != null" >
|
|
283
|
+ modify_id = #{modifyId,jdbcType=VARCHAR},
|
|
284
|
+ </if>
|
|
285
|
+ <if test="modifyTime != null" >
|
|
286
|
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
287
|
+ </if>
|
|
288
|
+ <if test="cancelId != null" >
|
|
289
|
+ cancel_id = #{cancelId,jdbcType=VARCHAR},
|
|
290
|
+ </if>
|
|
291
|
+ <if test="cancelTime != null" >
|
|
292
|
+ cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
|
|
293
|
+ </if>
|
|
294
|
+ <if test="cancelFlag != null" >
|
|
295
|
+ cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
|
|
296
|
+ </if>
|
|
297
|
+ <if test="belongId != null" >
|
|
298
|
+ belong_id = #{belongId,jdbcType=VARCHAR},
|
|
299
|
+ </if>
|
|
300
|
+ </set>
|
|
301
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
302
|
+ </update>
|
|
303
|
+ <update id="updateByPrimaryKey" parameterType="com.th.demo.model.ware.Store" >
|
|
304
|
+ update t_ware_store
|
|
305
|
+ set ware_id = #{ware.id,jdbcType=VARCHAR},
|
|
306
|
+ stack_id = #{stack.id,jdbcType=VARCHAR},
|
|
307
|
+ layer = #{layer,jdbcType=INTEGER},
|
|
308
|
+ material_id = #{material.id,jdbcType=VARCHAR},
|
|
309
|
+ model = #{model,jdbcType=VARCHAR},
|
|
310
|
+ plate_no = #{plateNo,jdbcType=VARCHAR},
|
|
311
|
+ customer_id = #{customer.id,jdbcType=VARCHAR},
|
|
312
|
+ count = #{count,jdbcType=DOUBLE},
|
|
313
|
+ weight = #{weight,jdbcType=DOUBLE},
|
|
314
|
+ remark = #{remark,jdbcType=VARCHAR},
|
|
315
|
+ add_id = #{addId,jdbcType=VARCHAR},
|
|
316
|
+ add_time = #{addTime,jdbcType=TIMESTAMP},
|
|
317
|
+ modify_id = #{modifyId,jdbcType=VARCHAR},
|
|
318
|
+ modify_time = #{modifyTime,jdbcType=TIMESTAMP},
|
|
319
|
+ cancel_id = #{cancelId,jdbcType=VARCHAR},
|
|
320
|
+ cancel_time = #{cancelTime,jdbcType=TIMESTAMP},
|
|
321
|
+ cancel_flag = #{cancelFlag,jdbcType=VARCHAR},
|
|
322
|
+ belong_id = #{belongId,jdbcType=VARCHAR},
|
|
323
|
+ in_id = #{inId,jdbcType=VARCHAR},
|
|
324
|
+ out_id = #{outId,jdbcType=VARCHAR},
|
|
325
|
+ receive_address = #{receiveAddress,jdbcType=VARCHAR},
|
|
326
|
+ out_flag = #{outFlag,jdbcType=VARCHAR},
|
|
327
|
+ lock_flag = #{lockFlag,jdbcType=VARCHAR}
|
|
328
|
+ where id = #{id,jdbcType=VARCHAR}
|
|
329
|
+ </update>
|
|
330
|
+
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+ <select id="selectLayerByStackId" resultType="java.lang.String" >
|
|
334
|
+ SELECT ifnull(max(t.layer),0) from t_ware_store t
|
|
335
|
+ where t.stack_id =#{param1,jdbcType=VARCHAR}
|
|
336
|
+ and t.belong_id = #{param2,jdbcType=VARCHAR}
|
|
337
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
338
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
339
|
+ </select>
|
|
340
|
+
|
|
341
|
+ <select id="selectByWareIdStackId" resultMap="BaseResultMap" >
|
|
342
|
+ SELECT b.name as fk_compony_id,t.* from t_ware_store t left join t_maint_customer b
|
|
343
|
+ on t.fk_compony_id = b.id
|
|
344
|
+ where t.ware_id = #{param1,jdbcType=VARCHAR}
|
|
345
|
+ and t.stack_id = #{param2,jdbcType=VARCHAR}
|
|
346
|
+ and t.belong_id = #{param3,jdbcType=VARCHAR}
|
|
347
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
348
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
349
|
+ order by layer desc
|
|
350
|
+ </select>
|
|
351
|
+
|
|
352
|
+ <select id="select" resultMap="BaseResultMap" >
|
|
353
|
+
|
|
354
|
+select t.* from t_ware_store t where t.ware_name in (
|
|
355
|
+select b.name from t_maint_userware a ,t_maint_ware b where a.ware_id = b.id
|
|
356
|
+and user_id = #{param3,jdbcType=VARCHAR} ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
357
|
+ <if test="param1 != ''" >
|
|
358
|
+ and t.ware_name = #{param1,jdbcType=VARCHAR}
|
|
359
|
+ </if>
|
|
360
|
+ <if test="param2 != ''" >
|
|
361
|
+ and t.stack_name = #{param2,jdbcType=VARCHAR}
|
|
362
|
+ </if>
|
|
363
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
364
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
365
|
+order by t.stack_name asc , t.layer desc
|
|
366
|
+
|
|
367
|
+ </select>
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+ <select id="selectForUpDown" resultMap="BaseResultMap" >
|
|
371
|
+select t.* from t_ware_store t
|
|
372
|
+ where t.ware_id in (
|
|
373
|
+ select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
|
|
374
|
+ ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
375
|
+ and t.ware_id = #{param1,jdbcType=VARCHAR}
|
|
376
|
+ and t.stack_id = #{param2,jdbcType=VARCHAR}
|
|
377
|
+ and t.layer >= #{param5,jdbcType=INTEGER}
|
|
378
|
+ and t.layer <= #{param6,jdbcType=INTEGER}
|
|
379
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
380
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
381
|
+ </select>
|
|
382
|
+
|
|
383
|
+ <update id="updateForUpDownByStep" >
|
|
384
|
+update t_ware_store t set t.layer = t.layer + #{param7,jdbcType=INTEGER}
|
|
385
|
+ where t.ware_id in (
|
|
386
|
+ select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
|
|
387
|
+ ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
388
|
+ and t.ware_id = #{param1,jdbcType=VARCHAR}
|
|
389
|
+ and t.stack_id = #{param2,jdbcType=VARCHAR}
|
|
390
|
+ and t.layer >= #{param5,jdbcType=INTEGER}
|
|
391
|
+ and t.layer <= #{param6,jdbcType=INTEGER}
|
|
392
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
393
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
394
|
+ </update>
|
|
395
|
+
|
|
396
|
+ <update id="updateForUpDownByLayer" >
|
|
397
|
+update t_ware_store t set t.layer = #{param7,jdbcType=INTEGER}
|
|
398
|
+ where t.ware_id in (
|
|
399
|
+ select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
|
|
400
|
+ ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
401
|
+ and t.ware_id = #{param1,jdbcType=VARCHAR}
|
|
402
|
+ and t.stack_id = #{param2,jdbcType=VARCHAR}
|
|
403
|
+ and t.layer >= #{param5,jdbcType=INTEGER}
|
|
404
|
+ and t.layer <= #{param6,jdbcType=INTEGER}
|
|
405
|
+ and ifnull(t.cancel_flag,'0') = '0'
|
|
406
|
+ and ifnull(t.out_flag,'0') = '0'
|
|
407
|
+ </update>
|
|
408
|
+
|
|
409
|
+ <select id="selectByOutId" resultMap="BaseResultMap" >
|
|
410
|
+ select t.* from t_ware_store t
|
|
411
|
+ where t.ware_id in (
|
|
412
|
+ select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
|
|
413
|
+ ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
414
|
+ and t.out_id = #{param1,jdbcType=VARCHAR}
|
|
415
|
+ </select>
|
|
416
|
+
|
|
417
|
+
|
|
418
|
+ <update id="updateByOutId" >
|
|
419
|
+ update t_ware_store t set t.cancel_flag = '1'
|
|
420
|
+ where t.ware_id in (
|
|
421
|
+ select a.ware_id from t_maint_userware a where a.user_id = #{param3,jdbcType=VARCHAR}
|
|
422
|
+ ) and t.belong_id = #{param4,jdbcType=VARCHAR}
|
|
423
|
+ and t.out_id = #{param1,jdbcType=VARCHAR}
|
|
424
|
+ </update>
|
|
425
|
+
|
|
426
|
+
|
|
427
|
+ <select id="selectStore" resultMap="BaseResultMap" >
|
|
428
|
+ select ws.*, wi.*, mm.*, mc.* from t_ware_store ws,t_ware_in_record wi, t_maint_ware mw, t_maint_stack ms, t_maint_material mm,t_maint_customer mc
|
|
429
|
+ where ws.ware_id = mw.id
|
|
430
|
+ and ws.stack_id = ms.id
|
|
431
|
+ and ws.material_id = mm.id
|
|
432
|
+ and ws.customer_id = mc.id
|
|
433
|
+ and ws.in_id = wi.id
|
|
434
|
+ and mw.id like concat('%',#{param1,jdbcType=VARCHAR},'%')
|
|
435
|
+ and ms.code like concat('_',#{param2,jdbcType=VARCHAR},'%')
|
|
436
|
+ and ms.name like concat('%',#{param3,jdbcType=VARCHAR},'%')
|
|
437
|
+ and ws.plate_no like concat('%',#{param4,jdbcType=VARCHAR},'%')
|
|
438
|
+ and ws.ord_no like concat('%',#{param5,jdbcType=VARCHAR},'%')
|
|
439
|
+ and ws.belong_id = #{param7,jdbcType=VARCHAR}
|
|
440
|
+ and ws.cancel_flag = '0'
|
|
441
|
+ and ws.out_flag = '0'
|
|
442
|
+ and ws.ware_id in (
|
|
443
|
+ select m.ware_id from t_maint_userware m where m.user_id = #{param6,jdbcType=VARCHAR}
|
|
444
|
+ )
|
|
445
|
+ order by ms.code,ws.layer desc
|
|
446
|
+ </select>
|
|
447
|
+ <select id="selectWareStackByDistributionStore" resultMap="StoreOfWareStack" >
|
|
448
|
+ select distinct t.ware_id ,t.stack_id
|
|
449
|
+ from t_ware_store t where t.id in
|
|
450
|
+ <foreach item="item" index="index" collection="storeId"
|
|
451
|
+ open="(" separator="," close=")">
|
|
452
|
+ #{item}
|
|
453
|
+ </foreach>
|
|
454
|
+
|
|
455
|
+ </select>
|
|
456
|
+
|
|
457
|
+
|
|
458
|
+ <select id="selectByWareIdStackIdInStoreId" resultMap="BaseResultMap" >
|
|
459
|
+ select *
|
|
460
|
+ from t_ware_store t where t.id in
|
|
461
|
+ <foreach item="item" index="index" collection="storeId"
|
|
462
|
+ open="(" separator="," close=")">
|
|
463
|
+ #{item}
|
|
464
|
+ </foreach>
|
|
465
|
+ and t.ware_id like concat('%',#{wareId,jdbcType=VARCHAR},'%')
|
|
466
|
+ and t.stack_id like concat('%',#{stackId,jdbcType=VARCHAR},'%')
|
|
467
|
+ </select>
|
|
468
|
+
|
|
469
|
+
|
|
470
|
+ <update id="updateDistributionById" >
|
|
471
|
+ update t_ware_store t
|
|
472
|
+ set t.lock_flag = #{lockFlag,jdbcType=VARCHAR} where t.id in
|
|
473
|
+ <foreach item="item" index="index" collection="storeId"
|
|
474
|
+ open="(" separator="," close=")">
|
|
475
|
+ #{item}
|
|
476
|
+ </foreach>
|
|
477
|
+
|
|
478
|
+ </update>
|
|
479
|
+
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
|
|
483
|
+ <select id="selectForCustomer" resultMap="BaseResultMap" >
|
|
484
|
+ select e.name as fk_compony_id,t.*
|
|
485
|
+ from t_ware_store t left join t_maint_customer e
|
|
486
|
+ on t.fk_compony_id = e.id
|
|
487
|
+ , t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
|
|
488
|
+ where t.ware_id = a.id
|
|
489
|
+ and t.stack_id = b.id
|
|
490
|
+ and t.material_id = c.id
|
|
491
|
+ and t.customer_id = d.id
|
|
492
|
+ and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
|
|
493
|
+ and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
|
|
494
|
+ and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
|
|
495
|
+ and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
|
|
496
|
+ and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
|
|
497
|
+ <if test="param6 != null and param6 != ''" >
|
|
498
|
+ and d.name = #{param6,jdbcType=VARCHAR}
|
|
499
|
+ </if>
|
|
500
|
+ and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
|
|
501
|
+ and t.cancel_flag = '0'
|
|
502
|
+ and t.out_flag = '0'
|
|
503
|
+ and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
|
|
504
|
+ and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
|
|
505
|
+ </select>
|
|
506
|
+ <select id="queryTotal" resultMap="TotalResultMap" >
|
|
507
|
+ select sum(t.weight) as total_weight,
|
|
508
|
+ sum(t.count) as total_amount
|
|
509
|
+ from t_ware_store t, t_maint_ware a, t_maint_stack b, t_maint_material c,t_maint_customer d
|
|
510
|
+ where t.ware_id = a.id
|
|
511
|
+ and t.stack_id = b.id
|
|
512
|
+ and t.material_id = c.id
|
|
513
|
+ and t.customer_id = d.id
|
|
514
|
+ and a.name like concat('%',#{param1,jdbcType=VARCHAR},'%')
|
|
515
|
+ and b.name like concat('%',#{param2,jdbcType=VARCHAR},'%')
|
|
516
|
+ and t.model like concat('%',#{param3,jdbcType=VARCHAR},'%')
|
|
517
|
+ and c.name like concat('%',#{param4,jdbcType=VARCHAR},'%')
|
|
518
|
+ and c.standard like concat('%',#{param5,jdbcType=VARCHAR},'%')
|
|
519
|
+ and d.name like concat('%',#{param6,jdbcType=VARCHAR},'%')
|
|
520
|
+ and t.plate_no like concat('%',#{param7,jdbcType=VARCHAR},'%')
|
|
521
|
+ and t.cancel_flag = '0'
|
|
522
|
+ and t.out_flag = '0'
|
|
523
|
+ and IFNULL(t.ord_no,'*') like concat('%',#{param11,jdbcType=VARCHAR},'%')
|
|
524
|
+ and d.name like CONCAT((select attr3 from sys_user temp where temp.id=#{param10,jdbcType=VARCHAR}),'%')
|
|
525
|
+ </select>
|
|
526
|
+
|
|
527
|
+ <select id="selEffStore" resultType="java.lang.Integer" parameterType="java.lang.String">
|
|
528
|
+ select count(*)
|
|
529
|
+ from t_ware_store t
|
|
530
|
+ where t.cancel_flag = '0'
|
|
531
|
+ and t.plate_no = #{param1,jdbcType=VARCHAR};
|
|
532
|
+
|
|
533
|
+ </select>
|
|
534
|
+</mapper>
|