refactor(mill): 优化轧辊备用管理的数据查询和状态更新逻辑

- 修改 MesRollInfoMapper 中条件更新状态方法的参数命名,提升可读性
- 更新 MesRollStandbyMapper 查询接口返回类型为 MesRollStandbyVo
- 重构 MesRollStandbyMapper XML 映射文件中的查询语句,增加位置标签字段
- 将清空操作从物理删除改为逻辑删除,保留数据记录
- 在 MesRollStandbyVo 中新增 positionLabel、remark 和 createTime 字段
- 调整控制器注解配置,移除权限校验并简化接口定义
This commit is contained in:
2026-06-12 10:26:47 +08:00
parent 21a1d339d5
commit 6acb7b4b40
7 changed files with 53 additions and 24 deletions

View File

@@ -118,13 +118,33 @@
</foreach>
</delete>
<select id="selectByStand" resultMap="MesRollStandbyResult">
<include refid="selectMesRollStandbyVo"/>
where line_id = #{lineId} and stand_no = #{standNo}
<select id="selectByStand" resultType="com.ruoyi.mill.domain.MesRollStandbyVo">
SELECT
standby_id, line_id, stand_no, roll_no, roll_type, position,
CASE
WHEN roll_type = 'BR' AND position = 'UP' THEN '上支撑辊'
WHEN roll_type = 'WR' AND position = 'UP' THEN '上工作辊'
WHEN roll_type = 'WR' AND position = 'DOWN' THEN '下工作辊'
WHEN roll_type = 'BR' AND position = 'DOWN' THEN '下支撑辊'
ELSE CONCAT(position, roll_type)
END AS position_label,
diameter, roughness, crown, ready_time, remark, create_time
FROM mes_roll_standby
WHERE del_flag = 0
AND stand_no = #{standNo}
<if test="lineId != null">AND line_id = #{lineId}</if>
ORDER BY
FIELD(roll_type, 'BR', 'WR', 'WR', 'BR'),
FIELD(position, 'UP', 'UP', 'DOWN', 'DOWN')
</select>
<delete id="clearByStand">
delete from mes_roll_standby
where line_id = #{lineId} and stand_no = #{standNo}
</delete>
<!-- 逻辑删除指定产线+机架所有下批轧辊(清空) -->
<update id="clearByStand">
UPDATE mes_roll_standby
SET del_flag = 1
WHERE del_flag = 0
AND stand_no = #{standNo}
<if test="lineId != null">AND line_id = #{lineId}</if>
</update>
</mapper>