自动化立体仓库 - WMS系统
src/main/java/com/zy/asrs/mapper/WrkMastMapper.java
@@ -3,8 +3,12 @@
import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.zy.asrs.entity.WrkMast;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import java.util.Date;
import java.util.List;
@Mapper
@@ -14,4 +18,32 @@
//    @Select("select * from asr_wrk_mast where ((wrk_sts = 4 Or wrk_sts = 14 ) and io_type <> 103 and io_type <> 104 and io_type <> 107 ) or (wrk_sts = 2 and io_type=6) order by upd_mk,io_time,wrk_no")
    List<WrkMast> selectToBeCompleteData();
    List<WrkMast> selectToBeHistoryData();
    List<WrkMast> selectPendingInboundCameraCapture(@Param("pending") String pending, @Param("running") String running);
    @Update("update asr_wrk_mast set memo = #{next}, modi_time = getdate() where wrk_no = #{wrkNo} and memo = #{current}")
    int updateMemoIfCurrent(@Param("wrkNo") Integer wrkNo, @Param("current") String current, @Param("next") String next);
    @Select("select count(1) from asr_wrk_mast where 1=1 and io_type = #{ioType} and sta_no = #{staNo}")
    int selectWrkMastBareBoardStaNo(Integer ioType,Integer staNo);
    WrkMast selectWrkMast(Integer workNo,String barcode);
    List<WrkMast> selectWrkMastWrkDetl(@Param("ioType") Integer ioType, @Param("matnr") String matnr , @Param("batch") String batch , @Param("brand") String brand
            , @Param("standby1")String standby1, @Param("standby2")String standby2, @Param("standby3")String standby3
            , @Param("boxType1")String boxType1, @Param("boxType2")String boxType2, @Param("boxType3")String boxType3, @Param("crnNo") Integer crnNo);
    /**
     * 出库 101 下该单号同批次已出现的 plt_type(主表)
     */
    @Select("SELECT plt_type FROM asr_wrk_mast WHERE io_type = 101 AND plt_type IS NOT NULL AND plt_type > 0 AND user_no = #{userNo} AND ((#{batchSeq} IS NULL AND batch_seq IS NULL) OR batch_seq = #{batchSeq})")
    List<Integer> listOutboundPltTypesByUserNo(@Param("userNo") String userNo, @Param("batchSeq") String batchSeq);
    @Select("SELECT MIN(ISNULL(appe_time, io_time)) FROM asr_wrk_mast WHERE train_no = #{trainNo} AND io_type < 100")
    Date selectFirstInboundCreateTimeByTrainNo(@Param("trainNo") String trainNo);
    @Select("SELECT wrk_no FROM asr_wrk_mast WHERE train_no = #{trainNo} AND io_type < 100 AND wrk_sts = 5")
    List<Integer> listFinishedInboundWrkNosByTrainNo(@Param("trainNo") String trainNo);
}