From 64126dfd00ed90af484fbf7b173e00fcebc4f9fa Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期三, 24 五月 2023 15:56:11 +0800
Subject: [PATCH] 入库通知档和历史档增加mat_type物料类型,组托增加mat_type

---
 src/main/resources/mapper/WrkMastMapper.xml |   20 +++++++++++++++++++-
 1 files changed, 19 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/WrkMastMapper.xml b/src/main/resources/mapper/WrkMastMapper.xml
index 323d5ec..a101e3e 100644
--- a/src/main/resources/mapper/WrkMastMapper.xml
+++ b/src/main/resources/mapper/WrkMastMapper.xml
@@ -66,7 +66,7 @@
     </resultMap>
 
     <select id="selectToBeCompleteData" resultMap="BaseResultMap">
-        select * from asr_wrk_mast where ((wrk_sts = 9 Or wrk_sts = 17) and io_type != 11 and io_type != 103 and io_type != 104 and io_type != 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no
+        select * from asr_wrk_mast where ((wrk_sts = 9 Or (wrk_sts = 17 and io_type != 11))  and io_type != 103 and io_type != 104 and io_type != 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no
     </select>
 
     <select id="selectToBeHistoryData" resultMap="BaseResultMap">
@@ -100,4 +100,22 @@
         select top 1 * from asr_wrk_mast where wrk_no=#{wrkNo} and wrk_sts=17 and io_type = #{ioType}
     </select>
 
+    <select id="selectPakoutOfStaNo" resultMap="BaseResultMap">
+        select top 1 * from (
+            select top 1 * from asr_wrk_mast where 1=1
+            and crn_no = 2
+            and wrk_sts in (12,13,14,15,16)
+            and source_sta_no = #{staNo}
+            and io_type in (101.103,104,107,110)
+            union
+            select top 1 * from asr_wrk_mast where 1=1
+            and wrk_sts in (17,18)
+            and io_type in (101.103,104,107,110)
+            and wrk_no in (
+                select wrk_no from asr_bas_devp where 1=1 and dev_no = #{staNo}
+            )
+        ) a
+
+    </select>
+
 </mapper>

--
Gitblit v1.9.1