From 954465859ef42385a406788d19578335883abed1 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@163.com>
Date: 星期六, 14 五月 2022 23:39:53 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/LocDetlMapper.xml |   39 ++++++++++++++++++++++++++++++---------
 1 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 2ef13d2..ab1462b 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -199,19 +199,30 @@
         where 1=1
         and b.loc_sts = 'F'
         and a.matnr = #{matnr}
-        <choose>
-            <when test="batch != null and batch != ''">
-                and a.batch = #{batch}
-            </when>
-            <otherwise>
-                and (a.batch IS NULL OR a.batch = '')
-            </otherwise>
-        </choose>
+<!--        <choose>-->
+<!--            <when test="batch != null and batch != ''">-->
+<!--                and a.batch = #{batch}-->
+<!--            </when>-->
+<!--            <otherwise>-->
+<!--                and (a.batch IS NULL OR a.batch = '')-->
+<!--            </otherwise>-->
+<!--        </choose>-->
+        <if test="batch != null and batch != ''">
+            and a.batch = #{batch}
+        </if>
         <if test="orderNo != null and orderNo != ''">
             and a.orderNo = #{orderNo}
         </if>
+
+        <if test="locNos != null and locNos.size > 0">
+            and b.loc_no not in
+            <foreach item="item" collection="locNos" index="index"  separator="," open="(" close=")">
+                #{item}
+            </foreach>
+        </if>
+
         order by
-        DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time)
+        DATEPART(yyyy,a.modi_time),DATEPART(mm,a.modi_time),DATEPART(dd,a.modi_time), a.anfme
         desc,
         NEWID(),
         case
@@ -277,4 +288,14 @@
         </if>
     </select>
 
+    <select id="queryStockTotal" resultType="com.zy.asrs.entity.result.StockVo">
+        select
+        matnr,
+        batch,
+        count(anfme) as count
+        from asr_loc_detl
+        where 1=1
+        group by matnr,batch
+    </select>
+
 </mapper>

--
Gitblit v1.9.1