From c1ef2d1fc4c0dae2bc8452924dcd77a0ff3a1ef5 Mon Sep 17 00:00:00 2001
From: cpT <1@123>
Date: 星期四, 19 六月 2025 15:02:52 +0800
Subject: [PATCH] #改造

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

diff --git a/src/main/resources/mapper/TaskWrkMapper.xml b/src/main/resources/mapper/TaskWrkMapper.xml
index c11c07d..1793962 100644
--- a/src/main/resources/mapper/TaskWrkMapper.xml
+++ b/src/main/resources/mapper/TaskWrkMapper.xml
@@ -52,6 +52,7 @@
     <select id="selectPakIn" resultMap="BaseResultMap">
         select top 1 * from "SOURCE"."wcs_task_wrk"
         where "STATUS"=1
+        and "WRK_STS"=2
         and "CRN_NO"=#{crnNo}
         and "WRK_NO"=#{workNo}
         and "START_POINT"=#{startPoint}
@@ -130,7 +131,11 @@
         insert into "SOURCE"."wcs_task_wrk_log"
         select * from "SOURCE"."wcs_task_wrk"
         where "TASK_NO" = #{taskNo}
-          and ("STATUS"=5 or "STATUS"=4 or "STATUS"=6)
+          and ("STATUS"=5 or "STATUS"=4 or "STATUS"=7)
+    </insert>
+
+    <insert id="saveToHistoryD">
+        insert into "SOURCE"."wcs_task_wrk_log" select * from "SOURCE"."wcs_task_wrk" where TASK_NO = #{taskNo}
     </insert>
 
     <select id="selectWorkingTask" resultMap="BaseResultMap">
@@ -140,4 +145,36 @@
         order by "IO_PRI" desc,"CREATE_TIME","WRK_NO" ASC
     </select>
 
+    <sql id="batchSeq">
+        <if test="wrkNo != null">
+            and WRK_NO = #{wrkNo}
+        </if>
+        <if test="taskNo != null">
+            and TASK_NO = #{taskNo}
+        </if>
+        <if test="status != null">
+            and STATUS = #{status}
+        </if>
+        <if test="modiTimeStart != null ">
+            <if test="modiTimeEnd != null ">
+                and MODI_TIME between #{modiTimeStart} and #{modiTimeEnd}
+            </if>
+        </if>
+    </sql>
+
+
+    <select id="selectTaskWrkList" resultMap="BaseResultMap">
+        SELECT * FROM "SOURCE"."wcs_task_wrk"
+        WHERE 1=1
+        <include refid="batchSeq"></include>
+        ORDER BY CREATE_TIME DESC
+        LIMIT #{pageSize} OFFSET ((#{pageNumber} - 1) * #{pageSize});
+    </select>
+
+    <select id="selectTaskWrkListTotal" resultType="Long">
+        SELECT count(1) FROM "SOURCE"."wcs_task_wrk"
+        WHERE 1=1
+        <include refid="batchSeq"></include>
+    </select>
+
 </mapper>

--
Gitblit v1.9.1