1完成酸轧轧辊调整
2完成双机架工艺规格串联 3完成双机架计划串联 4完成双机架wip快捷录入检索 5完成双机架实绩串联
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
<?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.mapper.DrMillProcessPassMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.klp.domain.DrMillProcessPass">
|
||||
<id property="passId" column="pass_id"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="versionId" column="version_id"/>
|
||||
<result property="passNo" column="pass_no"/>
|
||||
<result property="inThick" column="in_thick"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="width" column="width"/>
|
||||
<result property="rollForce" column="roll_force"/>
|
||||
<result property="inTension" column="in_tension"/>
|
||||
<result property="outTension" column="out_tension"/>
|
||||
<result property="maxSpeed" column="max_speed"/>
|
||||
<result property="inUnitTension" column="in_unit_tension"/>
|
||||
<result property="outUnitTension" column="out_unit_tension"/>
|
||||
<result property="reduction" column="reduction"/>
|
||||
<result property="totalReduction" column="total_reduction"/>
|
||||
<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>
|
||||
|
||||
<select id="selectByVersionId" resultMap="BaseRM">
|
||||
SELECT pass_id, recipe_id, version_id, pass_no, in_thick, out_thick, width,
|
||||
roll_force, in_tension, out_tension, max_speed,
|
||||
in_unit_tension, out_unit_tension, reduction, total_reduction,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
FROM mill_process_pass
|
||||
WHERE version_id = #{versionId} AND del_flag = '0'
|
||||
ORDER BY pass_no ASC
|
||||
</select>
|
||||
|
||||
<select id="selectByRecipeId" resultMap="BaseRM">
|
||||
SELECT pass_id, recipe_id, version_id, pass_no, in_thick, out_thick, width,
|
||||
roll_force, in_tension, out_tension, max_speed,
|
||||
in_unit_tension, out_unit_tension, reduction, total_reduction,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
FROM mill_process_pass
|
||||
WHERE recipe_id = #{recipeId} AND del_flag = '0'
|
||||
ORDER BY pass_no ASC
|
||||
</select>
|
||||
|
||||
<insert id="insertBatch">
|
||||
INSERT INTO mill_process_pass (
|
||||
recipe_id, version_id, pass_no, in_thick, out_thick, width,
|
||||
roll_force, in_tension, out_tension, max_speed,
|
||||
in_unit_tension, out_unit_tension, reduction, total_reduction,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES
|
||||
<foreach collection="list" item="p" separator=",">
|
||||
(#{p.recipeId}, #{p.versionId}, #{p.passNo}, #{p.inThick}, #{p.outThick}, #{p.width},
|
||||
#{p.rollForce}, #{p.inTension}, #{p.outTension}, #{p.maxSpeed},
|
||||
#{p.inUnitTension}, #{p.outUnitTension}, #{p.reduction}, #{p.totalReduction},
|
||||
#{p.createBy}, NOW(), #{p.updateBy}, NOW(), #{p.remark}, '0')
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="deleteByVersionId">
|
||||
UPDATE mill_process_pass SET del_flag = '2', update_time = NOW()
|
||||
WHERE version_id = #{versionId}
|
||||
</update>
|
||||
|
||||
<update id="deleteByRecipeId">
|
||||
UPDATE mill_process_pass SET del_flag = '2', update_time = NOW()
|
||||
WHERE recipe_id = #{recipeId}
|
||||
</update>
|
||||
|
||||
<select id="selectDistinctRecipeIdsWithOrphanPasses" resultType="java.lang.Long">
|
||||
SELECT DISTINCT recipe_id
|
||||
FROM mill_process_pass
|
||||
WHERE version_id IS NULL AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<update id="updateVersionIdForOrphans">
|
||||
UPDATE mill_process_pass
|
||||
SET version_id = #{versionId},
|
||||
update_time = NOW()
|
||||
WHERE recipe_id = #{recipeId}
|
||||
AND version_id IS NULL
|
||||
AND del_flag = '0'
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,80 @@
|
||||
<?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.mapper.DrMillProcessRecipeMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.klp.domain.DrMillProcessRecipe">
|
||||
<id property="recipeId" column="recipe_id"/>
|
||||
<result property="recipeNo" column="recipe_no"/>
|
||||
<result property="alloyNo" column="alloy_no"/>
|
||||
<result property="passCount" column="pass_count"/>
|
||||
<result property="inThick" column="in_thick"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="outWidth" column="out_width"/>
|
||||
<result property="status" column="status"/>
|
||||
<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">
|
||||
recipe_id, recipe_no, alloy_no, pass_count, in_thick, out_thick, out_width,
|
||||
status, del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe
|
||||
WHERE del_flag = '0'
|
||||
<if test="recipeNo != null and recipeNo != ''">
|
||||
AND recipe_no LIKE CONCAT('%', #{recipeNo}, '%')
|
||||
</if>
|
||||
<if test="alloyNo != null and alloyNo != ''">
|
||||
AND alloy_no LIKE CONCAT('%', #{alloyNo}, '%')
|
||||
</if>
|
||||
<if test="status != null and status != ''">
|
||||
AND status = #{status}
|
||||
</if>
|
||||
ORDER BY recipe_id ASC
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_process_recipe
|
||||
WHERE recipe_id = #{recipeId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="recipeId">
|
||||
INSERT INTO mill_process_recipe (
|
||||
recipe_no, alloy_no, pass_count, in_thick, out_thick, out_width,
|
||||
status, create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{recipeNo}, #{alloyNo}, #{passCount}, #{inThick}, #{outThick}, #{outWidth},
|
||||
#{status}, #{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_process_recipe
|
||||
SET recipe_no = #{recipeNo},
|
||||
alloy_no = #{alloyNo},
|
||||
pass_count = #{passCount},
|
||||
in_thick = #{inThick},
|
||||
out_thick = #{outThick},
|
||||
out_width = #{outWidth},
|
||||
status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW(),
|
||||
remark = #{remark}
|
||||
WHERE recipe_id = #{recipeId}
|
||||
</update>
|
||||
|
||||
<update id="deleteBatchByIds">
|
||||
UPDATE mill_process_recipe SET del_flag = '2', update_time = NOW()
|
||||
WHERE recipe_id IN
|
||||
<foreach collection="array" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?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.mapper.DrMillProcessRecipeVersionMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.klp.domain.DrMillProcessRecipeVersion">
|
||||
<id property="versionId" column="version_id"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="versionCode" column="version_code"/>
|
||||
<result property="isActive" column="is_active"/>
|
||||
<result property="status" column="status"/>
|
||||
<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"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="cols">
|
||||
version_id, recipe_id, version_code, is_active, status,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
</sql>
|
||||
|
||||
<select id="selectByRecipeId" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe_version
|
||||
WHERE recipe_id = #{recipeId} AND del_flag = '0'
|
||||
ORDER BY version_id ASC
|
||||
</select>
|
||||
|
||||
<select id="selectV1ByRecipeId" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe_version
|
||||
WHERE recipe_id = #{recipeId} AND version_code = 'V1.0' AND del_flag = '0'
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectActiveByRecipeId" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe_version
|
||||
WHERE recipe_id = #{recipeId} AND is_active = 1 AND del_flag = '0'
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_process_recipe_version
|
||||
WHERE version_id = #{versionId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="versionId">
|
||||
INSERT INTO mill_process_recipe_version (
|
||||
recipe_id, version_code, is_active, status,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{recipeId}, #{versionCode}, IFNULL(#{isActive}, 0), IFNULL(#{status}, '0'),
|
||||
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_process_recipe_version
|
||||
SET version_code = #{versionCode},
|
||||
status = #{status},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW(),
|
||||
remark = #{remark}
|
||||
WHERE version_id = #{versionId}
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE mill_process_recipe_version SET del_flag = '2', update_time = NOW()
|
||||
WHERE version_id = #{versionId}
|
||||
</update>
|
||||
|
||||
<update id="deleteByRecipeIds">
|
||||
UPDATE mill_process_recipe_version SET del_flag = '2', update_time = NOW()
|
||||
WHERE recipe_id IN
|
||||
<foreach collection="ids" item="id" open="(" separator="," close=")">#{id}</foreach>
|
||||
</update>
|
||||
|
||||
<update id="deactivateOthers">
|
||||
UPDATE mill_process_recipe_version
|
||||
SET is_active = 0, update_time = NOW()
|
||||
WHERE recipe_id = #{recipeId} AND version_id != #{versionId} AND del_flag = '0'
|
||||
</update>
|
||||
|
||||
<update id="activate">
|
||||
UPDATE mill_process_recipe_version
|
||||
SET is_active = 1, status = '1', update_time = NOW()
|
||||
WHERE version_id = #{versionId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
160
klp-wms/src/main/resources/mapper/DrMillProductionPlanMapper.xml
Normal file
160
klp-wms/src/main/resources/mapper/DrMillProductionPlanMapper.xml
Normal file
@@ -0,0 +1,160 @@
|
||||
<?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.mapper.DrMillProductionPlanMapper">
|
||||
|
||||
<resultMap id="BaseRM" type="com.klp.domain.DrMillProductionPlan">
|
||||
<id property="planId" column="plan_id"/>
|
||||
<result property="planNo" column="plan_no"/>
|
||||
<result property="planStatus" column="plan_status"/>
|
||||
<result property="prodStatus" column="prod_status"/>
|
||||
<result property="sortNo" column="sort_no"/>
|
||||
<result property="inMatNo" column="in_mat_no"/>
|
||||
<result property="alloyNo" column="sg_sign"/>
|
||||
<result property="inMatThick" column="in_mat_thick"/>
|
||||
<result property="inMatWidth" column="in_mat_width"/>
|
||||
<result property="inMatWeight" column="in_mat_wt"/>
|
||||
<result property="inMatLength" column="in_mat_len"/>
|
||||
<result property="inMatId" column="in_mat_in_dia"/>
|
||||
<result property="inMatOd" column="in_mat_dia"/>
|
||||
<result property="outThick" column="out_thick"/>
|
||||
<result property="passCount" column="pass_count"/>
|
||||
<result property="recipeId" column="recipe_id"/>
|
||||
<result property="recipeNo" column="recipe_no"/>
|
||||
<result property="versionId" column="version_id"/>
|
||||
<result property="enterCoilNo" column="enter_coil_no"/>
|
||||
<result property="currentCoilNo" column="current_coil_no"/>
|
||||
<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">
|
||||
plan_id, plan_no, plan_status, prod_status, sort_no,
|
||||
in_mat_no, sg_sign, in_mat_thick, in_mat_width, in_mat_wt, in_mat_len,
|
||||
in_mat_in_dia, in_mat_dia, out_thick, pass_count, recipe_id, recipe_no,
|
||||
version_id, enter_coil_no, current_coil_no,
|
||||
del_flag, create_by, create_time, update_by, update_time, remark
|
||||
</sql>
|
||||
|
||||
<select id="selectList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_production_plan
|
||||
WHERE del_flag = '0'
|
||||
<if test="inMatNo != null and inMatNo != ''">
|
||||
AND (in_mat_no LIKE CONCAT('%', #{inMatNo}, '%')
|
||||
OR enter_coil_no LIKE CONCAT('%', #{inMatNo}, '%')
|
||||
OR current_coil_no LIKE CONCAT('%', #{inMatNo}, '%'))
|
||||
</if>
|
||||
<if test="planStatus != null and planStatus != ''">
|
||||
AND plan_status = #{planStatus}
|
||||
</if>
|
||||
<if test="prodStatus != null and prodStatus != ''">
|
||||
AND prod_status = #{prodStatus}
|
||||
</if>
|
||||
ORDER BY sort_no ASC, plan_id ASC
|
||||
</select>
|
||||
|
||||
<!-- 实绩分页:按创建时间倒序,支持卷号/状态/时间范围过滤 -->
|
||||
<sql id="actualWhere">
|
||||
WHERE del_flag = '0'
|
||||
<if test="inMatNo != null and inMatNo != ''">
|
||||
AND (in_mat_no LIKE CONCAT('%',#{inMatNo},'%')
|
||||
OR enter_coil_no LIKE CONCAT('%',#{inMatNo},'%')
|
||||
OR current_coil_no LIKE CONCAT('%',#{inMatNo},'%'))
|
||||
</if>
|
||||
<if test="planStatus != null and planStatus != ''">
|
||||
AND plan_status = #{planStatus}
|
||||
</if>
|
||||
<if test="createStartTime != null and createStartTime != ''">
|
||||
AND create_time >= #{createStartTime}
|
||||
</if>
|
||||
<if test="createEndTime != null and createEndTime != ''">
|
||||
AND create_time <= #{createEndTime}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectPageList" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/>
|
||||
FROM mill_production_plan
|
||||
<include refid="actualWhere"/>
|
||||
ORDER BY create_time DESC
|
||||
<if test="pageSize != null and pageNum != null">
|
||||
LIMIT #{pageSize} OFFSET #{offset}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="countPageList" resultType="long">
|
||||
SELECT COUNT(*) FROM mill_production_plan
|
||||
<include refid="actualWhere"/>
|
||||
</select>
|
||||
|
||||
<select id="selectById" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_production_plan
|
||||
WHERE plan_id = #{planId} AND del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectByPlanNo" resultMap="BaseRM">
|
||||
SELECT <include refid="cols"/> FROM mill_production_plan
|
||||
WHERE plan_no = #{planNo} AND del_flag = '0'
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="countByStatus" resultType="int">
|
||||
SELECT COUNT(*) FROM mill_production_plan WHERE del_flag = '0' AND plan_status = #{status}
|
||||
</select>
|
||||
|
||||
<insert id="insert" useGeneratedKeys="true" keyProperty="planId">
|
||||
INSERT INTO mill_production_plan (
|
||||
plan_no, plan_status, prod_status, sort_no,
|
||||
in_mat_no, sg_sign, in_mat_thick, in_mat_width, in_mat_wt, in_mat_len,
|
||||
in_mat_in_dia, in_mat_dia, out_thick, pass_count, recipe_id, recipe_no,
|
||||
version_id, enter_coil_no, current_coil_no,
|
||||
create_by, create_time, update_by, update_time, remark, del_flag
|
||||
) VALUES (
|
||||
#{planNo}, IFNULL(#{planStatus},'0'), IFNULL(#{prodStatus},'Idle'), IFNULL(#{sortNo},0),
|
||||
#{inMatNo}, #{alloyNo}, #{inMatThick}, #{inMatWidth}, #{inMatWeight}, #{inMatLength},
|
||||
#{inMatId}, #{inMatOd}, #{outThick}, IFNULL(#{passCount},0), #{recipeId}, #{recipeNo},
|
||||
#{versionId}, #{enterCoilNo}, #{currentCoilNo},
|
||||
#{createBy}, NOW(), #{updateBy}, NOW(), #{remark}, '0'
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
UPDATE mill_production_plan
|
||||
SET plan_status = #{planStatus},
|
||||
prod_status = #{prodStatus},
|
||||
in_mat_no = #{inMatNo},
|
||||
sg_sign = #{alloyNo},
|
||||
in_mat_thick = #{inMatThick},
|
||||
in_mat_width = #{inMatWidth},
|
||||
in_mat_wt = #{inMatWeight},
|
||||
in_mat_len = #{inMatLength},
|
||||
in_mat_in_dia = #{inMatId},
|
||||
in_mat_dia = #{inMatOd},
|
||||
out_thick = #{outThick},
|
||||
pass_count = #{passCount},
|
||||
recipe_id = #{recipeId},
|
||||
recipe_no = #{recipeNo},
|
||||
version_id = #{versionId},
|
||||
enter_coil_no = #{enterCoilNo},
|
||||
current_coil_no = #{currentCoilNo},
|
||||
update_by = #{updateBy},
|
||||
update_time = NOW(),
|
||||
remark = #{remark}
|
||||
WHERE plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<update id="deleteById">
|
||||
UPDATE mill_production_plan SET del_flag = '2', update_time = NOW()
|
||||
WHERE plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<update id="updateSortNo">
|
||||
UPDATE mill_production_plan SET sort_no = #{sortNo} WHERE plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user