自动化立体仓库 - WMS系统
whycq
2023-07-24 b7e08df5a07b3fa832a46ecc31983e16f2bccc8c
src/main/resources/mapper/LocMastMapper.xml
@@ -104,8 +104,79 @@
         from asr_loc_mast
         where 1=1
         and loc_sts = 'O'
         and row1 in (1,4,5,8,9,12,13,16,17,20)
         and row1 in (1)
        )
        and (loc_sts = 'F' or loc_sts = 'D')
        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>