pang.jiabao
2025-04-27 e9a5f5c065e7232e9d5ca1f2a4948d2f8e6e0c03
src/main/resources/mapper/WrkMastMapper.xml
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zy.asrs.mapper.WrkMastMapper">
<mapper namespace="com.zy.mapper.WrkMastMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMast">
    <resultMap id="BaseResultMap" type="com.zy.entity.WrkMast">
        <id column="wrk_no" property="wrkNo" />
        <result column="inv_wh" property="invWh" />
        <result column="ymd" property="ymd" />
@@ -56,11 +56,22 @@
        <result column="log_err_time" property="logErrTime" />
        <result column="log_err_memo" property="logErrMemo" />
        <result column="barcode" property="barcode" />
        <result column="Pdc_type" property="PdcType" />
<!--        <result column="Pdc_type" property="PdcType" />-->
        <result column="ctn_no" property="ctnNo" />
        <result column="full_plt" property="fullPlt" />
        <result column="rgv_no" property="rgvNo" />
        <result column="rgv_ssta_no" property="rgvSstaNo" />
        <result column="rgv_dsta_no" property="rgvDstaNo" />
    </resultMap>
    <select id="selectByLocNo"  resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_loc_no = #{sourceLocNo} and  (ctn_no is null or ctn_no != 'Y')
    </select>
    <select id="selectByLocNo1"  resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_loc_no = #{sourceLocNo} or loc_no = #{sourceLocNo}
    </select>
    <select id="selectToBeCompleteData" resultMap="BaseResultMap">
        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
@@ -78,13 +89,16 @@
    <select id="selectPakInStep1" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=2 and barcode=#{barcode} and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStepBarcode" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where  barcode = #{barcode}
    </select>
    <select id="selectPakInStep11" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=1 and (io_type=1 or io_type=10) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStep2" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=2 and crn_no=#{crnNo} and wrk_no=#{workNo} and (io_type=1 or io_type=10 or io_type=53 or io_type=54 or io_type=57) order by io_pri desc,io_time,wrk_no ASC
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=2 and crn_no=#{crnNo} and wrk_no=#{workNo} and sta_no=#{staNo} and (io_type=1 or io_type=10 or io_type=53 or io_type=54 or io_type=57) order by io_pri desc,io_time,wrk_no ASC
    </select>
    <select id="selectPakInStep3" resultMap="BaseResultMap">
@@ -92,19 +106,96 @@
    </select>
    <select id="selectPickStep" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where wrk_no=#{workNo} and wrk_sts=14 and (io_type=103 or io_type=107 or io_type=104)
        select top 1 * from asr_wrk_mast where barcode=#{barcode} and wrk_sts=14 and (io_type=103 or io_type=107 or io_type=104)
    </select>
    <select id="selectPakOutStep1" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where crn_no=#{crnNo} and wrk_sts=11 and io_type>100 order by io_pri desc,io_time,wrk_no asc
        select top 1 * from dbo.asr_wrk_mast where crn_no=#{crnNo} and source_sta_no=#{sourceStaNo} and wrk_sts=11 and io_type>100 order by io_pri desc,io_time,wrk_no asc
    </select>
    <select id="selectPakOutStep2" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where source_sta_no=#{sourceStaNo} and wrk_sts=12 and io_type>100 order by io_pri desc,io_time desc,wrk_no ASC
        select top 1 * from dbo.asr_wrk_mast where source_sta_no=#{sourceStaNo} and (wrk_sts=12 or wrk_sts = 16) and io_type>100 order by io_pri desc,wrk_sts ASC,io_time desc,wrk_no ASC
    </select>
    <select id="selectLocMove" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=11 and io_type=11 and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
    <select id="selectLocMoving" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where wrk_sts=12 and io_type=11 and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
    <select id="selectWorking" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where 1=1 and (wrk_sts=3 or wrk_sts=12) and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
<!--    &lt;!&ndash; 入库任务 &ndash;&gt;-->
<!--    <select id="selectWorkingPakin" resultMap="BaseResultMap">-->
<!--        select top 1 * from dbo.asr_wrk_mast where wrk_sts in (2,3,4) and io_type != 11 and source_sta_no = 180 order by io_time,wrk_no-->
<!--    </select>-->
<!--    &lt;!&ndash; 出库任务 &ndash;&gt;-->
<!--    <select id="selectWorkingPakout" resultMap="BaseResultMap">-->
<!--        select top 1 *-->
<!--        from dbo.asr_wrk_mast-->
<!--        where (wrk_sts in (11,12)-->
<!--        or (wrk_sts in (14,15) and wrk_no in-->
<!--        (-->
<!--        select wrk_no-->
<!--        from asr_bas_devp-->
<!--        where wrk_no > 0)-->
<!--        ))-->
<!--        and io_type != 11-->
<!--        and source_sta_no = 180-->
<!--        order by io_time,wrk_no-->
<!--    </select>-->
    <select id="selectCrnWorking" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where 1=1 and wrk_sts in (3,4,11,12) and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
    <select id="selectDevWorking" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where 1=1 and wrk_sts=2 and crn_no=#{crnNo} order by io_time,wrk_no
    </select>
    <select id="selectPick" resultMap="BaseResultMap">
        select * from dbo.asr_wrk_mast where 1=1 and wrk_sts = 14 and io_type in (103,104,107)
    </select>
    <select id="selectPakOutStep11" resultMap="BaseResultMap">
        select * from dbo.asr_wrk_mast where crn_no=#{crnNo} and source_sta_no=#{sourceStaNo} and wrk_sts=11 and io_type>100 order by io_pri desc,io_time,wrk_no asc
    </select>
    <!--                                       入出库模式相关                                      -->
    <select id="selectWorkingPakin" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where wrk_sts in (2,3,4) and io_type != 11 and source_sta_no = #{sourceStaNo} order by io_time,wrk_no
    </select>
    <select id="selectWorkingPakout" resultMap="BaseResultMap">
        select top 1 *
        from dbo.asr_wrk_mast
        where (wrk_sts in (11,12)
        or (wrk_sts in (14,15) and wrk_no in
        (
        select wrk_no
        from asr_bas_devp
        where wrk_no > 0)
        ))
        and io_type != 11
        and source_sta_no = #{sourceStaNo}
        order by io_time,wrk_no
    </select>
    <select id="selectPakoutEmpty" resultMap="BaseResultMap">
        select top 1 * from dbo.asr_wrk_mast where  io_type = 110 and sta_no = #{staNo} order by io_time,wrk_no
    </select>
    <select id="selectPickStep2" resultMap="BaseResultMap">
        select top 1 * from asr_wrk_mast where barcode = #{barcode} and (wrk_sts=14 and io_type=107) or (wrk_sts=2 and io_type=57)
    </select>
    <select id="selectByWrkNo" resultMap="BaseResultMap">
        select * from asr_wrk_mast
        where wrk_no = #{wrkNo}
    </select>
    <select id="selectBy104" resultType="com.zy.entity.WrkMast">
        select top 1 * from asr_wrk_mast awm where awm.sta_no = 104 and awm.wrk_sts = 11 order by awm.appe_time
    </select>
</mapper>