...
|
...
|
@@ -43,6 +43,7 @@ |
|
|
from storage_deposit
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</select>
|
|
|
|
|
|
<select id="queryByDepositCode" resultMap="BaseResultMap">
|
|
|
select
|
|
|
<include refid="Base_Column_List" />
|
...
|
...
|
@@ -50,10 +51,6 @@ |
|
|
where deposit_code = #{depositCode} and del_status=0 and owner_uid=#{uid}
|
|
|
</select>
|
|
|
|
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
|
|
|
delete from storage_deposit
|
|
|
where id = #{id,jdbcType=INTEGER}
|
|
|
</delete>
|
|
|
<insert id="insert" parameterType="com.yohoufo.dal.order.model.StorageDeposit" >
|
|
|
insert into storage_deposit (id, product_id, goods_id,
|
|
|
storage_id, deposit_code, shelf_code,
|
...
|
...
|
@@ -283,7 +280,11 @@ |
|
|
</select>
|
|
|
|
|
|
<select id="queryUserDepositProduct" resultMap="CountResultMap">
|
|
|
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
|
|
|
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
|
|
|
where owner_uid = #{uid} and status=1 and del_status=0
|
|
|
and product_id in
|
|
|
<foreach item="item" index="index" collection="productIdList" open="(" separator="," close=")">
|
...
|
...
|
@@ -291,10 +292,12 @@ |
|
|
</foreach>
|
|
|
group by product_id
|
|
|
</select>
|
|
|
|
|
|
<select id="queryUserDopositBackCount" resultType="java.lang.Integer" parameterType="java.lang.Integer" >
|
|
|
select count(*) from storage_deposit
|
|
|
where owner_uid = #{uid} and status in(2,3,4,5) and out_type in(1,3) and del_status=0
|
|
|
</select>
|
|
|
|
|
|
<select id="queryUserDopositBack" resultMap="BaseResultMap">
|
|
|
select * from storage_deposit
|
|
|
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 @@ |
|
|
|
|
|
<select id="getDepositOffs" resultMap="BaseResultMap">
|
|
|
select * from storage_deposit
|
|
|
where owner_uid = #{uid} and storage_id = #{storageId} and status=1 and order_status=0 and del_status=0 limit 0, #{count}
|
|
|
where owner_uid = #{uid} and storage_id = #{storageId}
|
|
|
and status=1 and order_status=0 and del_status=0 limit 0, #{count}
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByDepositCode" resultMap="BaseResultMap">
|
...
|
...
|
@@ -350,7 +354,10 @@ |
|
|
<if test="outType != null" >
|
|
|
, out_type = #{outType}
|
|
|
</if>
|
|
|
where id = #{depositId,jdbcType=INTEGER} AND del_status = 0 AND order_status = #{orderStatus,jdbcType=INTEGER} AND owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
where id = #{depositId,jdbcType=INTEGER}
|
|
|
AND del_status = 0
|
|
|
AND order_status = #{orderStatus,jdbcType=INTEGER}
|
|
|
AND owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
<select id="selectByOrderCode" resultMap="BaseResultMap">
|
...
|
...
|
@@ -401,6 +408,17 @@ |
|
|
<update id="updateDelStatusByCode">
|
|
|
update storage_deposit
|
|
|
set del_status = 1, update_time = unix_timestamp(now())
|
|
|
where deposit_code = #{depositCode,jdbcType=VARCHAR} AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER} AND status = #{status,jdbcType=INTEGER}
|
|
|
where deposit_code = #{depositCode,jdbcType=VARCHAR}
|
|
|
AND del_status = 0 AND owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
AND status = #{status,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
|
|
|
|
|
|
<update id="updateStorageShelveStatusByCAS">
|
|
|
update storage_deposit
|
|
|
set order_status = #{status,jdbcType=INTEGER} ,update_time = unix_timestamp(now())
|
|
|
where owner_uid = #{uid,jdbcType=INTEGER}
|
|
|
and deposit_code = #{depositCode,jdbcType=VARCHAR}
|
|
|
AND order_status = #{expectStatus,jdbcType=INTEGER}
|
|
|
</update>
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|