From 00860b3f449e5b3289f2809c199dd56ec75d46e3 Mon Sep 17 00:00:00 2001
From: zhang <zc857179121@qq.com>
Date: 星期一, 20 十月 2025 08:57:20 +0800
Subject: [PATCH] 1
---
src/main/resources/mapper/OrderDetlMapper.xml | 88 +++++++++++++++++++++++++++++++++++++++++--
1 files changed, 83 insertions(+), 5 deletions(-)
diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index b8e55d7..3cecff7 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -124,15 +124,45 @@
and mdt.pakout = 1
<include refid="pakOutPageCondition"></include>
</select>
+ <select id="checkAllDetlFinish" resultType="java.lang.Integer">
+ SELECT count(*) From man_order_detl WHERE qty < 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}
+ <choose>
+ <when test="batch != null and batch!='' ">
+ and batch = #{batch}
+ </when>
+ <otherwise>
+ and (batch IS NULL OR batch = '')
+ </otherwise>
+ </choose>
+ </select>
+ <select id="selectCountToAsrByMatnr" resultType="java.lang.Long">
+ SELECT ISNULL(SUM(anfme), 0) FROM asr_loc_detl WHERE matnr = #{matnr}
+ <if test="batch!=null and batch!='' ">
+ and batch = #{batch}
+ </if>
+ </select>
+ <select id="selectCountToManByMatnr" resultType="java.lang.Long">
+ SELECT ISNULL(SUM(anfme), 0) FROM man_loc_detl WHERE matnr = #{matnr}
+ <if test="batch!=null and batch!='' ">
+ and batch = #{batch}
+ </if>
+ </select>
<update id="increase">
update man_order_detl
- set qty = qty + #{qty}
+ set work_qty = work_qty + #{qty}
where 1=1
and order_id = #{orderId}
and matnr = #{matnr}
<choose>
- <when test="batch != null and batch != ''">
+ <when test="batch != null and batch!='' ">
and batch = #{batch}
</when>
<otherwise>
@@ -143,16 +173,16 @@
<update id="decrease">
update man_order_detl
- set qty = qty - #{qty}
+ set work_qty = work_qty - #{qty}
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 +198,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}
@@ -184,4 +230,36 @@
</choose>
</update>
+ <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="increaseWorkQtyByOrderNo">
+ update man_order_detl
+ set work_qty = work_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>
+
</mapper>
--
Gitblit v1.9.1