355 lines
21 KiB
XML
355 lines
21 KiB
XML
<?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.ruoyi.job.mapper.MydoJobMapper">
|
|
|
|
<resultMap type="MydoJob" id="MydoJobResult">
|
|
<result property="jobId" column="job_id" />
|
|
<result property="status" column="status" />
|
|
<result property="taskNo" column="task_no" />
|
|
<result property="roadwayId" column="roadway_id" />
|
|
<result property="cargoSpaceId" column="cargo_space_id" />
|
|
<result property="targetRoadwayId" column="target_roadway_id" />
|
|
<result property="targetCargoSpaceId" column="target_cargo_space_id" />
|
|
<result property="priority" column="priority" />
|
|
<result property="executionPhase" column="execution_phase" />
|
|
<result property="inOrOut" column="in_or_out" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="startTime" column="start_time" />
|
|
<result property="finishTime" column="finish_time" />
|
|
<result property="entranceId" column="entrance_id" />
|
|
<result property="exitId" column="exit_id" />
|
|
<result property="warehouseId" column="warehouse_id" />
|
|
<result property="faultFlag" column="fault_flag" />
|
|
<result property="flag" column="flag" />
|
|
<result property="trayCode" column="tray_code" />
|
|
<result property="traySize" column="tray_size" />
|
|
<result property="wmsTaskNo" column="wms_task_no" />
|
|
</resultMap>
|
|
|
|
<sql id="selectMydoJobVo">
|
|
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
|
</sql>
|
|
<sql id="selectMydoJobVoTop">
|
|
select top 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
|
</sql>
|
|
<sql id="selectMydoJobFinishVo">
|
|
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs_finish
|
|
</sql>
|
|
|
|
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobVo"/>
|
|
<where>
|
|
<if test="status != null and status != ''">and status = #{status}</if>
|
|
<if test="taskNo != null and taskNo != ''">and task_no = #{taskNo}</if>
|
|
<if test="roadwayId != null and roadwayId != ''">and roadway_id = #{roadwayId}</if>
|
|
<if test="cargoSpaceId != null and cargoSpaceId != ''">and cargo_space_id = #{cargoSpaceId}</if>
|
|
<if test="targetRoadwayId != null and targetRoadwayId != ''">and target_roadway_id = #{targetRoadwayId}
|
|
</if>
|
|
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''">and target_cargo_space_id =
|
|
#{targetCargoSpaceId}
|
|
</if>
|
|
<if test="priority != null ">and priority = #{priority}</if>
|
|
<if test="executionPhase != null and executionPhase != ''">and execution_phase = #{executionPhase}</if>
|
|
<if test="inOrOut != null and inOrOut != ''">and in_or_out = #{inOrOut}</if>
|
|
<if test="startTime != null and startTime != ''">and start_time = #{startTime}</if>
|
|
<if test="finishTime != null and finishTime != ''">and finish_time = #{finishTime}</if>
|
|
<if test="entranceId != null and entranceId != ''">and entrance_id = #{entranceId}</if>
|
|
<if test="exitId != null and exitId != ''">and exit_id = #{exitId}</if>
|
|
<if test="warehouseId != null and warehouseId != ''">and warehouse_id = #{warehouseId}</if>
|
|
<if test="faultFlag != null and faultFlag != ''">and fault_flag = #{faultFlag}</if>
|
|
<if test="flag != null and flag != ''">and flag = #{flag}</if>
|
|
<if test="trayCode != null and trayCode != ''">and tray_code = #{trayCode}</if>
|
|
<if test="traySize != null and traySize != ''">and traySize = #{tray_size}</if>
|
|
<if test="epList != null and epList.size() > 0">
|
|
and entrance_id in
|
|
<foreach item="item" index="index" collection="epList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
</if>
|
|
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
|
</where>
|
|
order by start_time desc
|
|
</select>
|
|
|
|
<select id="selectMydoJobByJobId" parameterType="String" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobVo"/>
|
|
where job_id = #{jobId}
|
|
</select>
|
|
|
|
<select id="selectJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
|
select job_id, a.status, task_no, a.roadway_id, b.cargo_space_name as cargo_space_id, target_roadway_id,
|
|
target_cargo_space_id, priority, execution_phase, in_or_out, create_time,
|
|
start_time, finish_time, entrance_id, exit_id, a.warehouse_id, fault_flag,
|
|
flag,a.tray_code,tray_size,wms_task_no
|
|
from mydo_job_wcs a,bas_cargo_space b
|
|
where a.cargo_space_id = b.cargo_space_id
|
|
and task_no = #{taskNo}
|
|
</select>
|
|
|
|
<select id="selectMydoJobByTaskNo" parameterType="String" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobVo"/>
|
|
where task_no = #{taskNo}
|
|
</select>
|
|
|
|
<select id="ddjTaskFinish" parameterType="java.util.Map" statementType="CALLABLE">
|
|
{call proc_mydojob_finish(
|
|
#{v_rwh,mode=IN,jdbcType=INTEGER},
|
|
#{v_ddj_id,mode=IN,jdbcType=INTEGER},
|
|
#{v_result,mode=OUT,jdbcType=INTEGER},
|
|
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
|
)}
|
|
</select>
|
|
<select id="InvalidMydoJob" parameterType="java.util.Map" statementType="CALLABLE">
|
|
{call proc_mydojob_invalid(
|
|
#{v_rwh,mode=IN,jdbcType=INTEGER},
|
|
#{v_ddj_id,mode=IN,jdbcType=INTEGER},
|
|
#{v_result,mode=OUT,jdbcType=INTEGER},
|
|
#{v_resultmsg,mode=OUT,jdbcType=VARCHAR}
|
|
)}
|
|
</select>
|
|
<select id="selectMydoJobByExitList" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
|
where exit_id in
|
|
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
and in_or_out > 20
|
|
and status = 1 and execution_phase= 0
|
|
order by priority asc,create_time
|
|
</select>
|
|
|
|
<select id="selectMydoJobByExitList1" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_code,tray_size,wms_task_no from mydo_job_wcs
|
|
where exit_id = #{exitId}
|
|
and roadway_id = #{roadwayId}
|
|
and in_or_out > 20
|
|
and status = 1 and execution_phase= 0
|
|
order by priority asc,create_time
|
|
</select>
|
|
|
|
<insert id="insertMydoJob" parameterType="MydoJob">
|
|
insert into mydo_job_wcs
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="jobId != null">job_id,</if>
|
|
<if test="status != null and status != ''">status,</if>
|
|
<if test="taskNo != null and taskNo != ''">task_no,</if>
|
|
<if test="roadwayId != null">roadway_id,</if>
|
|
<if test="cargoSpaceId != null">cargo_space_id,</if>
|
|
<if test="targetRoadwayId != null">target_roadway_id,</if>
|
|
<if test="targetCargoSpaceId != null">target_cargo_space_id,</if>
|
|
<if test="priority != null">priority,</if>
|
|
<if test="executionPhase != null">execution_phase,</if>
|
|
<if test="inOrOut != null">in_or_out,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="startTime != null">start_time,</if>
|
|
<if test="finishTime != null">finish_time,</if>
|
|
<if test="entranceId != null">entrance_id,</if>
|
|
<if test="exitId != null">exit_id,</if>
|
|
<if test="warehouseId != null">warehouse_id,</if>
|
|
<if test="faultFlag != null">fault_flag,</if>
|
|
<if test="flag != null">flag,</if>
|
|
<if test="trayCode != null">tray_code,</if>
|
|
<if test="traySize != null">tray_size,</if>
|
|
<if test="wmsTaskNo != null">wms_task_no,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="jobId != null">#{jobId},</if>
|
|
<if test="status != null and status != ''">#{status},</if>
|
|
<if test="taskNo != null and taskNo != ''">#{taskNo},</if>
|
|
<if test="roadwayId != null">#{roadwayId},</if>
|
|
<if test="cargoSpaceId != null">#{cargoSpaceId},</if>
|
|
<if test="targetRoadwayId != null">#{targetRoadwayId},</if>
|
|
<if test="targetCargoSpaceId != null">#{targetCargoSpaceId},</if>
|
|
<if test="priority != null">#{priority},</if>
|
|
<if test="executionPhase != null">#{executionPhase},</if>
|
|
<if test="inOrOut != null">#{inOrOut},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="startTime != null">#{startTime},</if>
|
|
<if test="finishTime != null">#{finishTime},</if>
|
|
<if test="entranceId != null">#{entranceId},</if>
|
|
<if test="exitId != null">#{exitId},</if>
|
|
<if test="warehouseId != null">#{warehouseId},</if>
|
|
<if test="faultFlag != null">#{faultFlag},</if>
|
|
<if test="flag != null">#{flag},</if>
|
|
<if test="trayCode != null">#{trayCode},</if>
|
|
<if test="traySize != null">#{traySize},</if>
|
|
<if test="wmsTaskNo != null">#{wmsTaskNo},</if>
|
|
</trim>
|
|
</insert>
|
|
<insert id="insertHistory">
|
|
insert into mydo_job_wcs_finish
|
|
select * from mydo_job_wcs where job_id = #{jobId}
|
|
</insert>
|
|
|
|
<update id="updateMydoJob" parameterType="MydoJob">
|
|
update mydo_job_wcs
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="status != null and status != ''">status = #{status},</if>
|
|
<if test="taskNo != null and taskNo != ''">task_no = #{taskNo},</if>
|
|
<if test="roadwayId != null">roadway_id = #{roadwayId},</if>
|
|
<if test="cargoSpaceId != null">cargo_space_id = #{cargoSpaceId},</if>
|
|
<if test="targetRoadwayId != null">target_roadway_id = #{targetRoadwayId},</if>
|
|
<if test="targetCargoSpaceId != null">target_cargo_space_id = #{targetCargoSpaceId},</if>
|
|
<if test="priority != null">priority = #{priority},</if>
|
|
<if test="executionPhase != null">execution_phase = #{executionPhase},</if>
|
|
<if test="inOrOut != null">in_or_out = #{inOrOut},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="startTime != null">start_time = #{startTime},</if>
|
|
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
|
<if test="entranceId != null">entrance_id = #{entranceId},</if>
|
|
<if test="exitId != null">exit_id = #{exitId},</if>
|
|
<if test="warehouseId != null">warehouse_id = #{warehouseId},</if>
|
|
<if test="faultFlag != null">fault_flag = #{faultFlag},</if>
|
|
<if test="flag != null">flag = #{flag},</if>
|
|
<if test="trayCode != null">tray_code = #{trayCode},</if>
|
|
<if test="traySize != null">tray_size = #{traySize},</if>
|
|
<if test="wmsTaskNo != null">wms_task_no = #{wmsTaskNo},</if>
|
|
</trim>
|
|
where job_id = #{jobId}
|
|
</update>
|
|
|
|
<delete id="deleteMydoJobByJobId" parameterType="String">
|
|
delete from mydo_job_wcs where job_id = #{jobId}
|
|
</delete>
|
|
|
|
<delete id="deleteMydoJobByTaskNo" parameterType="String">
|
|
delete from mydo_job_wcs where task_no = #{taskNo}
|
|
</delete>
|
|
|
|
<delete id="deleteMydoJobByJobIds" parameterType="String">
|
|
delete from mydo_job_wcs where job_id in
|
|
<foreach item="jobId" collection="array" open="(" separator="," close=")">
|
|
#{jobId}
|
|
</foreach>
|
|
</delete>
|
|
|
|
<select id="selectInOrOutMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobVo"/>
|
|
<where>
|
|
<if test="inOut != null and inOut != '' and inOut =='2'.toString "> and in_or_out >=20</if>
|
|
<if test="inOut != null and inOut != '' and inOut =='1'.toString "> and in_or_out < 20</if>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
|
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
|
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
|
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
|
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
|
<if test="priority != null "> and priority = #{priority}</if>
|
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
|
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
|
<if test="jobId != null and jobId != ''"> and job_id = #{jobId}</if>
|
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
|
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
|
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
|
</where>
|
|
</select>
|
|
<select id="selectMydoJobByEntranceList" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
|
where entrance_id in
|
|
<foreach item="item" index="index" collection="entranceList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
and in_or_out <= 20 and status = 3
|
|
order by priority asc,create_time asc
|
|
</select>
|
|
|
|
<select id="selectMydoJobByEntranceList1" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
|
where entrance_id = #{entranceId}
|
|
and in_or_out <= 20 and status = 3
|
|
order by priority asc,create_time asc
|
|
</select>
|
|
|
|
<select id="getInJobByEntranceId" parameterType="java.lang.String" resultMap="MydoJobResult">
|
|
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag, tray_code from mydo_job_wcs
|
|
where entrance_id = #{entranceId}
|
|
and in_or_out <= 20 and status = 3
|
|
order by priority asc,create_time asc
|
|
</select>
|
|
|
|
<select id="selectMydoJobByExitId" parameterType="java.lang.String" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag, wms_task_no, tray_code, tray_size, flag from mydo_job_wcs
|
|
where exit_id = #{exitId}
|
|
and in_or_out = 2
|
|
and status = 1 and execution_phase= 0
|
|
order by priority asc,create_time asc
|
|
</select>
|
|
|
|
<select id="selectMydoJobByWmsTaskNo" parameterType="java.lang.String" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobVo"/>
|
|
where wms_task_no = #{wmsTaskNo}
|
|
</select>
|
|
|
|
<select id="selectMydoJobFinishList" resultMap="MydoJobResult">
|
|
<include refid="selectMydoJobFinishVo"/>
|
|
<where>
|
|
<if test="status != null and status != ''"> and status = #{status}</if>
|
|
<if test="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
|
<if test="roadwayId != null and roadwayId != ''"> and roadway_id = #{roadwayId}</if>
|
|
<if test="cargoSpaceId != null and cargoSpaceId != ''"> and cargo_space_id = #{cargoSpaceId}</if>
|
|
<if test="targetRoadwayId != null and targetRoadwayId != ''"> and target_roadway_id = #{targetRoadwayId}</if>
|
|
<if test="targetCargoSpaceId != null and targetCargoSpaceId != ''"> and target_cargo_space_id = #{targetCargoSpaceId}</if>
|
|
<if test="priority != null and priority != '' "> and priority = #{priority}</if>
|
|
<if test="executionPhase != null and executionPhase != ''"> and execution_phase = #{executionPhase}</if>
|
|
<if test="inOrOut != null and inOrOut != ''"> and in_or_out = #{inOrOut}</if>
|
|
<if test="startTime != null and startTime != ''"> and start_time = #{startTime}</if>
|
|
<if test="finishTime != null and finishTime != ''"> and finish_time = #{finishTime}</if>
|
|
<if test="entranceId != null and entranceId != ''"> and entrance_id = #{entranceId}</if>
|
|
<if test="exitId != null and exitId != ''"> and exit_id = #{exitId}</if>
|
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id = #{warehouseId}</if>
|
|
<if test="faultFlag != null and faultFlag != ''"> and fault_flag = #{faultFlag}</if>
|
|
<if test="flag != null and flag != ''"> and flag = #{flag}</if>
|
|
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
|
<if test="traySize != null and traySize != ''"> and tray_size = #{traySize}</if>
|
|
<if test="wmsTaskNo != null and wmsTaskNo != ''">and wms_task_no = #{wmsTaskNo}</if>
|
|
</where>
|
|
order by start_time desc
|
|
</select>
|
|
<select id="selectRunningMydoJobByExitList" resultMap="MydoJobResult">
|
|
select TOP 1 job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_size,tray_code from mydo_job_wcs
|
|
where exit_id in
|
|
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
and in_or_out > 20
|
|
and status = 3
|
|
order by priority asc,create_time
|
|
</select>
|
|
|
|
<select id="getInJobByEntrance" resultMap="MydoJobResult">
|
|
select job_id, status, task_no, roadway_id, cargo_space_id, target_roadway_id, target_cargo_space_id, priority, execution_phase, in_or_out, create_time, start_time, finish_time, entrance_id, exit_id, warehouse_id, fault_flag,flag,tray_size,tray_code from mydo_job_wcs
|
|
where entrance_id in
|
|
<foreach item="item" index="index" collection="exitList" separator="," open="(" close=")">
|
|
#{item}
|
|
</foreach>
|
|
and in_or_out < 20
|
|
and status in (1,3)
|
|
</select>
|
|
|
|
<select id="getJobId" statementType="CALLABLE" parameterType="java.util.Map" >
|
|
{ CALL util_serial_job(
|
|
#{v_param, mode=IN, jdbcType=VARCHAR},
|
|
#{v_serial, mode=OUT, jdbcType=VARCHAR}
|
|
)
|
|
}
|
|
</select>
|
|
|
|
<select id="getTaskNo" statementType="CALLABLE" parameterType="java.util.Map" >
|
|
{ CALL util_serial_task(
|
|
#{v_param, mode=IN, jdbcType=VARCHAR},
|
|
#{v_serial, mode=OUT, jdbcType=VARCHAR}
|
|
)
|
|
}
|
|
</select>
|
|
|
|
</mapper>
|