From 4901728f970314cddd9fa167cf3d3fb9476208e5 Mon Sep 17 00:00:00 2001
From: wang..123 <brook_w@163.com>
Date: 星期五, 18 二月 2022 08:12:35 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/sxjzasrs' into sxjzasrs

---
 src/main/java/com/zy/asrs/mapper/LocMastMapper.java |   18 ++++++++++++++++--
 1 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
index 1dde7eb..b50bc1e 100644
--- a/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
+++ b/src/main/java/com/zy/asrs/mapper/LocMastMapper.java
@@ -7,11 +7,25 @@
 import org.apache.ibatis.annotations.Select;
 import org.springframework.stereotype.Repository;
 
+import java.util.List;
+
 @Mapper
 @Repository
 public interface LocMastMapper extends BaseMapper<LocMast> {
 
-    @Select("select top 1 * from asr_loc_mast where row1=#{row} and loc_sts='O' and loc_type=#{locType} order by loc_type desc ,lev1 asc,bay1 asc")
-    LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType") Integer locType);
+    @Select("select distinct row1 from asr_loc_mast where crn_no = #{crnNo}")
+    List<Integer> queryDistinctRow(@Param("crnNo")Integer crnNo);
+
+    LocMast queryFreeLocMast(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3);
+    LocMast queryFreeLocMastIncludeFirst(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3);
+    LocMast queryFreeLocMastExceptFirst(@Param("row") Integer row, @Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3);
+
+    @Select("select loc_no from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo}")
+    List<String> queryGroupEmptyStock(Integer crnNo);
+
+//    @Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and loc_type1 = #{locType1} and loc_type2 = #{locType2} and loc_type3 = #{locType3} and crn_no = #{crnNo}")
+@Select("select count(*) as count from asr_loc_mast where 1=1 and loc_sts = 'O' and crn_no = #{crnNo} and (loc_type1 is null or loc_type1 = #{locType1}) " +
+        "and (loc_type2 is null or loc_type2 = #{locType2}) and (loc_type3 is null or loc_type3 = #{locType3}) ")
+    Integer selectEmptyLocCount(@Param("locType1") Short locType1, @Param("locType2") Short locType2, @Param("locType3") Short locType3, @Param("crnNo") Integer crnNo);
 
 }

--
Gitblit v1.9.1