From b7b4510ab85d9c3a31645f56e3d799ad817d9762 Mon Sep 17 00:00:00 2001
From: bfwms <1>
Date: 星期二, 30 九月 2025 08:36:43 +0800
Subject: [PATCH] 订单不转历史

---
 src/main/resources/mapper/OrderDetlMapper.xml |   45 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index f57cc3f..46097bb 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -46,6 +46,7 @@
         <result column="update_by" property="updateBy" />
         <result column="update_time" property="updateTime" />
         <result column="memo" property="memo" />
+        <result column="owner" property="owner" />
 
     </resultMap>
 
@@ -69,14 +70,9 @@
         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>
+        <if test="batch!=null and batch!='' ">
+            and batch = #{batch}
+        </if>
     </select>
 
     <select id="selectWorkingDetls" resultMap="BaseResultMap">
@@ -86,9 +82,15 @@
         and qty &lt; anfme
     </select>
 
+    <select id="selectTotalDetls" resultMap="BaseResultMap">
+        select * from man_order_detl
+        where 1=1
+        and order_id = #{orderId}
+    </select>
+
     <sql id="pakOutPageCondition">
         <if test="order_id!=null and order_id!='' ">
-            and mod.order_id like '%' + #{order_id} + '%'
+            and mod.order_id = #{order_id}
         </if>
         <if test="matnr!=null and matnr!='' ">
             and mod.matnr like '%' + #{matnr} + '%'
@@ -131,6 +133,22 @@
         <include refid="pakOutPageCondition"></include>
     </select>
 
+    <update id="increaseAnfme">
+        update man_order_detl
+        set anfme = anfme + #{qty}
+        where 1=1
+        and order_id = #{orderId}
+        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="increase">
         update man_order_detl
         set qty = qty + #{qty}
@@ -170,4 +188,13 @@
         and order_id = #{orderId}
     </update>
 
+    <select id="selectRemainder" resultMap="BaseResultMap">
+        select
+        *
+        from man_order_detl
+        where 1=1
+        and anfme > qty
+        and order_id = #{orderId}
+    </select>
+
 </mapper>

--
Gitblit v1.9.1