123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374 |
- <?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.ams.task.mapper.WcsTaskMapper">
- <resultMap type="WcsTask" id="WcsTaskResult">
- <result property="taskNo" column="task_no" />
- <result property="businessType" column="business_type" />
- <result property="whTypeFrom" column="wh_type_from" />
- <result property="whNoFrom" column="wh_no_from" />
- <result property="whTypeTo" column="wh_type_to" />
- <result property="whNoTo" column="wh_no_to" />
- <result property="sysName" column="sys_name" />
- <result property="deviceName" column="device_name" />
- <result property="batchNo" column="batch_no" />
- <result property="batchOrderNo" column="batch_order_no" />
- <result property="locationFrom" column="location_from" />
- <result property="areaFrom" column="area_from" />
- <result property="locationTo" column="location_to" />
- <result property="areaTo" column="area_to" />
- <result property="priority" column="priority" />
- <result property="state" column="state" />
- <result property="remark" column="remark" />
- <result property="createUser" column="create_user" />
- <result property="createDate" column="create_date" />
- <result property="updateUser" column="update_user" />
- <result property="updateDate" column="update_date" />
- <result property="taskType" column="task_type" />
- <result property="shopId" column="shop_id" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="parentTask" column="parent_task" />
- <result property="extParam" column="ext_param" />
- <result property="ext1" column="ext1" />
- <result property="ext2" column="ext2" />
- <result property="ext3" column="ext3" />
- <result property="ext4" column="ext4" />
- <result property="ext5" column="ext5" />
- <result property="ext6" column="ext6" />
- <result property="ext7" column="ext7" />
- <result property="ext8" column="ext8" />
- <result property="agvNo" column="agv_no" />
- <result property="beforeTask" column="before_task" />
- </resultMap>
- <resultMap type="com.ruoyi.ams.task.dto.WcsTaskLocationDTO" id="WcsTaskDTOResult">
- <result property="taskNo" column="task_no" />
- <result property="businessType" column="business_type" />
- <result property="whTypeFrom" column="wh_type_from" />
- <result property="whNoFrom" column="wh_no_from" />
- <result property="whTypeTo" column="wh_type_to" />
- <result property="whNoTo" column="wh_no_to" />
- <result property="sysName" column="sys_name" />
- <result property="deviceName" column="device_name" />
- <result property="batchNo" column="batch_no" />
- <result property="batchOrderNo" column="batch_order_no" />
- <result property="locationFrom" column="location_from" />
- <result property="areaFrom" column="area_from" />
- <result property="locationTo" column="location_to" />
- <result property="areaTo" column="area_to" />
- <result property="priority" column="priority" />
- <result property="state" column="state" />
- <result property="remark" column="remark" />
- <result property="createUser" column="create_user" />
- <result property="createDate" column="create_date" />
- <result property="updateUser" column="update_user" />
- <result property="updateDate" column="update_date" />
- <result property="taskType" column="task_type" />
- <result property="shopId" column="shop_id" />
- <result property="startTime" column="start_time" />
- <result property="endTime" column="end_time" />
- <result property="parentTask" column="parent_task" />
- <result property="extParam" column="ext_param" />
- <result property="ext1" column="ext1" />
- <result property="ext2" column="ext2" />
- <result property="ext3" column="ext3" />
- <result property="ext4" column="ext4" />
- <result property="ext5" column="ext5" />
- <result property="ext6" column="ext6" />
- <result property="ext7" column="ext7" />
- <result property="ext8" column="ext8" />
- <result property="agvNo" column="agv_no" />
- <result property="colNo" column="col_no" />
- <result property="colIndex" column="col_index" />
- </resultMap>
- <sql id="selectWcsTaskVo">
- select task_no, business_type, wh_type_from, wh_no_from, wh_type_to, wh_no_to, sys_name, device_name, batch_no, batch_order_no, location_from, area_from, location_to, area_to, priority, state, remark, create_user, create_date, update_user, update_date, task_type, shop_id, start_time, end_time, parent_task, ext_param, ext1, ext2, ext3, ext4, ext5, ext6, ext7, ext8, agv_no, before_task from wcs_task
- </sql>
- <select id="selectWcsTaskList" parameterType="WcsTask" resultMap="WcsTaskResult">
- <include refid="selectWcsTaskVo"/>
- <where>
- <if test="locationFrom != null and locationFrom != ''"> and location_from = #{locationFrom}</if>
- <if test="areaFrom != null and areaFrom != ''"> and area_from = #{areaFrom}</if>
- <if test="locationTo != null and locationTo != ''"> and location_to = #{locationTo}</if>
- <if test="areaTo != null and areaTo != ''"> and area_to = #{areaTo}</if>
- <if test="priority != null "> and priority = #{priority}</if>
- <if test="state != null "> and state = #{state}</if>
- <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
- <if test="createDate != null "> and create_date = #{createDate}</if>
- <if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
- <if test="shopId != null and shopId != ''"> and shop_id = #{shopId}</if>
- <if test="startTime != null "> and start_time = #{startTime}</if>
- <if test="endTime != null "> and end_time = #{endTime}</if>
- <if test="parentTask != null and parentTask != ''"> and parent_task = #{parentTask}</if>
- <if test="agvNo != null and agvNo != ''"> and agv_no like concat('%', #{agvNo}, '%')</if>
- </where>
- </select>
- <select id="selectWcsTaskListVO" parameterType="WcsTask" resultMap="WcsTaskResult">
- select t.task_no, t.business_type,bf.location_no location_from,fz.zone_name area_from,bt.location_no location_to,tz.zone_name area_to,
- t.state,t.create_date,t.task_type, t.start_time, t.end_time,t.remark, t.device_name, t.agv_no
- from wcs_task t
- left join base_location_info bf on t.location_from = bf.id
- left join base_location_info bt on t.location_to = bt.id
- left join base_location_zone fz on t.area_from = fz.zone_id
- left join base_location_zone tz on t.area_to = tz.zone_id
- <where>
- <if test="locationFrom != null and locationFrom != ''"> and bf.location_no like concat('%', #{locationFrom}, '%') </if>
- <if test="taskNo != null and taskNo != ''"> and t.task_no like concat('%', #{taskNo}, '%') </if>
- <if test="areaFrom != null and areaFrom != ''"> and t.area_from = #{areaFrom}</if>
- <if test="locationTo != null and locationTo != ''"> and bt.location_no like concat('%', #{locationTo}, '%')</if>
- <if test="areaTo != null and areaTo != ''"> and t.area_to = #{areaTo}</if>
- <if test="priority != null "> and t.priority = #{priority}</if>
- <if test="state != null "> and t.state = #{state}</if>
- <if test="createUser != null and createUser != ''"> and t.create_user = #{createUser}</if>
- <!-- <if test="createDate != null "> and t.create_date = #{createDate}</if>-->
- <if test="taskType != null and taskType != ''"> and t.task_type = #{taskType}</if>
- <if test="shopId != null and shopId != ''"> and t.shop_id = #{shopId}</if>
- <!-- <if test="startTime != null "> and t.start_time = #{startTime}</if>-->
- <!-- <if test="endTime != null "> and t.end_time = #{endTime}</if>-->
- <if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
- AND date_format(t.create_date,'%y%m%d') >= date_format(#{params.beginTime},'%y%m%d')
- </if>
- <if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
- AND date_format(t.create_date,'%y%m%d') <= date_format(#{params.endTime},'%y%m%d')
- </if>
- <if test="parentTask != null and parentTask != ''"> and t.parent_task = #{parentTask}</if>
- <if test="agvNo != null and agvNo != ''"> and t.agv_no like concat('%', #{agvNo}, '%')</if>
- </where>
- order by t.create_date desc
- </select>
- <select id="selectWcsTaskByTaskNo" parameterType="String" resultMap="WcsTaskResult">
- <include refid="selectWcsTaskVo"/>
- where task_no = #{taskNo}
- </select>
- <select id="selectWcsTaskByTsIndex" parameterType="String" resultMap="WcsTaskResult">
- <include refid="selectWcsTaskVo"/>
- where device_name = #{tsIndex} or task_no = #{tsIndex}
- ORDER BY create_date DESC
- LIMIT 1
- </select>
- <select id="selectWcsTaskByAgvNo" parameterType="String" resultMap="WcsTaskResult">
- <include refid="selectWcsTaskVo"/>
- where agv_no = #{tsIndex} and state in(1,3,4,5,6,9,10)
- ORDER BY create_date DESC
- LIMIT 1
- </select>
- <insert id="insertWcsTask" parameterType="WcsTask">
- insert into wcs_task
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="taskNo != null">task_no,</if>
- <if test="businessType != null">business_type,</if>
- <if test="whTypeFrom != null">wh_type_from,</if>
- <if test="whNoFrom != null">wh_no_from,</if>
- <if test="whTypeTo != null">wh_type_to,</if>
- <if test="whNoTo != null">wh_no_to,</if>
- <if test="sysName != null">sys_name,</if>
- <if test="deviceName != null">device_name,</if>
- <if test="batchNo != null">batch_no,</if>
- <if test="batchOrderNo != null">batch_order_no,</if>
- <if test="locationFrom != null">location_from,</if>
- <if test="areaFrom != null">area_from,</if>
- <if test="locationTo != null">location_to,</if>
- <if test="areaTo != null">area_to,</if>
- <if test="priority != null">priority,</if>
- <if test="state != null">state,</if>
- <if test="remark != null">remark,</if>
- <if test="createUser != null">create_user,</if>
- <if test="createDate != null">create_date,</if>
- <if test="updateUser != null">update_user,</if>
- <if test="updateDate != null">update_date,</if>
- <if test="taskType != null">task_type,</if>
- <if test="shopId != null">shop_id,</if>
- <if test="startTime != null">start_time,</if>
- <if test="endTime != null">end_time,</if>
- <if test="parentTask != null">parent_task,</if>
- <if test="extParam != null">ext_param,</if>
- <if test="ext1 != null">ext1,</if>
- <if test="ext2 != null">ext2,</if>
- <if test="ext3 != null">ext3,</if>
- <if test="ext4 != null">ext4,</if>
- <if test="ext5 != null">ext5,</if>
- <if test="ext6 != null">ext6,</if>
- <if test="ext7 != null">ext7,</if>
- <if test="ext8 != null">ext8,</if>
- <if test="agvNo != null">agv_no,</if>
- <if test="beforeTask != null">before_task,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="taskNo != null">#{taskNo},</if>
- <if test="businessType != null">#{businessType},</if>
- <if test="whTypeFrom != null">#{whTypeFrom},</if>
- <if test="whNoFrom != null">#{whNoFrom},</if>
- <if test="whTypeTo != null">#{whTypeTo},</if>
- <if test="whNoTo != null">#{whNoTo},</if>
- <if test="sysName != null">#{sysName},</if>
- <if test="deviceName != null">#{deviceName},</if>
- <if test="batchNo != null">#{batchNo},</if>
- <if test="batchOrderNo != null">#{batchOrderNo},</if>
- <if test="locationFrom != null">#{locationFrom},</if>
- <if test="areaFrom != null">#{areaFrom},</if>
- <if test="locationTo != null">#{locationTo},</if>
- <if test="areaTo != null">#{areaTo},</if>
- <if test="priority != null">#{priority},</if>
- <if test="state != null">#{state},</if>
- <if test="remark != null">#{remark},</if>
- <if test="createUser != null">#{createUser},</if>
- <if test="createDate != null">#{createDate},</if>
- <if test="updateUser != null">#{updateUser},</if>
- <if test="updateDate != null">#{updateDate},</if>
- <if test="taskType != null">#{taskType},</if>
- <if test="shopId != null">#{shopId},</if>
- <if test="startTime != null">#{startTime},</if>
- <if test="endTime != null">#{endTime},</if>
- <if test="parentTask != null">#{parentTask},</if>
- <if test="extParam != null">#{extParam},</if>
- <if test="ext1 != null">#{ext1},</if>
- <if test="ext2 != null">#{ext2},</if>
- <if test="ext3 != null">#{ext3},</if>
- <if test="ext4 != null">#{ext4},</if>
- <if test="ext5 != null">#{ext5},</if>
- <if test="ext6 != null">#{ext6},</if>
- <if test="ext7 != null">#{ext7},</if>
- <if test="ext8 != null">#{ext8},</if>
- <if test="agvNo != null">#{agvNo},</if>
- <if test="beforeTask != null">#{beforeTask},</if>
- </trim>
- </insert>
- <update id="updateWcsTask" parameterType="WcsTask">
- update wcs_task
- <trim prefix="SET" suffixOverrides=",">
- <if test="businessType != null">business_type = #{businessType},</if>
- <if test="whTypeFrom != null">wh_type_from = #{whTypeFrom},</if>
- <if test="whNoFrom != null">wh_no_from = #{whNoFrom},</if>
- <if test="whTypeTo != null">wh_type_to = #{whTypeTo},</if>
- <if test="whNoTo != null">wh_no_to = #{whNoTo},</if>
- <if test="sysName != null">sys_name = #{sysName},</if>
- <if test="deviceName != null">device_name = #{deviceName},</if>
- <if test="batchNo != null">batch_no = #{batchNo},</if>
- <if test="batchOrderNo != null">batch_order_no = #{batchOrderNo},</if>
- <if test="locationFrom != null">location_from = #{locationFrom},</if>
- <if test="areaFrom != null">area_from = #{areaFrom},</if>
- <if test="locationTo != null">location_to = #{locationTo},</if>
- <if test="areaTo != null">area_to = #{areaTo},</if>
- <if test="priority != null">priority = #{priority},</if>
- <if test="state != null">state = #{state},</if>
- <if test="remark != null">remark = #{remark},</if>
- <if test="createUser != null">create_user = #{createUser},</if>
- <if test="createDate != null">create_date = #{createDate},</if>
- <if test="updateUser != null">update_user = #{updateUser},</if>
- <if test="updateDate != null">update_date = #{updateDate},</if>
- <if test="taskType != null">task_type = #{taskType},</if>
- <if test="shopId != null">shop_id = #{shopId},</if>
- <if test="startTime != null">start_time = #{startTime},</if>
- <if test="endTime != null">end_time = #{endTime},</if>
- <if test="parentTask != null">parent_task = #{parentTask},</if>
- <if test="extParam != null">ext_param = #{extParam},</if>
- <if test="ext1 != null">ext1 = #{ext1},</if>
- <if test="ext2 != null">ext2 = #{ext2},</if>
- <if test="ext3 != null">ext3 = #{ext3},</if>
- <if test="ext4 != null">ext4 = #{ext4},</if>
- <if test="ext5 != null">ext5 = #{ext5},</if>
- <if test="ext6 != null">ext6 = #{ext6},</if>
- <if test="ext7 != null">ext7 = #{ext7},</if>
- <if test="ext8 != null">ext8 = #{ext8},</if>
- <if test="agvNo != null">agv_no = #{agvNo},</if>
- <if test="beforeTask != null">before_task = #{beforeTask},</if>
- </trim>
- where task_no = #{taskNo}
- </update>
- <delete id="deleteWcsTaskByTaskNo" parameterType="String">
- delete from wcs_task where task_no = #{taskNo}
- </delete>
- <delete id="deleteWcsTaskByTaskNos" parameterType="String">
- delete from wcs_task where task_no in
- <foreach item="taskNo" collection="array" open="(" separator="," close=")">
- #{taskNo}
- </foreach>
- </delete>
- <select id="selectCurrentPriority" resultType="java.lang.Integer">
- select IFNULL(min(priority),0) priority from wcs_task where state = 9
- </select>
- <select id="selectWcsUnallocated" resultMap="WcsTaskResult" parameterType="Long">
- select *
- from wcs_task
- where state = 9
- order by priority desc,create_date
- </select>
- <select id="selectTaskByColNo" resultMap="WcsTaskDTOResult">
- select w.*,i.col_no,i.col_index from wcs_task w left join base_location_info i on w.location_to = i.id
- where w.state = 9
- <if test="colNo != null and colNo != ''">
- and i.col_no = #{colNo}
- </if>
- <if test="colIndex != null and colIndex != ''">
- and i.col_index <![CDATA[ < ]]> #{colIndex}
- </if>
- <if test=" warehouseId!= null and warehouseId != ''">
- and w.shop_id = #{warehouseId}
- </if>
- <if test="zoneId != null and zoneId != ''">
- and i.zone_id = #{zoneId}
- </if>
- and w.location_to is not null
- order by priority
- </select>
- <select id="selectTaskByColNoAfter" resultMap="WcsTaskDTOResult">
- select w.*,i.col_no,i.col_index from wcs_task w left join base_location_info i on w.location_to = i.id
- where w.state = 9
- <if test="colNo != null and colNo != ''">
- and i.col_no = #{colNo}
- </if>
- <if test="colIndex != null and colIndex != ''">
- and i.col_index <![CDATA[ > ]]> #{colIndex}
- </if>
- <if test=" warehouseId!= null and warehouseId != ''">
- and w.shop_id = #{warehouseId}
- </if>
- <if test="zoneId != null and zoneId != ''">
- and i.zone_id = #{zoneId}
- </if>
- and w.location_to is not null
- order by priority
- </select>
- <select id="selectBeforeTask" resultMap="WcsTaskResult">
- select * from wcs_task
- where task_no = #{taskNo} and state not in (2,7,4,11,12)
- </select>
- <select id="getTasking" parameterType="WcsTask" resultMap="WcsTaskResult">
- <include refid="selectWcsTaskVo"/>
- <where>
- <if test="locationFrom != null and locationFrom != ''"> and location_from = #{locationFrom}</if>
- <if test="areaFrom != null and areaFrom != ''"> and area_from = #{areaFrom}</if>
- <if test="locationTo != null and locationTo != ''"> and location_to = #{locationTo}</if>
- <if test="areaTo != null and areaTo != ''"> and area_to = #{areaTo}</if>
- <if test="priority != null "> and priority = #{priority}</if>
- <if test="createUser != null and createUser != ''"> and create_user = #{createUser}</if>
- <if test="createDate != null "> and create_date = #{createDate}</if>
- <if test="taskType != null and taskType != ''"> and task_type = #{taskType}</if>
- <if test="shopId != null and shopId != ''"> and shop_id = #{shopId}</if>
- <if test="startTime != null "> and start_time = #{startTime}</if>
- <if test="endTime != null "> and end_time = #{endTime}</if>
- <if test="parentTask != null and parentTask != ''"> and parent_task = #{parentTask}</if>
- <if test="agvNo != null and agvNo != ''"> and agv_no like concat('%', #{agvNo}, '%')</if>
- </where>
- and state in(1,3,4,5,6,8,9,10)
- </select>
- </mapper>
|