From f34da12c558d57d156529e23c04e2388e60b94e5 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期三, 14 六月 2023 10:27:17 +0800
Subject: [PATCH] #组托逻辑

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

diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index b8e55d7..c2043b0 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -45,6 +45,9 @@
         <result column="update_by" property="updateBy" />
         <result column="update_time" property="updateTime" />
         <result column="memo" property="memo" />
+        <result column="owner" property="owner" />
+        <result column="payment" property="payment" />
+        <result column="uuid" property="uuid" />
 
     </resultMap>
 
@@ -68,7 +71,7 @@
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
-        <if test="batch!=null and batch!='' ">
+        <if test="batch!=null and batch!=''">
             and batch = #{batch}
         </if>
     </select>
@@ -124,10 +127,21 @@
         and mdt.pakout = 1
         <include refid="pakOutPageCondition"></include>
     </select>
+    <select id="checkAllDetlFinish" resultType="java.lang.Integer">
+        SELECT count(*) From man_order_detl WHERE qty &lt; anfme and order_no = #{orderNo}
+    </select>
+    <select id="sameOrderComb" resultType="java.lang.Integer">
+        SELECT SUM(anfme) FROM cust_wait_pakin WHERE  1=1
+        <if test="orderNo!=null and orderNo!='' ">
+            and order_no like '%' + #{orderNo} + '%'
+        </if>
+        and matnr = #{matnr}
+        and batch = #{batch}
+    </select>
 
     <update id="increase">
         update man_order_detl
-        set qty = qty + #{qty}
+        set work_qty = work_qty + #{workQty}
         where 1=1
         and order_id = #{orderId}
         and matnr = #{matnr}
@@ -143,16 +157,16 @@
 
     <update id="decrease">
         update man_order_detl
-        set qty = qty - #{qty}
+        set work_qty = work_qty - #{workQty}
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
         <choose>
-            <when test="batch != null and batch != ''">
+            <when test="batch != null">
                 and batch = #{batch}
             </when>
             <otherwise>
-                and (batch IS NULL OR batch = '')
+                and (batch IS NULL )
             </otherwise>
         </choose>
     </update>
@@ -168,6 +182,22 @@
         INSERT INTO man_order_detl_log SELECT * FROM man_order_detl WHERE id = #{id}
     </insert>
 
+    <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="increaseWorkQty">
         update man_order_detl
         set work_qty = work_qty + #{workQty}

--
Gitblit v1.9.1