Files
FT541-WCS/ruoyi-admin/src/main/resources/mapper/queue/DdjDeviceExecutionQueueMapper.xml
刘汗青 52772494d4 fix(schedule): 修复重量读取逻辑及配置更新
- 更新Redis和数据库地址
- 优化重量秤数据读取与资源关闭
- 使用数据库重量并处理低于40kg的默认值
- 修复调度线程命名及查询返回类型
2026-08-31 10:31:46 +08:00

188 lines
9.3 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.queue.ddj.mapper.DdjDeviceExecutionQueueMapper">
<resultMap type="DdjDeviceExecutionQueue" id="DdjDeviceExecutionQueueResult">
<result property="uuid" column="uuid" />
<result property="rwh" column="rwh" />
<result property="devName" column="dev_name" />
<result property="devId" column="dev_id" />
<result property="rwzt" column="rwzt" />
<result property="yph" column="yph" />
<result property="ylh" column="ylh" />
<result property="ych" column="ych" />
<result property="mbph" column="mbph" />
<result property="mblh" column="mblh" />
<result property="mbch" column="mbch" />
<result property="ddjxf" column="ddjxf" />
<result property="rwlx" column="rwlx" />
<result property="scsj" column="scsj" />
<result property="xfsj" column="xfsj" />
<result property="jssj" column="jssj" />
<result property="mlfs" column="mlfs" />
<result property="spare1" column="spare1" />
<result property="spare2" column="spare2" />
<result property="spare3" column="spare3" />
<result property="spare4" column="spare4" />
<result property="spare5" column="spare5" />
<result property="spare6" column="spare6" />
</resultMap>
<sql id="selectDdjDeviceExecutionQueueVo">
select uuid, rwh, dev_name, dev_id, rwzt, yph, ylh, ych, mbph, mblh, mbch, ddjxf, rwlx, scsj, xfsj, jssj, mlfs, spare1, spare2, spare3,spare4, spare5, spare6 from ddj_device_execution_queue
</sql>
<select id="selectDdjDeviceExecutionQueueList" parameterType="DdjDeviceExecutionQueue" resultMap="DdjDeviceExecutionQueueResult">
<include refid="selectDdjDeviceExecutionQueueVo"/>
<where>
<if test="rwh != null "> and rwh = #{rwh}</if>
<if test="devName != null and devName != ''"> and dev_name like concat('%', #{devName}, '%')</if>
<if test="devId != null "> and dev_id = #{devId}</if>
<if test="rwzt != null "> and rwzt = #{rwzt}</if>
<if test="yph != null "> and yph = #{yph}</if>
<if test="ylh != null "> and ylh = #{ylh}</if>
<if test="ych != null "> and ych = #{ych}</if>
<if test="mbph != null "> and mbph = #{mbph}</if>
<if test="mblh != null "> and mblh = #{mblh}</if>
<if test="mbch != null "> and mbch = #{mbch}</if>
<if test="ddjxf != null and ddjxf != ''"> and ddjxf = #{ddjxf}</if>
<if test="rwlx != null "> and rwlx = #{rwlx}</if>
<if test="scsj != null and scsj != ''"> and scsj = #{scsj}</if>
<if test="xfsj != null and xfsj != ''"> and xfsj = #{xfsj}</if>
<if test="jssj != null and jssj != ''"> and jssj = #{jssj}</if>
<if test="mlfs != null "> and mlfs = #{mlfs}</if>
<if test="spare1 != null and spare1 != ''"> and spare1 = #{spare1}</if>
<if test="spare2 != null and spare2 != ''"> and spare2 = #{spare2}</if>
<if test="spare3 != null and spare3 != ''"> and spare3 = #{spare3}</if>
<if test="spare4 != null and spare4 != ''"> and spare4 = #{spare4}</if>
<if test="spare5 != null and spare5 != ''"> and spare5 = #{spare5}</if>
<if test="spare6 != null and spare6 != ''"> and spare6 = #{spare6}</if>
<if test="rwlxList != null and rwlxList.size() >0">
and rwlx in
<foreach item="item" collection="rwlxList" separator="," open="(" close=")">
#{item}
</foreach>
</if>
</where>
order by rwlx desc,scsj asc
</select>
<select id="selectDdjDeviceExecutionQueueByUuid" parameterType="String" resultMap="DdjDeviceExecutionQueueResult">
<include refid="selectDdjDeviceExecutionQueueVo"/>
where uuid = #{uuid}
</select>
<select id="selectDdjDeviceExecutionQueueListByRwlx"
resultMap="DdjDeviceExecutionQueueResult">
<include refid="selectDdjDeviceExecutionQueueVo"/>
where rwlx = #{rwlx} and dev_id = #{devId}
</select>
<select id="selectDdjDeviceExecutionQueueByRwhAndXd"
resultMap="DdjDeviceExecutionQueueResult">
<include refid="selectDdjDeviceExecutionQueueVo"/>
where rwh = #{rwh} and dev_id = #{devId}
</select>
<select id="selectOutJobCount" resultType="java.lang.Integer">
select count(*)
from ddj_device_execution_queue
where spare2 = #{spare2}
</select>
<insert id="insertDdjDeviceExecutionQueue" parameterType="DdjDeviceExecutionQueue">
insert into ddj_device_execution_queue
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uuid != null">uuid,</if>
<if test="rwh != null">rwh,</if>
<if test="devName != null and devName != ''">dev_name,</if>
<if test="devId != null">dev_id,</if>
<if test="rwzt != null">rwzt,</if>
<if test="yph != null">yph,</if>
<if test="ylh != null">ylh,</if>
<if test="ych != null">ych,</if>
<if test="mbph != null">mbph,</if>
<if test="mblh != null">mblh,</if>
<if test="mbch != null">mbch,</if>
<if test="ddjxf != null">ddjxf,</if>
<if test="rwlx != null">rwlx,</if>
<if test="scsj != null">scsj,</if>
<if test="xfsj != null">xfsj,</if>
<if test="jssj != null">jssj,</if>
<if test="mlfs != null">mlfs,</if>
<if test="spare1 != null">spare1,</if>
<if test="spare2 != null">spare2,</if>
<if test="spare3 != null">spare3,</if>
<if test="spare4 != null">spare4,</if>
<if test="spare5 != null">spare5,</if>
<if test="spare6 != null">spare6,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uuid != null">#{uuid},</if>
<if test="rwh != null">#{rwh},</if>
<if test="devName != null and devName != ''">#{devName},</if>
<if test="devId != null">#{devId},</if>
<if test="rwzt != null">#{rwzt},</if>
<if test="yph != null">#{yph},</if>
<if test="ylh != null">#{ylh},</if>
<if test="ych != null">#{ych},</if>
<if test="mbph != null">#{mbph},</if>
<if test="mblh != null">#{mblh},</if>
<if test="mbch != null">#{mbch},</if>
<if test="ddjxf != null">#{ddjxf},</if>
<if test="rwlx != null">#{rwlx},</if>
<if test="scsj != null">#{scsj},</if>
<if test="xfsj != null">#{xfsj},</if>
<if test="jssj != null">#{jssj},</if>
<if test="mlfs != null">#{mlfs},</if>
<if test="spare1 != null">#{spare1},</if>
<if test="spare2 != null">#{spare2},</if>
<if test="spare3 != null">#{spare3},</if>
<if test="spare4 != null">#{spare4},</if>
<if test="spare5 != null">#{spare5},</if>
<if test="spare6 != null">#{spare6},</if>
</trim>
</insert>
<update id="updateDdjDeviceExecutionQueue" parameterType="DdjDeviceExecutionQueue">
update ddj_device_execution_queue
<trim prefix="SET" suffixOverrides=",">
<if test="rwh != null">rwh = #{rwh},</if>
<if test="devName != null and devName != ''">dev_name = #{devName},</if>
<if test="devId != null">dev_id = #{devId},</if>
<if test="rwzt != null">rwzt = #{rwzt},</if>
<if test="yph != null">yph = #{yph},</if>
<if test="ylh != null">ylh = #{ylh},</if>
<if test="ych != null">ych = #{ych},</if>
<if test="mbph != null">mbph = #{mbph},</if>
<if test="mblh != null">mblh = #{mblh},</if>
<if test="mbch != null">mbch = #{mbch},</if>
<if test="ddjxf != null">ddjxf = #{ddjxf},</if>
<if test="rwlx != null">rwlx = #{rwlx},</if>
<if test="scsj != null">scsj = #{scsj},</if>
<if test="xfsj != null">xfsj = #{xfsj},</if>
<if test="jssj != null">jssj = #{jssj},</if>
<if test="mlfs != null">mlfs = #{mlfs},</if>
<if test="spare1 != null">spare1 = #{spare1},</if>
<if test="spare2 != null">spare2 = #{spare2},</if>
<if test="spare3 != null">spare3 = #{spare3},</if>
<if test="spare4 != null">spare4 = #{spare4},</if>
<if test="spare5 != null">spare5 = #{spare5},</if>
<if test="spare6 != null">spare6 = #{spare6},</if>
</trim>
where uuid = #{uuid}
</update>
<delete id="deleteDdjDeviceExecutionQueueByUuid" parameterType="String">
delete from ddj_device_execution_queue where uuid = #{uuid}
</delete>
<delete id="deleteDdjDeviceExecutionQueueByUuids" parameterType="String">
delete from ddj_device_execution_queue where uuid in
<foreach item="uuid" collection="array" open="(" separator="," close=")">
#{uuid}
</foreach>
</delete>
</mapper>