From c664c49f8e211b7b791a5ff1e63cda53c1b1264e Mon Sep 17 00:00:00 2001
From: cl <1442464845@qq.com>
Date: 星期日, 05 四月 2026 01:04:47 +0800
Subject: [PATCH] # 明细历史优化+打印

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

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 2139ca6..a541c2f 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -64,6 +64,15 @@
         where 1=1
         and loc_no = #{locNo}
         and matnr = #{matnr}
+--         and (batch IS NULL OR batch = '')
+        <choose>
+            <when test="batch != null and batch != ''">
+                and batch = #{batch}
+            </when>
+            <!--            <otherwise>-->
+            <!--                and (supp_code IS NULL OR supp_code = '')-->
+            <!--            </otherwise>-->
+        </choose>
         <choose>
             <when test="suppCode != null and suppCode != ''">
                 and supp_code = #{suppCode}
@@ -343,7 +352,7 @@
         AND ld.matnr = #{matnr}
         AND (lm.loc_sts = 'F')
         AND dual.count = 1
-        ORDER BY lm.modi_time ASC
+        ORDER BY lm.appe_time ASC
     </select>
 
     <select id="selectSameLevDetl" resultType="java.lang.String">
@@ -403,4 +412,12 @@
         and loc_no = #{locNo}
         and matnr = #{matnr}
     </update>
+
+    <update id="updateNewMatnr">
+        update asr_loc_detl
+        set matnr = #{matnrNew}
+          , modi_time = getdate()
+        where 1=1
+          and matnr = #{matnrOld}
+    </update>
 </mapper>

--
Gitblit v1.9.1