feat(roll): 完成轧辊管理全栈模块
DB:mill_roll(轧辊库)+ mill_roll_change(换辊记录),已执行到服务器 后端: - MillRoll / MillRollChange domain - Mapper 接口 + XML(keyProperty 正确:rollId/changeId) - Service + ServiceImpl(换辊时自动更新轧辊 status 为 Online Use) - MillRollController /mill/roll + MillRollChangeController /mill/rollChange 前端: - api/mill/roll.js 8个接口函数 - views/mill/roll.vue 三段式布局 ·上:换辊数据历史表格 ·左下:当前辊系参数(6辊图形 CSS 圆圈 + 编号/径/时间展示) ·右下:轧辊库表格 + 条件查询 + 更换/添加/修改/删除操作 - 路由注册 /mill/roll Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,70 @@
|
||||
<?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.mill.mapper.MillRollChangeMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.ruoyi.mill.domain.MillRollChange">
|
||||
<id property="changeId" column="change_id"/>
|
||||
<result property="changeTime" column="change_time"/>
|
||||
<result property="changeStatus" column="change_status"/>
|
||||
<result property="upperWrNo" column="upper_wr_no"/>
|
||||
<result property="upperWrDia" column="upper_wr_dia"/>
|
||||
<result property="lowerWrNo" column="lower_wr_no"/>
|
||||
<result property="lowerWrDia" column="lower_wr_dia"/>
|
||||
<result property="upperIrNo" column="upper_ir_no"/>
|
||||
<result property="upperIrDia" column="upper_ir_dia"/>
|
||||
<result property="lowerIrNo" column="lower_ir_no"/>
|
||||
<result property="lowerIrDia" column="lower_ir_dia"/>
|
||||
<result property="upperBrNo" column="upper_br_no"/>
|
||||
<result property="upperBrDia" column="upper_br_dia"/>
|
||||
<result property="lowerBrNo" column="lower_br_no"/>
|
||||
<result property="lowerBrDia" column="lower_br_dia"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">
|
||||
change_id, change_time, change_status,
|
||||
upper_wr_no, upper_wr_dia, lower_wr_no, lower_wr_dia,
|
||||
upper_ir_no, upper_ir_dia, lower_ir_no, lower_ir_dia,
|
||||
upper_br_no, upper_br_dia, lower_br_no, lower_br_dia,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_roll_change
|
||||
WHERE del_flag = '0'
|
||||
<if test="changeStatus != null and changeStatus != ''">
|
||||
AND change_status = #{changeStatus}
|
||||
</if>
|
||||
ORDER BY change_time DESC
|
||||
</select>
|
||||
|
||||
<select id="selectLatest" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_roll_change
|
||||
WHERE del_flag = '0'
|
||||
ORDER BY change_id DESC
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="changeId">
|
||||
INSERT INTO mill_roll_change (
|
||||
change_time, change_status,
|
||||
upper_wr_no, upper_wr_dia, lower_wr_no, lower_wr_dia,
|
||||
upper_ir_no, upper_ir_dia, lower_ir_no, lower_ir_dia,
|
||||
upper_br_no, upper_br_dia, lower_br_no, lower_br_dia,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
) VALUES (
|
||||
#{changeTime}, #{changeStatus},
|
||||
#{upperWrNo}, #{upperWrDia}, #{lowerWrNo}, #{lowerWrDia},
|
||||
#{upperIrNo}, #{upperIrDia}, #{lowerIrNo}, #{lowerIrDia},
|
||||
#{upperBrNo}, #{upperBrDia}, #{lowerBrNo}, #{lowerBrDia},
|
||||
'0', #{createBy}, NOW(), #{updateBy}, NOW(), #{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
</mapper>
|
||||
92
ruoyi-mill/src/main/resources/mapper/mill/MillRollMapper.xml
Normal file
92
ruoyi-mill/src/main/resources/mapper/mill/MillRollMapper.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?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.mill.mapper.MillRollMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.ruoyi.mill.domain.MillRoll">
|
||||
<id property="rollId" column="roll_id"/>
|
||||
<result property="rollNo" column="roll_no"/>
|
||||
<result property="rollType" column="roll_type"/>
|
||||
<result property="status" column="status"/>
|
||||
<result property="initialDia" column="initial_dia"/>
|
||||
<result property="currentDia" column="current_dia"/>
|
||||
<result property="flag" column="flag"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="remark" column="remark"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">
|
||||
roll_id, roll_no, roll_type, status, initial_dia, current_dia,
|
||||
flag, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_roll
|
||||
WHERE del_flag = '0'
|
||||
<if test="rollNo != null and rollNo != ''">
|
||||
AND roll_no LIKE CONCAT('%', #{rollNo}, '%')
|
||||
</if>
|
||||
<if test="rollType != null and rollType != ''">
|
||||
AND roll_type = #{rollType}
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
ORDER BY roll_id ASC
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_roll
|
||||
WHERE roll_id = #{rollId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="rollId">
|
||||
INSERT INTO mill_roll (
|
||||
roll_no, roll_type, status, initial_dia, current_dia,
|
||||
flag, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
) VALUES (
|
||||
#{rollNo}, #{rollType},
|
||||
<choose>
|
||||
<when test="status != null and status != ''">#{status}</when>
|
||||
<otherwise>'Offline'</otherwise>
|
||||
</choose>,
|
||||
#{initialDia}, #{currentDia},
|
||||
#{flag}, '0',
|
||||
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_roll
|
||||
<set>
|
||||
<if test="rollNo != null and rollNo != ''">roll_no = #{rollNo},</if>
|
||||
<if test="rollType != null and rollType != ''">roll_type = #{rollType},</if>
|
||||
<if test="status != null">status = #{status},</if>
|
||||
<if test="initialDia != null">initial_dia = #{initialDia},</if>
|
||||
<if test="currentDia != null">current_dia = #{currentDia},</if>
|
||||
<if test="flag != null">flag = #{flag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW()
|
||||
</set>
|
||||
WHERE roll_id = #{rollId} AND del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="deleteByIds">
|
||||
UPDATE mill_roll SET del_flag = '2', update_time = NOW()
|
||||
WHERE roll_id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<update id="updateStatus">
|
||||
UPDATE mill_roll SET status = #{status}, update_time = NOW()
|
||||
WHERE roll_id = #{rollId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user