From 65c305f9e8af6fdb4f80b85484b1170f068aa1fa Mon Sep 17 00:00:00 2001
From: zc <zc>
Date: 星期三, 10 九月 2025 10:43:27 +0800
Subject: [PATCH] 1

---
 src/main/resources/mapper/OrderDetlMapper.xml |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index ba0ddf5..c1224ca 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -80,9 +80,14 @@
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
-        <if test="batch!=null and batch!='' ">
-            and batch = #{batch}
-        </if>
+        <choose>
+            <when test="batch != null and batch != ''">
+                and batch = #{batch}
+            </when>
+            <otherwise>
+                and (batch IS NULL OR batch = '')
+            </otherwise>
+        </choose>
     </select>
 
     <select id="selectWorkingDetls" resultMap="BaseResultMap">
@@ -187,20 +192,27 @@
         INSERT INTO man_order_detl_log SELECT * FROM man_order_detl WHERE id = #{id}
     </insert>
 
-    <update id="increaseQtyByOrderNo">
+<!--    <update id="increaseQtyByOrderNo">-->
+<!--        update man_order_detl-->
+<!--        set qty = qty + #{qty}-->
+<!--        where 1=1-->
+<!--        and order_no = #{orderNo}-->
+<!--        and matnr = #{matnr}-->
+<!--        <choose>-->
+<!--            <when test="batch != null and batch != ''">-->
+<!--                and batch = #{batch}-->
+<!--            </when>-->
+<!--            <otherwise>-->
+<!--                and (batch IS NULL OR batch = '')-->
+<!--            </otherwise>-->
+<!--        </choose>-->
+<!--    </update>-->
+
+    <update id="increaseQtyById">
         update man_order_detl
         set qty = qty + #{qty}
         where 1=1
-        and order_no = #{orderNo}
-        and matnr = #{matnr}
-        <choose>
-            <when test="batch != null and batch != ''">
-                and batch = #{batch}
-            </when>
-            <otherwise>
-                and (batch IS NULL OR batch = '')
-            </otherwise>
-        </choose>
+        and id = #{id}
     </update>
 
     <update id="increaseWorkQty">

--
Gitblit v1.9.1