admin
2024-07-03 475e409e27c5f05b0dcf2be1063ce35700c51bf2
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?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.da.paramCollectionTemp.mapper.DaParamCollectionTempMapper">
    
    <resultMap type="DaParamCollectionTemp" id="DaParamCollectionTempResult">
        <result property="id"    column="id"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="productCode"    column="product_code"    />
        <result property="productionLine"    column="production_line"    />
        <result property="locationCode"    column="location_code"    />
        <result property="equipmentNo"    column="equipment_no"    />
        <result property="paramCode"    column="param_code"    />
        <result property="paramValue"    column="param_value"    />
        <result property="paramUpper"    column="param_upper"    />
        <result property="paramLower"    column="param_lower"    />
        <result property="paramStandard"    column="param_standard"    />
        <result property="collectionTime"    column="collection_time"    />
        <result property="moduleCode"    column="module_code"    />
        <result property="spareField2"    column="spare_field2"    />
        <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="state"    column="state"    />
        <result property="paramName"    column="param_name"    />
        <result property="unit"    column="unit"    />
        <result property="type"    column="type"    />
        <result property="parameterSetCode"    column="parameter_set_code"    />
        <result property="parameterSetName"    column="parameter_set_name"    />
        <result property="processesCode"    column="processes_code"    />
        <result property="processesName"    column="processes_name"    />
    </resultMap>
 
    <sql id="selectDaParamCollectionTempVo">
        select id, work_order_no, sfc_code, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, module_code, spare_field2, create_user, create_time, update_user, update_time, state, param_name, unit, type, parameter_set_code, parameter_set_name, processes_code, processes_name from da_param_collection_temp
    </sql>
 
    <select id="selectDaParamCollectionTempList" parameterType="DaParamCollectionTemp" resultMap="DaParamCollectionTempResult">
        <include refid="selectDaParamCollectionTempVo"/>
        <where>  
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
            <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
            <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
            <if test="paramValue != null  and paramValue != ''"> and param_value = #{paramValue}</if>
            <if test="paramUpper != null  and paramUpper != ''"> and param_upper = #{paramUpper}</if>
            <if test="paramLower != null  and paramLower != ''"> and param_lower = #{paramLower}</if>
            <if test="paramStandard != null  and paramStandard != ''"> and param_standard = #{paramStandard}</if>
            <if test="collectionTime != null  and collectionTime != ''"> and collection_time = #{collectionTime}</if>
            <if test="moduleCode != null  and moduleCode != ''"> and module_code = #{moduleCode}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field2 = #{spareField2}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="paramName != null  and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
            <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="parameterSetCode != null  and parameterSetCode != ''"> and parameter_set_code = #{parameterSetCode}</if>
            <if test="parameterSetName != null  and parameterSetName != ''"> and parameter_set_name like concat('%', #{parameterSetName}, '%')</if>
            <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
            <if test="processesName != null  and processesName != ''"> and processes_name like concat('%', #{processesName}, '%')</if>
        </where>
    </select>
    
    <select id="selectDaParamCollectionTempById" parameterType="Long" resultMap="DaParamCollectionTempResult">
        <include refid="selectDaParamCollectionTempVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertDaParamCollectionTemp" parameterType="DaParamCollectionTemp" useGeneratedKeys="true" keyProperty="id">
        insert into da_param_collection_temp
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="workOrderNo != null">work_order_no,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="productCode != null">product_code,</if>
            <if test="productionLine != null">production_line,</if>
            <if test="locationCode != null">location_code,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="paramCode != null">param_code,</if>
            <if test="paramValue != null">param_value,</if>
            <if test="paramUpper != null">param_upper,</if>
            <if test="paramLower != null">param_lower,</if>
            <if test="paramStandard != null">param_standard,</if>
            <if test="collectionTime != null">collection_time,</if>
            <if test="moduleCode != null">module_code,</if>
            <if test="spareField2 != null">spare_field2,</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="state != null">state,</if>
            <if test="paramName != null">param_name,</if>
            <if test="unit != null">unit,</if>
            <if test="type != null">type,</if>
            <if test="parameterSetCode != null">parameter_set_code,</if>
            <if test="parameterSetName != null">parameter_set_name,</if>
            <if test="processesCode != null">processes_code,</if>
            <if test="processesName != null">processes_name,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="workOrderNo != null">#{workOrderNo},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="productCode != null">#{productCode},</if>
            <if test="productionLine != null">#{productionLine},</if>
            <if test="locationCode != null">#{locationCode},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="paramCode != null">#{paramCode},</if>
            <if test="paramValue != null">#{paramValue},</if>
            <if test="paramUpper != null">#{paramUpper},</if>
            <if test="paramLower != null">#{paramLower},</if>
            <if test="paramStandard != null">#{paramStandard},</if>
            <if test="collectionTime != null">#{collectionTime},</if>
            <if test="moduleCode != null">#{moduleCode},</if>
            <if test="spareField2 != null">#{spareField2},</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="state != null">#{state},</if>
            <if test="paramName != null">#{paramName},</if>
            <if test="unit != null">#{unit},</if>
            <if test="type != null">#{type},</if>
            <if test="parameterSetCode != null">#{parameterSetCode},</if>
            <if test="parameterSetName != null">#{parameterSetName},</if>
            <if test="processesCode != null">#{processesCode},</if>
            <if test="processesName != null">#{processesName},</if>
         </trim>
    </insert>
 
    <update id="updateDaParamCollectionTemp" parameterType="DaParamCollectionTemp">
        update da_param_collection_temp
        <trim prefix="SET" suffixOverrides=",">
            <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
            <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
            <if test="productCode != null">product_code = #{productCode},</if>
            <if test="productionLine != null">production_line = #{productionLine},</if>
            <if test="locationCode != null">location_code = #{locationCode},</if>
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="paramCode != null">param_code = #{paramCode},</if>
            <if test="paramValue != null">param_value = #{paramValue},</if>
            <if test="paramUpper != null">param_upper = #{paramUpper},</if>
            <if test="paramLower != null">param_lower = #{paramLower},</if>
            <if test="paramStandard != null">param_standard = #{paramStandard},</if>
            <if test="collectionTime != null">collection_time = #{collectionTime},</if>
            <if test="moduleCode != null">module_code = #{moduleCode},</if>
            <if test="spareField2 != null">spare_field2 = #{spareField2},</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="state != null">state = #{state},</if>
            <if test="paramName != null">param_name = #{paramName},</if>
            <if test="unit != null">unit = #{unit},</if>
            <if test="type != null">type = #{type},</if>
            <if test="parameterSetCode != null">parameter_set_code = #{parameterSetCode},</if>
            <if test="parameterSetName != null">parameter_set_name = #{parameterSetName},</if>
            <if test="processesCode != null">processes_code = #{processesCode},</if>
            <if test="processesName != null">processes_name = #{processesName},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaParamCollectionTempById" parameterType="Long">
        delete from da_param_collection_temp where id = #{id}
    </delete>
 
    <delete id="deleteDaParamCollectionTempBySfcCodeAndLocationCode" parameterType="DaParamCollectionTemp">
        delete from da_param_collection_temp where sfc_code = #{sfcCode} and location_code = #{locationCode}
    </delete>
 
    <delete id="deleteDaParamCollectionTempByIds" parameterType="String">
        delete from da_param_collection_temp where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>