From 7bf1dd9bcad92bd4995d7d8f9aa294c2ff7ec4e3 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期五, 07 六月 2024 16:50:55 +0800
Subject: [PATCH] #

---
 zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml b/zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml
index 05fb103..219b7a5 100644
--- a/zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml
+++ b/zy-asrs-common/src/main/resources/mapper/wms/OrderDetlMapper.xml
@@ -29,6 +29,7 @@
         where 1=1
         and order_id = #{orderId}
         and matnr = #{matnr}
+        and host_id = #{hostId}
         <choose>
             <when test="batch != null and batch != ''">
                 and batch = #{batch}
@@ -86,7 +87,7 @@
 
     <update id="decrease">
         update wms_order_detl
-        set qty = qty - #{qty}
+        set work_qty = work_qty - #{qty}
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
@@ -107,6 +108,7 @@
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
+        and host_id = #{hostId}
         <choose>
             <when test="batch != null and batch != ''">
                 and batch = #{batch}
@@ -123,6 +125,24 @@
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
+        and host_id = #{hostId}
+        <choose>
+            <when test="batch != null and batch != ''">
+                and batch = #{batch}
+            </when>
+            <otherwise>
+                and (batch IS NULL OR batch = '')
+            </otherwise>
+        </choose>
+    </update>
+
+    <update id="increaseWorkQty">
+        update wms_order_detl
+        set work_qty = work_qty + #{workQty}
+        where 1=1
+        and order_id = #{orderId}
+        and matnr = #{matnr}
+        and host_id = #{hostId}
         <choose>
             <when test="batch != null and batch != ''">
                 and batch = #{batch}

--
Gitblit v1.9.1