自动化立体仓库 - WMS系统
pang.jiabao
2024-07-05 07c572bea979dbd3ee46ec24083cb1bdcc014e3a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
package com.zy.asrs.mapper;
 
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.LocMast;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
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 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);
 
    List<LocMast> queryShallowLocFMast();
 
    List<LocMast> queryNeedMoveShallLocF();
 
    List<LocMast> queryNeedMoveShallLocD();
 
    LocMast queryEmptyDeepLoc();
 
    List<LocMast> queryDeepLocDMast();
 
    /**
     * 根据堆垛机站点查询空库位
     * @param crnNo 堆垛机号
     * @return 库位
     */
    LocMast queryEmptyLocNoByStaNo(@Param("crnNo") int crnNo);
 
    LocMast queryLocByBarCode(@Param("row") int row);
 
    /**
     * 获取满足条件的空库位
     * @param devpNo 入库站点
     * @param flag 层标识,1表示去1-6层,2去表示7-11层
     * @return 库位
     */
    LocMast queryLocByBarCodeNew(@Param("devpNo") int devpNo, @Param("flag") int flag);
}