36 lines
1.5 KiB
XML
36 lines
1.5 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.klp.mes.roll.mapper.MesRollStandbyMapper">
|
|
|
|
<!-- 按产线+机架查询下批轧辊,附带辊位中文标签 -->
|
|
<select id="selectByStand" resultType="com.klp.mes.roll.domain.vo.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>
|
|
|
|
<!-- 逻辑删除指定产线+机架所有下批轧辊(清空) -->
|
|
<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>
|