From 32113f6676c04509099f1d6e1efc1f8fe96bc44e Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期四, 03 十一月 2022 14:54:44 +0800
Subject: [PATCH] #

---
 src/main/resources/mapper/LocDetlMapper.xml |   26 ++++++++++++++++++++++----
 1 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/src/main/resources/mapper/LocDetlMapper.xml b/src/main/resources/mapper/LocDetlMapper.xml
index 21347a7..aa3488a 100644
--- a/src/main/resources/mapper/LocDetlMapper.xml
+++ b/src/main/resources/mapper/LocDetlMapper.xml
@@ -207,14 +207,28 @@
             where 1=1
             and b.loc_sts = 'F'
             and a.matnr = #{matnr}
+            and b.row1 >= 31
+            and b.row1 &lt;= 32
+            group by b.bay1
+            union
+            select
+            no = 2,
+            orderBy = 'true',
+            b.bay1 as bay,
+            sum(anfme) as count
+            from asr_loc_detl a
+            left join asr_loc_mast b on a.loc_no = b.loc_no
+            where 1=1
+            and b.loc_sts = 'F'
+            and a.matnr = #{matnr}
             and b.row1 >= 2
             and b.row1 &lt;= 17
             group by b.bay1
             union
             select
-            no = 2,
+            no = 3,
             orderBy = 'false',
-            b.bay1,
+            b.bay1 as bay,
             sum(anfme) as count
             from asr_loc_detl a
             left join asr_loc_mast b on a.loc_no = b.loc_no
@@ -225,7 +239,7 @@
             and b.row1 &lt;= 30
             group by b.bay1
         ) a
-        order by count desc
+        order by no, count desc
     </select>
 
     <select id="queryStock" resultMap="BaseResultMap">
@@ -235,10 +249,14 @@
         left join asr_loc_mast b on a.loc_no = b.loc_no
         where 1=1
         <if test="no!=null and no == 1">
+            and b.row1 >= 31
+            and b.row1 &lt;= 32
+        </if>
+        <if test="no!=null and no == 2">
             and b.row1 >= 2
             and b.row1 &lt;= 17
         </if>
-        <if test="no!=null and no == 2">
+        <if test="no!=null and no == 3">
             and b.row1 >= 18
             and b.row1 &lt;= 30
         </if>

--
Gitblit v1.9.1