From 10ade08bd530b7ee6b5dd83194c8f48d19b327ef Mon Sep 17 00:00:00 2001
From: tzsk <Administrator@qq.com>
Date: 星期四, 11 四月 2024 13:36:50 +0800
Subject: [PATCH] #

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

diff --git a/src/main/resources/mapper/OrderDetlMapper.xml b/src/main/resources/mapper/OrderDetlMapper.xml
index b1ffd1a..66c456b 100644
--- a/src/main/resources/mapper/OrderDetlMapper.xml
+++ b/src/main/resources/mapper/OrderDetlMapper.xml
@@ -85,15 +85,30 @@
         where 1=1
         and order_no = #{orderNo}
         and matnr = #{matnr}
-        <if test="batch!=null and batch!='' ">
-            and batch = #{batch}
-        </if>
-        <if test="csocode!=null and csocode!='' ">
-            and three_code = #{csocode}
-        </if>
-        <if test="isocode!=null and isocode!='' ">
-            and dead_time = #{isocode}
-        </if>
+        <choose>
+            <when test="batch != null and batch != ''">
+                and batch = #{batch}
+            </when>
+            <otherwise>
+                and (batch IS NULL OR batch = '')
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="csocode != null and csocode != ''">
+                and three_code = #{csocode}
+            </when>
+            <otherwise>
+                and (three_code IS NULL OR three_code = '')
+            </otherwise>
+        </choose>
+        <choose>
+            <when test="isocode != null and isocode != ''">
+                and dead_time = #{isocode}
+            </when>
+            <otherwise>
+                and (dead_time IS NULL OR dead_time = '')
+            </otherwise>
+        </choose>
     </select>
 
     <select id="selectItemNoneOfBatch" resultMap="BaseResultMap">

--
Gitblit v1.9.1