|
@@ -43,6 +43,7 @@ |
|
@@ -43,6 +43,7 @@ |
43
|
from storage_deposit
|
43
|
from storage_deposit
|
44
|
where id = #{id,jdbcType=INTEGER}
|
44
|
where id = #{id,jdbcType=INTEGER}
|
45
|
</select>
|
45
|
</select>
|
|
|
46
|
+
|
46
|
<select id="queryByDepositCode" resultMap="BaseResultMap">
|
47
|
<select id="queryByDepositCode" resultMap="BaseResultMap">
|
47
|
select
|
48
|
select
|
48
|
<include refid="Base_Column_List" />
|
49
|
<include refid="Base_Column_List" />
|
|
@@ -50,10 +51,6 @@ |
|
@@ -50,10 +51,6 @@ |
50
|
where deposit_code = #{depositCode} and del_status=0 and owner_uid=#{uid}
|
51
|
where deposit_code = #{depositCode} and del_status=0 and owner_uid=#{uid}
|
51
|
</select>
|
52
|
</select>
|
52
|
|
53
|
|
53
|
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
54
|
- delete from storage_deposit
|
|
|
55
|
- where id = #{id,jdbcType=INTEGER}
|
|
|
56
|
- </delete>
|
|
|
57
|
<insert id="insert" parameterType="com.yohoufo.dal.order.model.StorageDeposit" >
|
54
|
<insert id="insert" parameterType="com.yohoufo.dal.order.model.StorageDeposit" >
|
58
|
insert into storage_deposit (id, product_id, goods_id,
|
55
|
insert into storage_deposit (id, product_id, goods_id,
|
59
|
storage_id, deposit_code, shelf_code,
|
56
|
storage_id, deposit_code, shelf_code,
|
|
@@ -283,7 +280,11 @@ |
|
@@ -283,7 +280,11 @@ |
283
|
</select>
|
280
|
</select>
|
284
|
|
281
|
|
285
|
<select id="queryUserDepositProduct" resultMap="CountResultMap">
|
282
|
<select id="queryUserDepositProduct" resultMap="CountResultMap">
|
286
|
- select product_id , count(distinct storage_id) as storage_id_count,count(*) as storage_count,sum( if( order_status = 0, 1, 0)) as un_shelf_storage_count,max(skup) as skup from storage_deposit
|
283
|
+ select product_id ,
|
|
|
284
|
+ count(distinct storage_id) as storage_id_count,
|
|
|
285
|
+ count(*) as storage_count,
|
|
|
286
|
+ sum( if( order_status = 0, 1, 0)) as un_shelf_storage_count,
|
|
|
287
|
+ max(skup) as skup from storage_deposit
|
287
|
where owner_uid = #{uid} and status=1 and del_status=0
|
288
|
where owner_uid = #{uid} and status=1 and del_status=0
|
288
|
and product_id in
|
289
|
and product_id in
|
289
|
<foreach item="item" index="index" collection="productIdList" open="(" separator="," close=")">
|
290
|
<foreach item="item" index="index" collection="productIdList" open="(" separator="," close=")">
|
|
@@ -291,10 +292,12 @@ |
|
@@ -291,10 +292,12 @@ |
291
|
</foreach>
|
292
|
</foreach>
|
292
|
group by product_id
|
293
|
group by product_id
|
293
|
</select>
|
294
|
</select>
|
|
|
295
|
+
|
294
|
<select id="queryUserDopositBackCount" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
|
296
|
<select id="queryUserDopositBackCount" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
|
295
|
select count(*) from storage_deposit
|
297
|
select count(*) from storage_deposit
|
296
|
where owner_uid = #{uid} and status in(2,3,4,5) and out_type in(1,3) and del_status=0
|
298
|
where owner_uid = #{uid} and status in(2,3,4,5) and out_type in(1,3) and del_status=0
|
297
|
</select>
|
299
|
</select>
|
|
|
300
|
+
|
298
|
<select id="queryUserDopositBack" resultMap="BaseResultMap">
|
301
|
<select id="queryUserDopositBack" resultMap="BaseResultMap">
|
299
|
select * from storage_deposit
|
302
|
select * from storage_deposit
|
300
|
where owner_uid = #{uid} and status in(2,3,4,5) and out_type in(1,3) and del_status=0
|
303
|
where owner_uid = #{uid} and status in(2,3,4,5) and out_type in(1,3) and del_status=0
|
|
@@ -331,7 +334,8 @@ |
|
@@ -331,7 +334,8 @@ |
331
|
|
334
|
|
332
|
<select id="getDepositOffs" resultMap="BaseResultMap">
|
335
|
<select id="getDepositOffs" resultMap="BaseResultMap">
|
333
|
select * from storage_deposit
|
336
|
select * from storage_deposit
|
334
|
- where owner_uid = #{uid} and storage_id = #{storageId} and status=1 and order_status=0 and del_status=0 limit 0, #{count}
|
337
|
+ where owner_uid = #{uid} and storage_id = #{storageId}
|
|
|
338
|
+ and status=1 and order_status=0 and del_status=0 limit 0, #{count}
|
335
|
</select>
|
339
|
</select>
|
336
|
|
340
|
|
337
|
<select id="selectByDepositCode" resultMap="BaseResultMap">
|
341
|
<select id="selectByDepositCode" resultMap="BaseResultMap">
|
|
@@ -350,7 +354,10 @@ |
|
@@ -350,7 +354,10 @@ |
350
|
<if test="outType != null" >
|
354
|
<if test="outType != null" >
|
351
|
, out_type = #{outType}
|
355
|
, out_type = #{outType}
|
352
|
</if>
|
356
|
</if>
|
353
|
- where id = #{depositId,jdbcType=INTEGER} AND del_status = 0 AND order_status = #{orderStatus,jdbcType=INTEGER} AND owner_uid = #{uid,jdbcType=INTEGER}
|
357
|
+ where id = #{depositId,jdbcType=INTEGER}
|
|
|
358
|
+ AND del_status = 0
|
|
|
359
|
+ AND order_status = #{orderStatus,jdbcType=INTEGER}
|
|
|
360
|
+ AND owner_uid = #{uid,jdbcType=INTEGER}
|
354
|
</update>
|
361
|
</update>
|
355
|
|
362
|
|
356
|
<select id="selectByOrderCode" resultMap="BaseResultMap">
|
363
|
<select id="selectByOrderCode" resultMap="BaseResultMap">
|
|
@@ -401,6 +408,17 @@ |
|
@@ -401,6 +408,17 @@ |
401
|
<update id="updateDelStatusByCode">
|
408
|
<update id="updateDelStatusByCode">
|
402
|
update storage_deposit
|
409
|
update storage_deposit
|
403
|
set del_status = 1, update_time = unix_timestamp(now())
|
410
|
set del_status = 1, update_time = unix_timestamp(now())
|
404
|
- where deposit_code = #{depositCode,jdbcType=VARCHAR} AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER} AND status = #{status,jdbcType=INTEGER}
|
411
|
+ where deposit_code = #{depositCode,jdbcType=VARCHAR}
|
|
|
412
|
+ AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
413
|
+ AND status = #{status,jdbcType=INTEGER}
|
|
|
414
|
+ </update>
|
|
|
415
|
+
|
|
|
416
|
+
|
|
|
417
|
+ <update id="updateStorageShelveStatusByCAS">
|
|
|
418
|
+ update storage_deposit
|
|
|
419
|
+ set order_status = #{status,jdbcType=INTEGER} ,update_time = unix_timestamp(now())
|
|
|
420
|
+ where owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
421
|
+ and deposit_code = #{depositCode,jdbcType=VARCHAR}
|
|
|
422
|
+ AND order_status = #{expectStatus,jdbcType=INTEGER}
|
405
|
</update>
|
423
|
</update>
|
406
|
</mapper> |
424
|
</mapper> |