From 94e89a3391c7f28d9002fbcc0cafdbf6d05d7e73 Mon Sep 17 00:00:00 2001
From: gdg <764716047@qq.com>
Date: 星期三, 03 二月 2021 15:48:28 +0800
Subject: [PATCH] 取消领用

---
 src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml |   41 ++++++++++++++++++++++++++++++++++++++---
 1 files changed, 38 insertions(+), 3 deletions(-)

diff --git a/src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml b/src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml
index 96315bf..dfc4fef 100644
--- a/src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml
+++ b/src/main/java/com/nanometer/smartlab/dao/OpeUseFlowDao.xml
@@ -85,6 +85,10 @@
     <if test="endDate != null and endDate !=''">
         and oa.create_time &lt;= #{endDate}
     </if>
+    <if test="containerCode != null and containerCode !=''">
+        and wc.container_code = #{containerCode}
+        or lc.container_code =#{containerCode}
+    </if>
   </sql>
 
     <sql id="queryColumns">
@@ -194,6 +198,7 @@
         </if>
         WHERE ouf.operatestate = #{operatestate}
         and   LENGTH(trim(ouf.receipt_number))>0
+        and ouf.valid_flag = 1
         <if test="reagentCode !=null and reagentCode != ''">
             and ouf.reagent_code like concat("%",#{reagentCode},"%")
         </if>
@@ -211,6 +216,12 @@
         </if>
         <if test="receiptNumber !=null and receiptNumber != ''">
             and ouf.receipt_number like concat("%",#{receiptNumber},"%")
+        </if>
+        <if test="reagentName !=null and reagentName != ''">
+            and sr.name like concat("%",#{reagentName},"%")
+        </if>
+        <if test="applyPerson !=null and applyPerson != ''">
+            and su.name like concat("%",#{applyPerson},"%")
         </if>
         group by ouf.receipt_number) a
 
@@ -240,6 +251,7 @@
         </if>
         WHERE ouf.operatestate = #{operatestate}
         and   LENGTH(trim(ouf.receipt_number))>0
+        and ouf.valid_flag = 1
         <if test="reagentCode !=null and reagentCode != ''">
             and ouf.reagent_code like concat("%",#{reagentCode},"%")
         </if>
@@ -258,6 +270,12 @@
         <if test="receiptNumber !=null and receiptNumber != ''">
             and ouf.receipt_number like concat("%",#{receiptNumber},"%")
         </if>
+        <if test="reagentName !=null and reagentName != ''">
+            and sr.name like concat("%",#{reagentName},"%")
+        </if>
+        <if test="applyPerson !=null and applyPerson != ''">
+            and su.name like concat("%",#{applyPerson},"%")
+        </if>
         group by ouf.receipt_number
         ORDER BY ouf.create_time desc
         <if test="first != null and pageSize != null">
@@ -265,14 +283,14 @@
         </if>
     </select>
     <select id="getApplyInfo" resultType="com.nanometer.smartlab.entity.dto.PersonUseDetail">
-        SELECT
+         SELECT
         ors.reagent_id reagentId,
         ors.article_number articleNumber,
         ouf.reagent_code reagentCode,
         sr.product_sn productSn,
         sr.NAME reagentName,
-        bm1.meta_value  reagentFormat,
-        CONCAT(sr.per_box,bm1.meta_value) perInfo,
+        bm.meta_value  reagentFormat,
+        CONCAT(sr.main_metering,bm1.meta_value) perInfo,
         bm2.meta_value productHome,
         bm3.meta_value controlProducts
         from `ope_use_flow` ouf
@@ -284,6 +302,23 @@
         LEFT JOIN base_meta bm3 on bm3.id = sr.control_products
         WHERE ouf.operatestate = #{operatestate}
         and ouf.receipt_number = #{receiptNumber}
+        and ouf.valid_flag = 1
+    </select>
+
+
+    <select id="getApplyInfoSize" resultType="java.lang.Integer">
+        SELECT
+        count(0)
+        from `ope_use_flow` ouf
+        LEFT JOIN ope_reagent_status ors ON ors.reagent_code = ouf.reagent_code
+        LEFT join sys_reagent sr ON ors.reagent_id = sr.id
+        LEFT JOIN base_meta bm ON bm.id = sr.reagent_format
+        LEFT JOIN base_meta bm1 on bm1.id = sr.reagent_unit
+        LEFT JOIN base_meta bm2 on bm2.id = sr.product_home
+        LEFT JOIN base_meta bm3 on bm3.id = sr.control_products
+        WHERE ouf.operatestate = #{operatestate}
+        and ouf.receipt_number = #{receiptNumber}
+        and ouf.valid_flag = 1
     </select>
 
     <insert id="insertOpeUseFlow" parameterType="com.nanometer.smartlab.entity.OpeUseFlow">

--
Gitblit v1.9.2