<?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">
|
|
<!-- 通用查询映射结果 -->
|
<resultMap id="BaseResultMap" type="com.zy.asrs.entity.WrkMast">
|
<id column="wrk_no" property="wrkNo"/>
|
<result column="mk" property="mk"/>
|
<result column="wrk_sts" property="wrkSts"/>
|
<result column="io_type" property="ioType"/>
|
<result column="io_pri" property="ioPri"/>
|
<result column="loc_no" property="locNo"/>
|
<result column="sta_no" property="staNo"/>
|
<result column="source_sta_no" property="sourceStaNo"/>
|
<result column="source_loc_no" property="sourceLocNo"/>
|
<result column="io_time" property="ioTime"/>
|
<result column="modi_user" property="modiUser"/>
|
<result column="modi_time" property="modiTime"/>
|
<result column="appe_user" property="appeUser"/>
|
<result column="appe_time" property="appeTime"/>
|
<result column="error_time" property="errorTime"/>
|
<result column="error_memo" property="errorMemo"/>
|
<result column="memo" property="memo"/>
|
<result column="barcode" property="barcode"/>
|
<result column="shuttle_no" property="shuttleNo"/>
|
<result column="lift_no" property="liftNo"/>
|
<result column="wms_wrk_no" property="wmsWrkNo"/>
|
<result column="system_msg" property="systemMsg"/>
|
<result column="main_wrk_no" property="mainWrkNo"/>
|
|
</resultMap>
|
|
<select id="selectPakInStep1" resultMap="BaseResultMap">
|
select *
|
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 limit 0,1
|
</select>
|
|
<select id="selectPakInStep11" resultMap="BaseResultMap">
|
select *
|
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 limit 0,1
|
</select>
|
|
<select id="selectInStep4" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and wrk_sts = 4
|
and io_type in (1, 10, 53, 57)
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectByWorkNo" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where wrk_no = #{workNo} limit 0,1
|
</select>
|
|
<select id="selectByMainWrkNo" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where main_wrk_no = #{mainWrkNo} limit 0,1
|
</select>
|
|
<select id="selectByShuttleNo" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where shuttle_no = #{shuttleNo} limit 0,1
|
</select>
|
|
<select id="selectLiftStep223103" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and wrk_sts in (2, 103, 303)
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectByWorkNo324104" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where wrk_no = #{workNo}
|
and wrk_sts in (3, 104, 303, 306) limit 0,1
|
</select>
|
|
<select id="selectBy2125" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where wrk_sts in (101, 105)
|
and io_type in (101, 103, 107, 110)
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectNoShuttleWrkByLev" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where shuttle_no is null
|
and ((wrk_sts = 2 and loc_no like #{lev}) or (wrk_sts = 101 and source_loc_no like #{lev}))
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectShuttleWrkByLev" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where shuttle_no is not null
|
and ((wrk_sts not in (9, 10) and loc_no like #{lev}) or
|
(wrk_sts not in (29, 30) and source_loc_no like #{lev}))
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectShuttleOutWrkByLev" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where shuttle_no is not null
|
and (wrk_sts not in (109, 110) and source_loc_no like #{lev})
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectLiftWrkMast" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where lift_no = #{liftNo} limit 0,1
|
</select>
|
|
<select id="selectLiftWrkMastAndWrkNo" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where lift_no = #{liftNo}
|
<if test="wrkNo !=null">
|
and wrk_no != #{wrkNo}
|
</if>
|
<if test="wrkNo2 !=null">
|
and wrk_no != #{wrkNo2}
|
</if>
|
limit 0,1
|
</select>
|
|
<select id="selectLocToLocWrkMast" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where io_type in (11)
|
and wrk_sts not in (9, 10, 109, 110)
|
order by io_pri desc, wrk_sts desc
|
</select>
|
|
<select id="selectPickStepByBarcode" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where io_type in (53, 103, 107)
|
and wrk_sts in (2, 3, 104, 109)
|
and barcode = #{barcode}
|
order by io_pri desc, wrk_sts desc limit 0,1
|
</select>
|
|
<select id="selectShuttleHasMoveWorking" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and shuttle_no = #{shuttleNo}
|
and wrk_sts not in (311)
|
and io_type = 200
|
order by io_pri desc, io_time, wrk_no asc limit 0,1
|
</select>
|
|
<select id="selectShuttleMoveWrk" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
-- and wrk_sts in (301,302,303,304,305,306,307,308,309,310,311)
|
and io_type = 200
|
order by io_pri desc, io_time, wrk_no asc
|
</select>
|
|
<select id="selectShuttleWorking" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and shuttle_no = #{shuttleNo}
|
and wrk_sts not in (9, 10, 109, 110, 210)
|
and io_type not in (200, 300)
|
order by io_pri desc, io_time, wrk_no asc limit 0,1
|
</select>
|
|
<select id="selectShuttleWorking2" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and shuttle_no = #{shuttleNo}
|
<if test="wrkNo !=null">
|
and wrk_no != #{wrkNo}
|
</if>
|
<if test="wrkNo2 !=null">
|
and wrk_no != #{wrkNo2}
|
</if>
|
order by io_pri desc, io_time, wrk_no asc limit 0,1
|
</select>
|
|
<select id="selectByBarcode" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and barcode = #{barcode}
|
order by io_pri desc, io_time, wrk_no asc limit 0,1
|
</select>
|
|
<select id="selectInWrkMastByLiftNo" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where 1 = 1
|
and lift_no = #{liftNo}
|
and io_type <= 100
|
and wrk_sts in (1, 2, 3, 4, 5)
|
order by io_pri desc, io_time, wrk_no asc
|
</select>
|
|
<select id="selectChargeWorking" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where io_type in (300)
|
and shuttle_no = #{shuttleNo}
|
order by io_pri desc, io_time, wrk_no asc
|
</select>
|
|
<select id="selectChargeWorkingByChargeSta" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where wrk_sts in (201, 202, 203, 204, 205, 210)
|
and mk = #{chargeSta}
|
order by io_pri desc, io_time, wrk_no asc
|
</select>
|
|
<select id="selectWorkingPakout" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where io_type = 101
|
and sta_no = #{staNo} limit 0,1
|
</select>
|
|
<select id="selectWorkingPakin" resultMap="BaseResultMap">
|
select *
|
from asr_wrk_mast
|
where io_type = 1
|
and source_sta_no = #{staNo} limit 0,1
|
</select>
|
|
</mapper>
|