From 12862728f6123b2a9a927f6bad97317bc651d8c2 Mon Sep 17 00:00:00 2001
From: 李宇 <986321569@qq.com>
Date: 星期五, 23 四月 2021 15:43:39 +0800
Subject: [PATCH] 修改领用
---
src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml | 34 ++++++++++++++++++++++++++++------
1 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml
index 37123cb..40d4822 100644
--- a/src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/OpeWarehouseReserveDao.xml
@@ -12,6 +12,7 @@
<result property="validFlag" column="valid_flag" typeHandler="com.nanometer.smartlab.entity.handler.ValidFlagHandler"></result>
<result property="reagentId" column="reagent_id"></result>
+ <result property="userId" column="user_id"></result>
<association property="reagent" javaType="com.nanometer.smartlab.entity.SysReagent">
<id property="id" column="reagentId"/>
<result property="name" column="name"></result>
@@ -57,6 +58,9 @@
<if test="productSn != null and productSn != ''">
and sr.product_sn like concat('%',#{productSn},'%')
</if>
+ <if test="warehouseName != null and warehouseName != ''">
+ and sw.name like concat('%',#{warehouseName},'%')
+ </if>
</sql>
<sql id="queryColumns">
@@ -103,17 +107,33 @@
</select>
<insert id="insertOpeWarehouseReserve" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve">
- insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,container_id)
- values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{containerId})
+ insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,container_id,user_id)
+ values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{containerId},#{userId})
</insert>
<insert id="insertOpeWarehouseReserve2" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve">
- insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,apply_code,order_code,container_id)
- values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{applyCode},#{orderCode},#{containerId})
+ insert into ope_warehouse_reserve(id, reagent_id, article_number, reserve, valid_flag, update_time,warehouseId,apply_code,order_code,container_id,user_id)
+ values (#{id}, #{reagentId}, #{articleNumber}, #{reserve}, 1, now(),#{warehouseId},#{applyCode},#{orderCode},#{containerId},#{userId})
</insert>
<update id="updateOpeWarehouseReserve" parameterType="com.nanometer.smartlab.entity.OpeWarehouseReserve">
- update ope_warehouse_reserve set reagent_id=#{reagentId},warehouseId=#{warehouseId}, article_number=#{articleNumber}, reserve=#{reserve}, update_time=now(),
- container_id=#{containerId}
+ update ope_warehouse_reserve
+ <set>
+ reagent_id=#{reagentId},
+ reserve=#{reserve},
+ update_time=now(),
+ <if test="articleNumber != null and articleNumber !=''">
+ article_number=#{articleNumber},
+ </if>
+ <if test="warehouseId != null and warehouseId !=''">
+ warehouseId=#{warehouseId},
+ </if>
+ <if test="containerId != null and containerId !=''">
+ container_id=#{containerId},
+ </if>
+ <if test="userId != null and userId !=''">
+ user_id=#{userId},
+ </if>
+ </set>
where id=#{id}
</update>
@@ -160,6 +180,7 @@
owr.reserve,
owr.article_number,
owr.container_id,
+ owr.user_id,
owr.update_time
FROM
ope_warehouse_reserve owr
@@ -195,6 +216,7 @@
<update id="updateCount" parameterType="java.util.Map">
update ope_warehouse_reserve set reserve=reserve+1 where reagent_id=#{reagentId} and article_number=#{articleNumber}
+ and valid_flag = 1
</update>
<update id="updateBtReserve">
UPDATE ope_warehouse_reserve
--
Gitblit v1.9.2