春风项目四线(合箱线、总装线)
wujian
5 天以前 ea3c33c8561df39d4f123d1424fda99dd0f0c51d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<?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.jcdm.main.bs.formulaChild.mapper.BsFormulaChildInfoMapper">
    
    <resultMap type="BsFormulaChildInfo" id="BsFormulaChildInfoResult">
        <result property="id"    column="id"    />
        <result property="workshopCode"    column="workshop_code"    />
        <result property="lineCode"    column="line_code"    />
        <result property="processesCode"    column="processes_code"    />
        <result property="productCode"    column="product_code"    />
        <result property="operationSteps"    column="operation_steps"    />
        <result property="techRequirement"    column="tech_requirement"    />
        <result property="operationType"    column="operation_type"    />
        <result property="stepSort"    column="step_sort"    />
        <result property="paramCode"    column="param_code"    />
        <result property="materialCode"    column="material_code"    />
        <result property="formulaCode"    column="formula_code"    />
        <result property="picture"    column="picture"    />
        <result property="remarks"    column="remarks"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="spareField3"    column="spare_field_3"    />
        <result property="spareField4"    column="spare_field_4"    />
    </resultMap>
 
    <sql id="selectBsFormulaChildInfoVo">
        select id, workshop_code, line_code, processes_code, product_code, operation_steps, tech_requirement, operation_type, step_sort, param_code, material_code, formula_code, picture, remarks, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from bs_formula_child_info
    </sql>
 
    <select id="selectBsFormulaChildInfoList" parameterType="BsFormulaChildInfo" resultMap="BsFormulaChildInfoResult">
        <include refid="selectBsFormulaChildInfoVo"/>
        <where>  
            <if test="workshopCode != null  and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
            <if test="lineCode != null  and lineCode != ''"> and line_code like concat('%', #{lineCode}, '%')</if>
            <if test="processesCode != null  and processesCode != ''"> and processes_code like concat('%', #{processesCode}, '%')</if>
            <if test="productCode != null  and productCode != ''"> and product_code like concat('%', #{productCode}, '%')</if>
            <if test="operationType != null  and operationType != ''"> and operation_type like concat('%', #{operationType}, '%')</if>
            <if test="formulaCode != null  and formulaCode != ''"> and formula_code = #{formulaCode}</if>
 
        </where>
    </select>
    
    <select id="selectBsFormulaChildInfoById" parameterType="Long" resultMap="BsFormulaChildInfoResult">
        <include refid="selectBsFormulaChildInfoVo"/>
        where id = #{id}
    </select>
 
    <select id="getProductProcess" parameterType="com.jcdm.main.bs.formulaChild.Query.ProductProcessQuery" resultMap="BsFormulaChildInfoResult">
        <include refid="selectBsFormulaChildInfoVo"/>
        <where>
            <if test="processesCode != null and processesCode != '' ">and processes_code = #{processesCode}</if>
            <if test="productCode != null and productCode != '' ">and product_code = #{productCode}</if>
        </where>
        order by step_sort
    </select>
 
    <insert id="insertBsFormulaChildInfo" parameterType="BsFormulaChildInfo" useGeneratedKeys="true" keyProperty="id">
        insert into bs_formula_child_info
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="workshopCode != null">workshop_code,</if>
            <if test="lineCode != null">line_code,</if>
            <if test="processesCode != null">processes_code,</if>
            <if test="productCode != null">product_code,</if>
            <if test="operationSteps != null">operation_steps,</if>
            <if test="techRequirement != null">tech_requirement,</if>
            <if test="operationType != null">operation_type,</if>
            <if test="stepSort != null">step_sort,</if>
            <if test="paramCode != null">param_code,</if>
            <if test="materialCode != null">material_code,</if>
            <if test="formulaCode != null">formula_code,</if>
            <if test="picture != null">picture,</if>
            <if test="remarks != null">remarks,</if>
            <if test="createUser != null">create_user,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateUser != null">update_user,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="spareField3 != null">spare_field_3,</if>
            <if test="spareField4 != null">spare_field_4,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="workshopCode != null">#{workshopCode},</if>
            <if test="lineCode != null">#{lineCode},</if>
            <if test="processesCode != null">#{processesCode},</if>
            <if test="productCode != null">#{productCode},</if>
            <if test="operationSteps != null">#{operationSteps},</if>
            <if test="techRequirement != null">#{techRequirement},</if>
            <if test="operationType != null">#{operationType},</if>
            <if test="stepSort != null">#{stepSort},</if>
            <if test="paramCode != null">#{paramCode},</if>
            <if test="materialCode != null">#{materialCode},</if>
            <if test="formulaCode != null">#{formulaCode},</if>
            <if test="picture != null">#{picture},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateUser != null">#{updateUser},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="spareField3 != null">#{spareField3},</if>
            <if test="spareField4 != null">#{spareField4},</if>
         </trim>
    </insert>
 
    <update id="updateBsFormulaChildInfo" parameterType="BsFormulaChildInfo">
        update bs_formula_child_info
        <trim prefix="SET" suffixOverrides=",">
            <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
            <if test="lineCode != null">line_code = #{lineCode},</if>
            <if test="processesCode != null">processes_code = #{processesCode},</if>
            <if test="productCode != null">product_code = #{productCode},</if>
            <if test="operationSteps != null">operation_steps = #{operationSteps},</if>
            <if test="techRequirement != null">tech_requirement = #{techRequirement},</if>
            <if test="operationType != null">operation_type = #{operationType},</if>
            <if test="stepSort != null">step_sort = #{stepSort},</if>
            <if test="paramCode != null">param_code = #{paramCode},</if>
            <if test="materialCode != null">material_code = #{materialCode},</if>
            <if test="formulaCode != null">formula_code = #{formulaCode},</if>
            <if test="picture != null">picture = #{picture},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateUser != null">update_user = #{updateUser},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteBsFormulaChildInfoById" parameterType="Long">
        delete from bs_formula_child_info where id = #{id}
    </delete>
 
    <delete id="deleteBsFormulaChildInfoByIds" parameterType="String">
        delete from bs_formula_child_info where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>