81 lines
3.2 KiB
XML
81 lines
3.2 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.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>
|