chore: upload current WCS changes
This commit is contained in:
@@ -161,4 +161,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{guid}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectNotInsite" resultMap="WcsSrgvMapResult">
|
||||
SELECT
|
||||
|
||||
*
|
||||
FROM
|
||||
wcs_srgv_map
|
||||
WHERE
|
||||
remark = #{cache}
|
||||
AND plc_layer = #{floor}
|
||||
|
||||
<if test="sites != null and sites.size() > 0">
|
||||
AND site_id NOT IN
|
||||
<foreach collection="sites" item="site" separator="," open="(" close=")">
|
||||
#{site}
|
||||
</foreach>
|
||||
|
||||
</if>
|
||||
<if test="sites == null or sites.size() == 0">
|
||||
AND 1=1
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -144,4 +144,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{reqCode}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="selectKx" parameterType="java.util.Map" statementType="CALLABLE">
|
||||
{call proc_select_kx(#{v_position,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_orderId,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_type,mode=IN,jdbcType=VARCHAR},
|
||||
#{v_result,mode=OUT,jdbcType=INTEGER},
|
||||
#{v_result_msg,mode=OUT,jdbcType=VARCHAR})}
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -123,4 +123,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<update id="updateDeviceCdzSpare" parameterType="DeviceCdz">
|
||||
update device_cdz set spare1=null where id=#{id}
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -182,7 +182,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="setFloor != null">set_floor = #{setFloor},</if>
|
||||
<if test="powerTime != null">power_time = #{powerTime},</if>
|
||||
<if test="lastTime != null">last_time = #{lastTime},</if>
|
||||
|
||||
<if test="agvStatus != null">agv_status = #{agvStatus},</if>
|
||||
<if test="taskNo != null">task_no = #{taskNo},</if>
|
||||
<if test="srcSite != null">src_site = #{srcSite},</if>
|
||||
@@ -227,6 +227,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</delete>
|
||||
|
||||
<update id="updateLastTimeByAgvId" parameterType="String">
|
||||
update device_srgv set last_time =getdate() where agv_id=#{agvId}
|
||||
update device_srgv set last_time =convert(varchar,getdate(),120) where guid=#{agvId}
|
||||
</update>
|
||||
</mapper>
|
||||
|
||||
@@ -25,13 +25,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="theFloor" column="the_floor" />
|
||||
<result property="productId" column="product_id" />
|
||||
<result property="productName" column="product_name" />
|
||||
<result property="trayCode" column="tray_code" />
|
||||
</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,the_floor,product_id,product_name from mydo_job_wcs
|
||||
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,the_floor,product_id,product_name,tray_code 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,the_floor from mydo_job_wcs_finish
|
||||
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,the_floor,product_id,product_name,tray_code from mydo_job_wcs_finish
|
||||
</sql>
|
||||
|
||||
<select id="selectMydoJobList" parameterType="MydoJob" resultMap="MydoJobResult">
|
||||
@@ -46,8 +47,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="startTime != null and startTime != ''"> and finish_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>
|
||||
@@ -55,6 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="theFloor != null and theFloor != ''"> and the_floor = #{theFloor}</if>
|
||||
<if test="productId != null and productId != ''"> and product_id = #{productId}</if>
|
||||
<if test="productName != null and productName != ''"> and product_name = #{productName}</if>
|
||||
<if test="trayCode != null and trayCode != ''"> and tray_code = #{trayCode}</if>
|
||||
|
||||
</where>
|
||||
</select>
|
||||
@@ -118,6 +120,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="warehouseId != null">warehouse_id,</if>
|
||||
<if test="faultFlag != null">fault_flag,</if>
|
||||
<if test="theFloor != null">the_floor,</if>
|
||||
<if test="trayCode != null">tray_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="jobId != null">#{jobId},</if>
|
||||
@@ -138,6 +141,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="warehouseId != null">#{warehouseId},</if>
|
||||
<if test="faultFlag != null">#{faultFlag},</if>
|
||||
<if test="theFloor != null">#{theFloor},</if>
|
||||
<if test="trayCode != null">#{trayCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<insert id="insertHistory">
|
||||
@@ -225,8 +229,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<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="startTime != null and startTime != ''"> and finish_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>
|
||||
@@ -244,4 +248,86 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and status = 3
|
||||
order by priority desc,create_time
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobOut" resultMap="MydoJobResult">
|
||||
WITH floor_group AS (
|
||||
SELECT
|
||||
b.cargo_space_id,
|
||||
b.group_coding_no,
|
||||
b.the_floor,
|
||||
b.group_coding,
|
||||
a.task_no,
|
||||
a.job_id,
|
||||
a.in_or_out,
|
||||
a.target_cargo_space_id,
|
||||
ROW_NUMBER() OVER (
|
||||
PARTITION BY b.the_floor, b.group_coding_no
|
||||
ORDER BY b.group_coding desc
|
||||
) AS rn
|
||||
FROM mydo_job_wcs a
|
||||
INNER JOIN bas_cargo_space b
|
||||
ON a.cargo_space_id = b.cargo_space_id
|
||||
AND a.the_floor = b.the_floor
|
||||
WHERE a.in_or_out >= 20
|
||||
)
|
||||
SELECT
|
||||
cargo_space_id,
|
||||
group_coding_no,
|
||||
the_floor,
|
||||
group_coding,
|
||||
task_no,
|
||||
job_id,
|
||||
in_or_out,
|
||||
target_cargo_space_id
|
||||
FROM floor_group
|
||||
WHERE rn = 1 -- ✅ 每次每层每个通道只取 1 条
|
||||
ORDER BY group_coding DESC;
|
||||
</select>
|
||||
<select id="selectMydoJobByTrayCode" resultMap="MydoJobResult">
|
||||
<include refid="selectMydoJobVo"/>
|
||||
where tray_code =#{trayCode}
|
||||
</select>
|
||||
|
||||
<select id="selectExit" parameterType="string" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs where in_or_out>=20 and exit_id = #{exitId}
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobCount" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs
|
||||
|
||||
</select>
|
||||
<select id="selectMydoJobIn" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs where in_or_out <20 and cargo_space_id is null and status='3' and execution_phase='1'
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobCountOut" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs where in_or_out>20
|
||||
</select>
|
||||
<select id="selectByJobOut" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from mydo_job_wcs
|
||||
where in_or_out > 20
|
||||
and status = '1'
|
||||
</select>
|
||||
|
||||
<select id="selectByJobOutIsOne" parameterType="java.lang.Integer" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs where in_or_out>20 and status='1' and the_floor=1
|
||||
</select>
|
||||
|
||||
<select id="selectMydoJobExit" parameterType="string" resultType="integer">
|
||||
select count(1) from mydo_job_wcs where in_or_out>20 and exit_id=#{exit}
|
||||
</select>
|
||||
|
||||
<select id="selectTheFloorYk" parameterType="string" resultType="java.lang.Integer">
|
||||
select count(1) from mydo_job_wcs where the_floor=#{theFloor} and in_or_out=30
|
||||
</select>
|
||||
|
||||
<delete id="deleteMydoJobByTaskNos">
|
||||
delete from mydo_job_wcs where task_no in
|
||||
<foreach item="taskNo" collection="taskNos" open="(" separator="," close=")">
|
||||
#{taskNo}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
</mapper>
|
||||
|
||||
@@ -121,6 +121,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
||||
<select id="selectCount" resultType="java.lang.Integer">
|
||||
select count(1)
|
||||
from tsj_device_execution_queue
|
||||
|
||||
</select>
|
||||
|
||||
<update id="updateTsjDeviceExecutionQueue" parameterType="TsjDeviceExecutionQueue">
|
||||
update tsj_device_execution_queue
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
||||
@@ -85,7 +85,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="selectWcsSrgvQueueByFloor" parameterType="String" resultMap="WcsSrgvQueueResult">
|
||||
<include refid="selectWcsSrgvQueueVo"/>
|
||||
where default07 =#{theFloor}
|
||||
where default07 =#{theFloor} and default07 !='1'
|
||||
</select>
|
||||
|
||||
<insert id="insertWcsSrgvQueue" parameterType="WcsSrgvQueue">
|
||||
@@ -192,4 +192,45 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectMinCountJob" parameterType="list" resultType="string">
|
||||
<choose>
|
||||
<when test="list == null or list.size() == 0">
|
||||
SELECT '' AS result_site
|
||||
</when>
|
||||
<otherwise>
|
||||
select top(1) site_id from
|
||||
(select '050101' as site_id,isnull(count(1),0) as num from wcs_srgv_queue where cargo_place_site ='050101'
|
||||
union
|
||||
select '070101' as site_id,isnull(count(1),0) as num from wcs_srgv_queue where cargo_place_site ='070101')r
|
||||
where r.site_id in
|
||||
<foreach collection="list" item="site" open="(" separator="," close=")">
|
||||
#{site}
|
||||
</foreach>
|
||||
order by num
|
||||
|
||||
</otherwise>
|
||||
</choose>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectTsj" resultType="java.lang.Integer" >
|
||||
select count(1) from wcs_srgv_queue where end_site='tsj'
|
||||
|
||||
</select>
|
||||
|
||||
<select id="selectByCaogoPlaceSite" resultType="java.lang.Integer" parameterType="string">
|
||||
select count(1) from wcs_srgv_queue where cargo_place_site=#{siteId}
|
||||
</select>
|
||||
|
||||
<select id="selectByEndSite" resultType="java.lang.Integer" >
|
||||
select count(1) from wcs_srgv_queue where end_site='070101' or end_site ='050101'
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectTaskNosByGuids" parameterType="String" resultType="string">
|
||||
select task_no from wcs_srgv_queue where guid in
|
||||
<foreach item="guid" collection="array" open="(" separator="," close=")">
|
||||
#{guid}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
<?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.system.mapper.AgvContainerTaskMapper">
|
||||
|
||||
<resultMap type="AgvContainerTask" id="AgvContainerTaskResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="container" column="container" />
|
||||
<result property="startPoint" column="start_point" />
|
||||
<result property="endPoint" column="end_point" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="startTime" column="start_time" />
|
||||
<result property="finishTime" column="finish_time" />
|
||||
<result property="taskNo" column="task_no" />
|
||||
<result property="status" column="status" />
|
||||
<result property="spare1" column="spare1" />
|
||||
<result property="spare2" column="spare2" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectAgvContainerTaskVo">
|
||||
select id, container, start_point, end_point, create_time, start_time, finish_time, task_no, status, spare1, spare2 from agv_container_task
|
||||
</sql>
|
||||
|
||||
<select id="selectAgvContainerTaskList" parameterType="AgvContainerTask" resultMap="AgvContainerTaskResult">
|
||||
<include refid="selectAgvContainerTaskVo"/>
|
||||
<where>
|
||||
<if test="container != null and container != ''"> and container = #{container}</if>
|
||||
<if test="startPoint != null and startPoint != ''"> and start_point = #{startPoint}</if>
|
||||
<if test="endPoint != null and endPoint != ''"> and end_point = #{endPoint}</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="taskNo != null and taskNo != ''"> and task_no = #{taskNo}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
|
||||
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAgvContainerTaskById" parameterType="Long" resultMap="AgvContainerTaskResult">
|
||||
<include refid="selectAgvContainerTaskVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertAgvContainerTask" parameterType="AgvContainerTask" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into agv_container_task
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="container != null">container,</if>
|
||||
<if test="startPoint != null">start_point,</if>
|
||||
<if test="endPoint != null">end_point,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="finishTime != null">finish_time,</if>
|
||||
<if test="taskNo != null">task_no,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="spare1 != null">spare1,</if>
|
||||
<if test="spare2 != null">spare2,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="container != null">#{container},</if>
|
||||
<if test="startPoint != null">#{startPoint},</if>
|
||||
<if test="endPoint != null">#{endPoint},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="finishTime != null">#{finishTime},</if>
|
||||
<if test="taskNo != null">#{taskNo},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="spare1 != null">#{spare1},</if>
|
||||
<if test="spare2 != null">#{spare2},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateAgvContainerTask" parameterType="AgvContainerTask">
|
||||
update agv_container_task
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="container != null">container = #{container},</if>
|
||||
<if test="startPoint != null">start_point = #{startPoint},</if>
|
||||
<if test="endPoint != null">end_point = #{endPoint},</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="taskNo != null">task_no = #{taskNo},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="spare1 != null">spare1 = #{spare1},</if>
|
||||
<if test="spare2 != null">spare2 = #{spare2},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteAgvContainerTaskById" parameterType="Long">
|
||||
delete from agv_container_task where id = #{id}
|
||||
</delete>
|
||||
<delete id="deleteAgvContainerTaskByContainer" parameterType="string">
|
||||
delete from agv_container_task where container = #{container}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteAgvContainerTaskByIds" parameterType="String">
|
||||
delete from agv_container_task where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="insertAgvContainerTaskFinish" parameterType="string">
|
||||
insert into agv_container_task_finish select * from agv_container_task where container=#{orderId}
|
||||
</select>
|
||||
|
||||
<update id="updateAgvContainerTaskByOrder" parameterType="string">
|
||||
update agv_container_task set status='2' where container=#{orderId}
|
||||
</update>
|
||||
|
||||
<select id="selectAgvContainerFinishOne" resultMap="AgvContainerTaskResult">
|
||||
select top 1 * from agv_container_task where status='2'
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user