同步最新本地代码

This commit is contained in:
zgw
2026-08-11 12:57:27 +08:00
parent cbc76be62f
commit 3f38269a1f
66 changed files with 2809 additions and 693 deletions

View File

@@ -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 &gt;= #{startTime}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time &lt;= #{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 &gt;= #{startTime}</if>
<if test="finishTime != null and finishTime != ''"> and finish_time &lt;= #{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 a.create_time ASC,a.job_id ASC
) 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 &lt;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>