From b7e08df5a07b3fa832a46ecc31983e16f2bccc8c Mon Sep 17 00:00:00 2001
From: whycq <10027870+whycq@user.noreply.gitee.com>
Date: 星期一, 24 七月 2023 14:56:01 +0800
Subject: [PATCH] # 出库作业,和库存明细管理 排序
---
src/main/resources/mapper/LocMastMapper.xml | 144 ++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 144 insertions(+), 0 deletions(-)
diff --git a/src/main/resources/mapper/LocMastMapper.xml b/src/main/resources/mapper/LocMastMapper.xml
index 3664a87..621e466 100644
--- a/src/main/resources/mapper/LocMastMapper.xml
+++ b/src/main/resources/mapper/LocMastMapper.xml
@@ -16,6 +16,9 @@
<result column="lev1" property="lev1" />
<result column="full_plt" property="fullPlt" />
<result column="loc_type" property="locType" />
+ <result column="loc_type1" property="locType1" />
+ <result column="loc_type2" property="locType2" />
+ <result column="loc_type3" property="locType3" />
<result column="out_enable" property="outEnable" />
<result column="io_time" property="ioTime" />
<result column="first_time" property="firstTime" />
@@ -35,4 +38,145 @@
</resultMap>
+ <select id="queryFreeLocMast" resultMap="BaseResultMap">
+ select top 1 *
+ from asr_loc_mast
+ where row1=#{row}
+ and loc_sts='O'
+ <if test="locType1 != null">
+ and loc_type1 = #{locType1}
+ </if>
+<!-- <if test="locType2 != null">-->
+<!-- and loc_type2 = #{locType2}-->
+<!-- </if>-->
+<!-- <if test="locType3 != null">-->
+<!-- and loc_type3 = #{locType3}-->
+<!-- </if>-->
+ order by loc_sts desc ,lev1 asc,bay1 asc
+ </select>
+
+ <select id="queryFreeLocMastIncludeFirst" resultMap="BaseResultMap">
+ select top 1 *
+ from asr_loc_mast
+ where row1=#{row}
+ and bay1 = 1
+ and loc_sts='O'
+ <if test="locType1 != null">
+ and loc_type1 = #{locType1}
+ </if>
+ <!-- <if test="locType2 != null">-->
+ <!-- and loc_type2 = #{locType2}-->
+ <!-- </if>-->
+ <!-- <if test="locType3 != null">-->
+ <!-- and loc_type3 = #{locType3}-->
+ <!-- </if>-->
+ order by loc_sts desc ,lev1 asc,bay1 asc
+ </select>
+ <select id="queryFreeLocMastExceptFirst" resultMap="BaseResultMap">
+ select top 1 *
+ from asr_loc_mast
+ where row1=#{row}
+ and bay1 > 1
+ and loc_sts='O'
+ <if test="locType1 != null">
+ and loc_type1 = #{locType1}
+ </if>
+ <!-- <if test="locType2 != null">-->
+ <!-- and loc_type2 = #{locType2}-->
+ <!-- </if>-->
+ <!-- <if test="locType3 != null">-->
+ <!-- and loc_type3 = #{locType3}-->
+ <!-- </if>-->
+ order by loc_sts desc ,lev1 asc,bay1 asc
+ </select>
+
+ <select id="queryShallowLocFMast" resultMap="BaseResultMap">
+ select * from asr_loc_mast
+ where 1=1
+ and loc_no in (
+ select
+ concat(
+ (
+ case
+ when left(loc_no, 2) = '01' then '02'
+ end)
+ , right(loc_no, 5)) as shallowLocNo
+ from asr_loc_mast
+ where 1=1
+ and loc_sts = 'O'
+ and row1 in (1)
+ )
+ and (loc_sts = 'F' or loc_sts = 'D') and crn_no=1
+ </select>
+
+ <select id="queryNeedMoveShallLocF" resultMap="BaseResultMap">
+ select * from asr_loc_mast
+ where 1=1
+ and loc_no in (
+ select
+ concat(
+ (
+ case
+ when left(loc_no, 2) = '01' then '02'
+ end)
+ , right(loc_no, 5)) as shallowLocNo
+ from asr_loc_mast
+ where 1=1
+ and loc_sts = 'D'
+ and row1 in (1)
+ )
+ and loc_sts = 'F' and crn_no=1
+ </select>
+
+ <select id="queryNeedMoveShallLocD" resultMap="BaseResultMap">
+ select * from asr_loc_mast
+ where 1=1
+ and loc_no in (
+ select
+ concat(
+ (
+ case
+ when left(loc_no, 2) = '01' then '02'
+ end)
+ , right(loc_no, 5)) as shallowLocNo
+ from asr_loc_mast
+ where 1=1
+ and loc_sts = 'F'
+ and row1 in (1)
+ )
+ and loc_sts = 'D' and crn_no=1
+ </select>
+
+ <select id="queryEmptyDeepLoc" resultMap="BaseResultMap">
+ select top 1 * from asr_loc_mast
+ where 1=1
+ and (loc_no in (
+ select
+ concat((case when left(loc_no, 2) = '02' then '01'end)
+ , right(loc_no, 5)) as deepLocNo
+ from asr_loc_mast
+ where 1=1 and loc_sts = 'O' and row1 in (2)
+ ) or row1=3)
+ and loc_sts = 'O' and crn_no = 1
+ order by newid()
+ </select>
+
+ <select id="queryDeepLocDMast" resultMap="BaseResultMap">
+ select * from asr_loc_mast
+ where 1=1
+ and loc_no in (
+ select
+ concat(
+ (
+ case
+ when left(loc_no, 2) = '02' then '01'
+ end)
+ , right(loc_no, 5)) as deepLocNo
+ from asr_loc_mast
+ where 1=1
+ and loc_sts = 'O'
+ and row1 in (2)
+ )
+ and loc_sts = 'D' and crn_no=1
+ </select>
</mapper>
--
Gitblit v1.9.1