From a440992f23e33ccf9e0f6d52079e9b16813ead59 Mon Sep 17 00:00:00 2001
From: zhangc <zc@123>
Date: 星期二, 14 一月 2025 14:57:06 +0800
Subject: [PATCH] 优化MES调拨信息上报及库位查询逻辑

---
 src/main/resources/mapper/OrderDetlMapper.xml |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index 7b50892..47ec31a 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -101,6 +101,14 @@
         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="threeCode!=null and threeCode!='' ">
             and three_code = #{threeCode}
         </if>

--
Gitblit v1.9.1