From d2be6e4afe1dba009b56f8555792f2823f9e4535 Mon Sep 17 00:00:00 2001
From: gdg <764716047@qq.com>
Date: 星期一, 22 二月 2021 10:34:59 +0800
Subject: [PATCH] 订单入库备货领取的返回 和修改 试剂直接入库和试剂管理 的搜索排序

---
 src/main/java/com/nanometer/smartlab/dao/OpeReagentStatusDao.xml |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeReagentStatusDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeReagentStatusDao.xml
index 50dd15a..25b2cd3 100644
--- a/src/main/java/com/nanometer/smartlab/dao/OpeReagentStatusDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/OpeReagentStatusDao.xml
@@ -223,7 +223,6 @@
     from ope_reagent_status as oa
    <include refid="queryJoins3"/>
     where oa.valid_flag = 1
-    	  and (oa.status = -1 or oa.status = 0 )
     <include refid="queryWhereSql3"/>
 	<if	test="applyPerson != null and applyPerson != ''"  >
 		and su.name like concat("%",#{applyPerson},"%")
@@ -263,7 +262,6 @@
    <include refid="queryJoins2"/>
    left  join sys_user su on su.id = oa.user_id
     where oa.valid_flag = 1
-   		 and (oa.status = -1 or oa.status = 0 )
     <include refid="queryWhereSql2"/>
 	  <if	test="applyPerson != null and applyPerson != ''"  >
 		  and su.name like concat("%",#{applyPerson},"%")
@@ -281,6 +279,10 @@
         insert into ope_reagent_status(id, reagent_id, article_number, reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, update_time,project_num)
         values (#{id}, #{reagentId}, #{articleNumber}, #{reagentCode}, #{status}, #{houseId}, #{containerId}, #{userId}, #{remainder}, #{place}, #{storeType}, 1, now(),#{projectNum})
     </insert>
+    <insert id="insertOpeReagentStatus2" parameterType="com.nanometer.smartlab.entity.OpeReagentStatus">
+		insert into ope_reagent_status(id, reagent_id, article_number, reagent_code, status, house_id, container_id, user_id, remainder, place, store_type, valid_flag, update_time,project_num,apply_code,order_code)
+        values (#{id}, #{reagentId}, #{articleNumber}, #{reagentCode}, #{status}, #{houseId}, #{containerId}, #{userId}, #{remainder}, #{place}, #{storeType}, 1, now(),#{projectNum},#{applyCode},#{orderCode})
+	</insert>
 
     <select id="getOpeReagentStatusByReagentCode" parameterType="java.lang.String" resultMap="OpeReagentStatus">
         select *
@@ -423,11 +425,29 @@
 	<update id="updateByReId" parameterType="java.util.Map">
         update ope_reagent_status set reagent_id=#{newReId} where reagent_id=#{oldReId}
     </update>
+    <update id="updateArticleNumberByRCode">
+		update ope_reagent_status set article_number = #{1}
+		where reagent_code = #{0}
+	</update>
 
-<select id="selectReagentCodesByReId" parameterType="java.lang.String" resultType="java.lang.String">
+    <select id="selectReagentCodesByReId" parameterType="java.lang.String" resultType="java.lang.String">
 	select reagent_code from ope_reagent_status WHERE
 	reagent_id = #{reagentId}
 	and valid_flag = 1
 	ORDER BY update_time
 </select>
+    <select id="countReagentByArticleAndWarehouse" resultType="java.lang.Integer">
+		select count(*)
+		from ope_reagent_status
+		WHERE status = 1
+		<if test="reagentId != null and reagentId !=''">
+			and reagent_id = #{reagentId}
+		</if>
+		<if test="articleNumber != null and articleNumber !=''">
+			and article_number = #{articleNumber}
+		</if>
+		<if test="warehouseId != null and warehouseId !=''">
+			and house_id = #{warehouseId}
+		</if>
+	</select>
 </mapper>

--
Gitblit v1.9.2