From 8e943b7104561c3b14cf223016698709c5ade4b5 Mon Sep 17 00:00:00 2001
From: lty <876263681@qq.com>
Date: 星期二, 03 二月 2026 15:37:26 +0800
Subject: [PATCH] #pda料箱组托和换码

---
 src/main/resources/mapper/WrkDetlMapper.xml |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/WrkDetlMapper.xml b/src/main/resources/mapper/WrkDetlMapper.xml
index 225f31e..5894eba 100644
--- a/src/main/resources/mapper/WrkDetlMapper.xml
+++ b/src/main/resources/mapper/WrkDetlMapper.xml
@@ -56,6 +56,14 @@
                 and (batch IS NULL OR batch = '')
             </otherwise>
         </choose>
+        <choose>
+            <when test="barcode != null and barcode != ''">
+                and barcode = #{barcode}
+            </when>
+            <otherwise>
+                and (barcode IS NULL OR barcode = '')
+            </otherwise>
+        </choose>
     </sql>
 
 
@@ -79,6 +87,12 @@
         and wrk_no = #{wrkNo}
         and matnr = #{matnr}
         <include refid="batchSeq"></include>
+    </update>
+    <update id="updateBuyerLabel">
+        update asr_wrk_detl
+        set memo = #{buyerLabel}
+        where order_no = #{orderNo}
+        and barcode = #{barcode}
     </update>
 
     <select id="selectAndLogByOrderNo" resultMap="BaseResultMap">
@@ -108,4 +122,33 @@
         and awd.matnr + '-' + awd.batch = #{matnr}
     </select>
 
+    <select id="selectAndLogByOrderNoGroupByMatnrOfSum" resultMap="BaseResultMap">
+        select awd.wrk_no, awd.io_time, awd.matnr,awd.zpallet,awd.specs,awd.maktx, sum(awd.anfme) as anfme
+        from asr_wrk_detl awd
+        left join asr_wrk_mast awm on awd.wrk_no = awm.wrk_no and awd.io_time = awm.io_time
+        where order_no = #{orderNo}
+        group by awd.wrk_no, awd.io_time, awd.matnr ,awd.zpallet,awd.specs,awd.maktx
+        union
+        select distinct awdl.wrk_no, awdl.io_time, awdl.matnr,awdl.zpallet,awdl.specs,awdl.maktx, sum(awdl.anfme) as anfme
+        from asr_wrk_detl_log awdl
+        left join asr_wrk_mast_log awml on awdl.wrk_no = awml.wrk_no and awdl.io_time = awml.io_time
+        where awdl.order_no = #{orderNo}
+        and (awml.manu_type is null or awml.manu_type != '鎵嬪姩鍙栨秷')
+        and awml.io_type != 103
+        group by awdl.wrk_no, awdl.io_time, awdl.matnr ,awdl.zpallet,awdl.specs,awdl.maktx
+    </select>
+
+    <update id="updateIoTime">
+        update asr_wrk_detl
+        set io_time = #{ioTime}
+        where 1=1
+          and wrk_no = #{workNo}
+    </update>
+    <select id="findByWorkNo" resultMap="BaseResultMap">
+        select wrk_no, matnr, maktx, anfme ,specs,batch from asr_wrk_detl where 1=1 and wrk_no = #{workNo}
+    </select>
+
+    <select id="findByBarcode" resultMap="BaseResultMap">
+        select * from asr_wrk_detl where 1=1 and zpallet = #{barcode}
+    </select>
 </mapper>

--
Gitblit v1.9.1