From ce641926a957d238b202aa0d9dac3b8f15aff153 Mon Sep 17 00:00:00 2001
From: ZY <zc857179121@qq.com>
Date: 星期三, 14 五月 2025 14:43:00 +0800
Subject: [PATCH] 123

---
 src/main/resources/mapper/LocMastMapper.xml |   40 ++++++++++++++++++++++++++++++++++++++--
 1 files changed, 38 insertions(+), 2 deletions(-)

diff --git a/src/main/resources/mapper/LocMastMapper.xml b/src/main/resources/mapper/LocMastMapper.xml
index 61d8a3a..7e262c2 100644
--- a/src/main/resources/mapper/LocMastMapper.xml
+++ b/src/main/resources/mapper/LocMastMapper.xml
@@ -33,12 +33,48 @@
         <result column="inv_wh" property="invWh" />
         <result column="mk" property="mk" />
         <result column="barcode" property="barcode" />
-        <result column="Pdc_type" property="PdcType" />
         <result column="ctn_no" property="ctnNo" />
 
     </resultMap>
 
     <select id="queryFreeLocMast" resultMap="BaseResultMap">
-        select top 1 * from asr_loc_mast where row1=#{row} and loc_sts='O' order by loc_sts desc ,lev1 asc,bay1 asc
+        select top 1 *
+        from asr_loc_mast
+        where row1=#{row}
+        and loc_sts='O'
+        <choose>
+            <when test="bay != null and (bay == 7 or bay == 5 or bay == 2)">
+                and bay1 in (7,5,2)
+            </when>
+            <when test="bay != null and (bay == 6 or bay == 4 or bay == 3 or bay == 1)">
+                and bay1 in (6,4,3,1)
+            </when>
+            <otherwise>
+
+            </otherwise>
+        </choose>
+        <if test="locType1 != null">
+            and loc_type1 = #{locType1}
+        </if>
+        <if test="locType2 != null">
+            and loc_type2 = #{locType2}
+        </if>
+        order by NEWID(),lev1 asc,bay1 asc
     </select>
+
+
+
+
+
+    <select id="queryDemoSourceLoc" resultMap="BaseResultMap">
+        select top 1 * from asr_loc_mast where crn_no = #{crnNo}
+        and loc_sts='D'
+        ORDER BY NEWID()
+    </select>
+
+    <select id="queryDemoLoc" resultMap="BaseResultMap">
+        select top 1 * from asr_loc_mast where crn_no = #{crnNo} and loc_sts = 'O'
+        ORDER BY NEWID()
+    </select>
+
 </mapper>

--
Gitblit v1.9.1