From ca8f5a8f133e7f5b00b9d35ff6d15720804569af Mon Sep 17 00:00:00 2001
From: zyx <zyx123456>
Date: 星期三, 31 一月 2024 10:15:32 +0800
Subject: [PATCH] Merge branch 'ryzhwcs' of http://47.97.1.152:5880/r/zy-wcs into ryzhwcs

---
 src/main/resources/mapper/TaskWrkMapper.xml |   44 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/src/main/resources/mapper/TaskWrkMapper.xml b/src/main/resources/mapper/TaskWrkMapper.xml
index f855a7a..cc05d5d 100644
--- a/src/main/resources/mapper/TaskWrkMapper.xml
+++ b/src/main/resources/mapper/TaskWrkMapper.xml
@@ -33,6 +33,13 @@
         and task_no = #{taskNo}
     </select>
 
+    <select id="selectByStartPoint" resultMap="BaseResultMap">
+        select top 1 * from wcs_task_wrk
+        where 1=1
+        and io_type=3
+        and start_point = #{startPoint}
+    </select>
+
     <select id="selectByWrkNo" resultMap="BaseResultMap">
         select top 1 * from wcs_task_wrk
         where 1=1
@@ -49,6 +56,12 @@
         order by io_pri desc,create_time,wrk_no ASC
     </select>
 
+    <select id="selectReceive" resultMap="BaseResultMap">
+        select * from wcs_task_wrk
+        where 1=1
+        and status = 1
+    </select>
+
     <select id="selectPakOutIoType" resultMap="BaseResultMap">
         select * from dbo.wcs_task_wrk
         where crn_no=#{crnNo}
@@ -56,10 +69,21 @@
         order by io_pri desc,create_time,wrk_no ASC
     </select>
 
-    <select id="selectPakOut" resultMap="BaseResultMap">
+    <select id="selectCrnStaWorking" resultMap="BaseResultMap">
         select * from dbo.wcs_task_wrk
         where crn_no=#{crnNo}
         and target_point=#{targetPoint}
+        and wrk_sts=12
+        and io_type = 2
+        order by io_pri desc,create_time,wrk_no ASC
+    </select>
+
+    <select id="selectPakOut" resultMap="BaseResultMap">
+        select * from dbo.wcs_task_wrk
+        where crn_no=#{crnNo}
+        <if test="targetPoint!=null and targetPoint!='' ">
+            and target_point=#{targetPoint}
+        </if>
         and wrk_sts=11
         and io_type = 2
         order by io_pri desc,create_time,wrk_no ASC
@@ -68,10 +92,10 @@
     <select id="selectPakOut3" resultMap="BaseResultMap">
         select * from dbo.wcs_task_wrk
         where crn_no=#{crnNo}
-        and target_point=#{targetPoint}
+--         and target_point=#{targetPoint}
         and wrk_sts=11
         and io_type = 3
-        order by io_pri desc,create_time,wrk_no ASC
+        order by io_pri desc,create_time ASC
     </select>
 
     <select id="selectCrnWorking" resultMap="BaseResultMap">
@@ -82,9 +106,10 @@
         order by io_pri desc,create_time,wrk_no ASC
     </select>
 
-    <select id="selectCrnNoWorking" resultMap="BaseResultMap">
+    <select id="selectCrnNoInWorking" resultMap="BaseResultMap">
         select top 1 * from dbo.wcs_task_wrk
         where 1=1
+        and io_type != 2
         and (wrk_sts=3 or wrk_sts=12)
         and crn_no=#{crnNo}
         and wrk_no=#{workNo}
@@ -94,12 +119,19 @@
     <select id="selectToBeHistoryData" resultMap="BaseResultMap">
         select * from dbo.wcs_task_wrk
         where 1=1
-        and (status=3 or status=4)
+        and ((wrk_sts=14 and status=5) or status=4 or (wrk_sts=4 and status=5))
         order by io_pri desc,create_time,wrk_no ASC
     </select>
 
     <insert id="saveToHistory">
-        insert into wcs_task_wrk_log select * from wcs_task_wrk where task_no = #{taskNo} and (status=3 or status=4)
+        insert into wcs_task_wrk_log select * from wcs_task_wrk where task_no = #{taskNo} and (status=5 or status=4)
     </insert>
 
+    <select id="selectWorkingTask" resultMap="BaseResultMap">
+        select * from dbo.wcs_task_wrk
+        where (wrk_sts=3 and io_type = 1)
+        or (wrk_sts=12 and io_type = 2)
+        order by io_pri desc,create_time,wrk_no ASC
+    </select>
+
 </mapper>

--
Gitblit v1.9.1