242 lines
14 KiB
XML
242 lines
14 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.app.mapper.AppTaskMapper">
|
|
|
|
<resultMap type="AppTask" id="AppTaskResult">
|
|
<result property="taskId" column="task_id" />
|
|
<result property="taskType" column="task_type" />
|
|
<result property="taskStatus" column="task_status" />
|
|
<result property="taskPriority" column="task_priority" />
|
|
<result property="vehicleId" column="vehicle_id" />
|
|
<result property="origin" column="origin" />
|
|
<result property="destination" column="destination" />
|
|
<result property="wcsTaskId" column="wcs_task_id" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="finishTime" column="finish_time" />
|
|
<result property="goodsId" column="goods_id" />
|
|
<result property="opNum" column="op_num" />
|
|
<result property="stockNum" column="stock_num" />
|
|
<result property="opUser" column="op_user" />
|
|
<result property="opUser" column="op_user" />
|
|
<result property="preTask" column="pre_task" />
|
|
<result property="remark" column="remark" />
|
|
<result property="plcId" column="plc_id" />
|
|
<result property="locationId" column="location_id" />
|
|
<result property="ckType" column="ck_type" />
|
|
<result property="stockId" column="stock_id" />
|
|
<result property="orderId" column="order_id" />
|
|
<result property="ckWave" column="ck_wave" />
|
|
</resultMap>
|
|
|
|
<sql id="selectAppTaskVo">
|
|
select task_id, task_type, task_status, task_priority, vehicle_id, origin, destination, wcs_task_id, create_time, finish_time, goods_id, op_num, stock_num, op_user, pre_task, remark,plc_id,location_id,ck_type,stock_id,order_id,ck_wave from app_task
|
|
</sql>
|
|
|
|
<select id="selectAppTaskList" parameterType="AppTask" resultMap="AppTaskResult">
|
|
<include refid="selectAppTaskVo"/>
|
|
<where>
|
|
<if test="taskType != null "> and task_type = #{taskType}</if>
|
|
<if test="taskStatus != null "> and task_status = #{taskStatus}</if>
|
|
<if test="taskPriority != null "> and task_priority = #{taskPriority}</if>
|
|
<if test="vehicleId != null and vehicleId != ''"> and vehicle_id = #{vehicleId}</if>
|
|
|
|
<if test="destination != null and destination != ''"> and destination = #{destination}</if>
|
|
<if test="wcsTaskId != null and wcsTaskId != ''"> and wcs_task_id = #{wcsTaskId}</if>
|
|
<if test="finishTime != null "> and finish_time = #{finishTime}</if>
|
|
<if test="goodsId != null and goodsId != ''"> and goods_id = #{goodsId}</if>
|
|
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
|
<if test="opUser != null and opUser != ''"> and op_user = #{opUser}</if>
|
|
<if test="preTask != null and preTask != ''"> and pre_task = #{preTask}</if>
|
|
<if test="remark != null and remark != ''"> and remark = #{remark}</if>
|
|
<if test="plcId != null and plcId != ''"> and plc_id = #{plcId}</if>
|
|
<if test="locationId != null and locationId != ''"> and location_id = #{locationId}</if>
|
|
<if test="ckType != null and ckType != ''"> and ck_type = #{ckType}</if>
|
|
<if test="orderId != null and orderId != ''"> and order_id = #{orderId}</if>
|
|
<if test="stockId != null and stockId != ''"> and stock_id = #{stockId}</if>
|
|
<if test="ckWave != null and ckWave != ''"> and ck_wave = #{ckWave}</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectAppTaskByTaskId" parameterType="String" resultMap="AppTaskResult">
|
|
<include refid="selectAppTaskVo"/>
|
|
where task_id = #{taskId}
|
|
</select>
|
|
|
|
<insert id="insertAppTask" parameterType="AppTask">
|
|
insert into app_task
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">task_id,</if>
|
|
<if test="taskType != null">task_type,</if>
|
|
<if test="taskStatus != null">task_status,</if>
|
|
<if test="taskPriority != null">task_priority,</if>
|
|
<if test="vehicleId != null">vehicle_id,</if>
|
|
<if test="origin != null">origin,</if>
|
|
<if test="destination != null">destination,</if>
|
|
<if test="wcsTaskId != null">wcs_task_id,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="finishTime != null">finish_time,</if>
|
|
<if test="goodsId != null">goods_id,</if>
|
|
<if test="opNum != null">op_num,</if>
|
|
<if test="stockNum != null">stock_num,</if>
|
|
<if test="opUser != null">op_user,</if>
|
|
<if test="preTask != null">pre_task,</if>
|
|
<if test="remark != null">remark,</if>
|
|
<if test="locationId != null">location_id,</if>
|
|
<if test="ckType != null">ck_type,</if>
|
|
<if test="stockId != null">stock_id,</if>
|
|
<if test="orderId != null">order_id,</if>
|
|
<if test="ckWave != null">ck_wave,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="taskId != null">#{taskId},</if>
|
|
<if test="taskType != null">#{taskType},</if>
|
|
<if test="taskStatus != null">#{taskStatus},</if>
|
|
<if test="taskPriority != null">#{taskPriority},</if>
|
|
<if test="vehicleId != null">#{vehicleId},</if>
|
|
<if test="origin != null">#{origin},</if>
|
|
<if test="destination != null">#{destination},</if>
|
|
<if test="wcsTaskId != null">#{wcsTaskId},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="finishTime != null">#{finishTime},</if>
|
|
<if test="goodsId != null">#{goodsId},</if>
|
|
<if test="opNum != null">#{opNum},</if>
|
|
<if test="stockNum != null">#{stockNum},</if>
|
|
<if test="opUser != null">#{opUser},</if>
|
|
<if test="preTask != null">#{preTask},</if>
|
|
<if test="remark != null">#{remark},</if>
|
|
<if test="locationId != null">#{locationId},</if>
|
|
<if test="ckType != null">#{ckType},</if>
|
|
<if test="stockId != null">#{stockId},</if>
|
|
<if test="orderId != null">#{orderId},</if>
|
|
<if test="ckWave != null">#{ckWave},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="batchInsertAppTask" parameterType="java.util.List">
|
|
insert into app_task
|
|
<foreach collection="list" item="appTask" separator=",">
|
|
(
|
|
<trim prefixOverrides=",">
|
|
<if test="appTask.taskId != null">task_id,</if>
|
|
<if test="appTask.taskType != null">task_type,</if>
|
|
<if test="appTask.taskStatus != null">task_status,</if>
|
|
<if test="appTask.taskPriority != null">task_priority,</if>
|
|
<if test="appTask.vehicleId != null">vehicle_id,</if>
|
|
<if test="appTask.origin != null">origin,</if>
|
|
<if test="appTask.destination != null">destination,</if>
|
|
<if test="appTask.wcsTaskId != null">wcs_task_id,</if>
|
|
<if test="appTask.createTime != null">create_time,</if>
|
|
<if test="appTask.finishTime != null">finish_time,</if>
|
|
<if test="appTask.goodsId != null">goods_id,</if>
|
|
<if test="appTask.opNum != null">op_num,</if>
|
|
<if test="appTask.stockNum != null">stock_num,</if>
|
|
<if test="appTask.opUser != null">op_user,</if>
|
|
<if test="appTask.preTask != null">pre_task,</if>
|
|
<if test="appTask.remark != null">remark,</if>
|
|
<if test="appTask.locationId != null">location_id,</if>
|
|
<if test="appTask.ckType != null">ck_type,</if>
|
|
<if test="appTask.stockId != null">stock_id,</if>
|
|
<if test="appTask.orderId != null">order_id,</if>
|
|
</trim>
|
|
)
|
|
values
|
|
(
|
|
<trim prefixOverrides=",">
|
|
<if test="appTask.taskId != null">#{appTask.taskId},</if>
|
|
<if test="appTask.taskType != null">#{appTask.taskType},</if>
|
|
<if test="appTask.taskStatus != null">#{appTask.taskStatus},</if>
|
|
<if test="appTask.taskPriority != null">#{appTask.taskPriority},</if>
|
|
<if test="appTask.vehicleId != null">#{appTask.vehicleId},</if>
|
|
<if test="appTask.origin != null">#{appTask.origin},</if>
|
|
<if test="appTask.destination != null">#{appTask.destination},</if>
|
|
<if test="appTask.wcsTaskId != null">#{appTask.wcsTaskId},</if>
|
|
<if test="appTask.createTime != null">#{appTask.createTime},</if>
|
|
<if test="appTask.finishTime != null">#{appTask.finishTime},</if>
|
|
<if test="appTask.goodsId != null">#{appTask.goodsId},</if>
|
|
<if test="appTask.opNum != null">#{appTask.opNum},</if>
|
|
<if test="appTask.stockNum != null">#{appTask.stockNum},</if>
|
|
<if test="appTask.opUser != null">#{appTask.opUser},</if>
|
|
<if test="appTask.preTask != null">#{appTask.preTask},</if>
|
|
<if test="appTask.remark != null">#{appTask.remark},</if>
|
|
<if test="appTask.ckType != null">#{appTask.ckType},</if>
|
|
<if test="appTask.stockId != null">#{appTask.stockId},</if>
|
|
<if test="appTask.orderId != null">#{appTask.orderId},</if>
|
|
</trim>
|
|
)
|
|
</foreach>
|
|
</insert>
|
|
|
|
|
|
<update id="updateAppTask" parameterType="AppTask">
|
|
update app_task
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="taskType != null">task_type = #{taskType},</if>
|
|
<if test="taskStatus != null">task_status = #{taskStatus},</if>
|
|
<if test="taskPriority != null">task_priority = #{taskPriority},</if>
|
|
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
|
|
<if test="origin != null">origin = #{origin},</if>
|
|
<if test="destination != null">destination = #{destination},</if>
|
|
<if test="wcsTaskId != null">wcs_task_id = #{wcsTaskId},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="finishTime != null">finish_time = #{finishTime},</if>
|
|
<if test="goodsId != null">goods_id = #{goodsId},</if>
|
|
<if test="opNum != null">op_num = #{opNum},</if>
|
|
<if test="stockNum != null">stock_num = #{stockNum},</if>
|
|
<if test="opUser != null">op_user = #{opUser},</if>
|
|
<if test="preTask != null">pre_task = #{preTask},</if>
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
<if test="locationId != null">location_id = #{locationId},</if>
|
|
<if test="ckType != null">ck_type = #{ckType},</if>
|
|
<if test="stockId != null">stock_id = #{stockId},</if>
|
|
<if test="orderId != null">order_id = #{orderId},</if>
|
|
</trim>
|
|
where task_id = #{taskId}
|
|
</update>
|
|
|
|
<update id="batchUpdateAppTask" parameterType="java.util.List">
|
|
<foreach collection="list" item="appTask" separator=";">
|
|
update app_task
|
|
<set>
|
|
<if test="appTask.taskType != null">task_type = #{appTask.taskType},</if>
|
|
<if test="appTask.taskStatus != null">task_status = #{appTask.taskStatus},</if>
|
|
<if test="appTask.taskPriority != null">task_priority = #{appTask.taskPriority},</if>
|
|
<if test="appTask.vehicleId != null">vehicle_id = #{appTask.vehicleId},</if>
|
|
<if test="appTask.origin != null">origin = #{appTask.origin},</if>
|
|
<if test="appTask.destination != null">destination = #{appTask.destination},</if>
|
|
<if test="appTask.wcsTaskId != null">wcs_task_id = #{appTask.wcsTaskId},</if>
|
|
<if test="appTask.createTime != null">create_time = #{appTask.createTime},</if>
|
|
<if test="appTask.goodsId != null">goods_id = #{appTask.goodsId},</if>
|
|
<if test="appTask.opNum != null">op_num = #{appTask.opNum},</if>
|
|
<if test="appTask.stockNum != null">stock_num = #{appTask.stockNum},</if>
|
|
<if test="appTask.opUser != null">op_user = #{appTask.opUser},</if>
|
|
<if test="appTask.preTask != null">pre_task = #{appTask.preTask},</if>
|
|
<if test="appTask.remark != null">remark = #{appTask.remark},</if>
|
|
</set>
|
|
where task_id = #{appTask.taskId}
|
|
</foreach>
|
|
</update>
|
|
|
|
<delete id="deleteAppTaskByTaskId" parameterType="String">
|
|
delete from app_task where task_id = #{taskId}
|
|
</delete>
|
|
<select id="selectPlcList" resultMap="AppTaskResult">
|
|
<include refid="selectAppTaskVo"/>
|
|
where task_status = 0 AND plc_id is null order by create_time asc
|
|
</select>
|
|
<update id="updatePlcId" parameterType="AppTask">
|
|
update app_task
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="plcId != null">plc_id = #{plcId},</if>
|
|
</trim>
|
|
where task_status = #{taskStatus} AND vehicle_id = #{vehicleId}
|
|
</update>
|
|
<delete id="deleteAppTaskByTaskIds" parameterType="String">
|
|
delete from app_task where task_id in
|
|
<foreach item="taskId" collection="array" open="(" separator="," close=")">
|
|
#{taskId}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|