admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
c9c156 1 <?xml version="1.0" encoding="UTF-8" ?>
A 2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.main.da.paramCollectionTemp.mapper.DaParamCollectionTempMapper">
6     
7     <resultMap type="DaParamCollectionTemp" id="DaParamCollectionTempResult">
8         <result property="id"    column="id"    />
9         <result property="workOrderNo"    column="work_order_no"    />
10         <result property="sfcCode"    column="sfc_code"    />
11         <result property="productCode"    column="product_code"    />
12         <result property="productionLine"    column="production_line"    />
13         <result property="locationCode"    column="location_code"    />
14         <result property="equipmentNo"    column="equipment_no"    />
15         <result property="paramCode"    column="param_code"    />
16         <result property="paramValue"    column="param_value"    />
17         <result property="paramUpper"    column="param_upper"    />
18         <result property="paramLower"    column="param_lower"    />
19         <result property="paramStandard"    column="param_standard"    />
20         <result property="collectionTime"    column="collection_time"    />
21         <result property="moduleCode"    column="module_code"    />
22         <result property="spareField2"    column="spare_field2"    />
23         <result property="createUser"    column="create_user"    />
24         <result property="createTime"    column="create_time"    />
25         <result property="updateUser"    column="update_user"    />
26         <result property="updateTime"    column="update_time"    />
27         <result property="state"    column="state"    />
28         <result property="paramName"    column="param_name"    />
29         <result property="unit"    column="unit"    />
30         <result property="type"    column="type"    />
31         <result property="parameterSetCode"    column="parameter_set_code"    />
32         <result property="parameterSetName"    column="parameter_set_name"    />
33         <result property="processesCode"    column="processes_code"    />
34         <result property="processesName"    column="processes_name"    />
35     </resultMap>
36
37     <sql id="selectDaParamCollectionTempVo">
38         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
39     </sql>
40
41     <select id="selectDaParamCollectionTempList" parameterType="DaParamCollectionTemp" resultMap="DaParamCollectionTempResult">
42         <include refid="selectDaParamCollectionTempVo"/>
43         <where>  
44             <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
45             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
46             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
47             <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
48             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
49             <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
50             <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
51             <if test="paramValue != null  and paramValue != ''"> and param_value = #{paramValue}</if>
52             <if test="paramUpper != null  and paramUpper != ''"> and param_upper = #{paramUpper}</if>
53             <if test="paramLower != null  and paramLower != ''"> and param_lower = #{paramLower}</if>
54             <if test="paramStandard != null  and paramStandard != ''"> and param_standard = #{paramStandard}</if>
55             <if test="collectionTime != null  and collectionTime != ''"> and collection_time = #{collectionTime}</if>
56             <if test="moduleCode != null  and moduleCode != ''"> and module_code = #{moduleCode}</if>
57             <if test="spareField2 != null  and spareField2 != ''"> and spare_field2 = #{spareField2}</if>
58             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
59             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
60             <if test="state != null  and state != ''"> and state = #{state}</if>
61             <if test="paramName != null  and paramName != ''"> and param_name like concat('%', #{paramName}, '%')</if>
62             <if test="unit != null  and unit != ''"> and unit = #{unit}</if>
63             <if test="type != null  and type != ''"> and type = #{type}</if>
64             <if test="parameterSetCode != null  and parameterSetCode != ''"> and parameter_set_code = #{parameterSetCode}</if>
65             <if test="parameterSetName != null  and parameterSetName != ''"> and parameter_set_name like concat('%', #{parameterSetName}, '%')</if>
66             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
67             <if test="processesName != null  and processesName != ''"> and processes_name like concat('%', #{processesName}, '%')</if>
68         </where>
69     </select>
70     
71     <select id="selectDaParamCollectionTempById" parameterType="Long" resultMap="DaParamCollectionTempResult">
72         <include refid="selectDaParamCollectionTempVo"/>
73         where id = #{id}
74     </select>
75         
76     <insert id="insertDaParamCollectionTemp" parameterType="DaParamCollectionTemp" useGeneratedKeys="true" keyProperty="id">
77         insert into da_param_collection_temp
78         <trim prefix="(" suffix=")" suffixOverrides=",">
79             <if test="workOrderNo != null">work_order_no,</if>
80             <if test="sfcCode != null">sfc_code,</if>
81             <if test="productCode != null">product_code,</if>
82             <if test="productionLine != null">production_line,</if>
83             <if test="locationCode != null">location_code,</if>
84             <if test="equipmentNo != null">equipment_no,</if>
85             <if test="paramCode != null">param_code,</if>
86             <if test="paramValue != null">param_value,</if>
87             <if test="paramUpper != null">param_upper,</if>
88             <if test="paramLower != null">param_lower,</if>
89             <if test="paramStandard != null">param_standard,</if>
90             <if test="collectionTime != null">collection_time,</if>
91             <if test="moduleCode != null">module_code,</if>
92             <if test="spareField2 != null">spare_field2,</if>
93             <if test="createUser != null">create_user,</if>
94             <if test="createTime != null">create_time,</if>
95             <if test="updateUser != null">update_user,</if>
96             <if test="updateTime != null">update_time,</if>
97             <if test="state != null">state,</if>
98             <if test="paramName != null">param_name,</if>
99             <if test="unit != null">unit,</if>
100             <if test="type != null">type,</if>
101             <if test="parameterSetCode != null">parameter_set_code,</if>
102             <if test="parameterSetName != null">parameter_set_name,</if>
103             <if test="processesCode != null">processes_code,</if>
104             <if test="processesName != null">processes_name,</if>
105          </trim>
106         <trim prefix="values (" suffix=")" suffixOverrides=",">
107             <if test="workOrderNo != null">#{workOrderNo},</if>
108             <if test="sfcCode != null">#{sfcCode},</if>
109             <if test="productCode != null">#{productCode},</if>
110             <if test="productionLine != null">#{productionLine},</if>
111             <if test="locationCode != null">#{locationCode},</if>
112             <if test="equipmentNo != null">#{equipmentNo},</if>
113             <if test="paramCode != null">#{paramCode},</if>
114             <if test="paramValue != null">#{paramValue},</if>
115             <if test="paramUpper != null">#{paramUpper},</if>
116             <if test="paramLower != null">#{paramLower},</if>
117             <if test="paramStandard != null">#{paramStandard},</if>
118             <if test="collectionTime != null">#{collectionTime},</if>
119             <if test="moduleCode != null">#{moduleCode},</if>
120             <if test="spareField2 != null">#{spareField2},</if>
121             <if test="createUser != null">#{createUser},</if>
122             <if test="createTime != null">#{createTime},</if>
123             <if test="updateUser != null">#{updateUser},</if>
124             <if test="updateTime != null">#{updateTime},</if>
125             <if test="state != null">#{state},</if>
126             <if test="paramName != null">#{paramName},</if>
127             <if test="unit != null">#{unit},</if>
128             <if test="type != null">#{type},</if>
129             <if test="parameterSetCode != null">#{parameterSetCode},</if>
130             <if test="parameterSetName != null">#{parameterSetName},</if>
131             <if test="processesCode != null">#{processesCode},</if>
132             <if test="processesName != null">#{processesName},</if>
133          </trim>
134     </insert>
135
136     <update id="updateDaParamCollectionTemp" parameterType="DaParamCollectionTemp">
137         update da_param_collection_temp
138         <trim prefix="SET" suffixOverrides=",">
139             <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
140             <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
141             <if test="productCode != null">product_code = #{productCode},</if>
142             <if test="productionLine != null">production_line = #{productionLine},</if>
143             <if test="locationCode != null">location_code = #{locationCode},</if>
144             <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
145             <if test="paramCode != null">param_code = #{paramCode},</if>
146             <if test="paramValue != null">param_value = #{paramValue},</if>
147             <if test="paramUpper != null">param_upper = #{paramUpper},</if>
148             <if test="paramLower != null">param_lower = #{paramLower},</if>
149             <if test="paramStandard != null">param_standard = #{paramStandard},</if>
150             <if test="collectionTime != null">collection_time = #{collectionTime},</if>
151             <if test="moduleCode != null">module_code = #{moduleCode},</if>
152             <if test="spareField2 != null">spare_field2 = #{spareField2},</if>
153             <if test="createUser != null">create_user = #{createUser},</if>
154             <if test="createTime != null">create_time = #{createTime},</if>
155             <if test="updateUser != null">update_user = #{updateUser},</if>
156             <if test="updateTime != null">update_time = #{updateTime},</if>
157             <if test="state != null">state = #{state},</if>
158             <if test="paramName != null">param_name = #{paramName},</if>
159             <if test="unit != null">unit = #{unit},</if>
160             <if test="type != null">type = #{type},</if>
161             <if test="parameterSetCode != null">parameter_set_code = #{parameterSetCode},</if>
162             <if test="parameterSetName != null">parameter_set_name = #{parameterSetName},</if>
163             <if test="processesCode != null">processes_code = #{processesCode},</if>
164             <if test="processesName != null">processes_name = #{processesName},</if>
165         </trim>
166         where id = #{id}
167     </update>
168
169     <delete id="deleteDaParamCollectionTempById" parameterType="Long">
170         delete from da_param_collection_temp where id = #{id}
171     </delete>
172
2fbce7 173     <delete id="deleteDaParamCollectionTempBySfcCodeAndLocationCode" parameterType="DaParamCollectionTemp">
A 174         delete from da_param_collection_temp where sfc_code = #{sfcCode} and location_code = #{locationCode}
175     </delete>
176
c9c156 177     <delete id="deleteDaParamCollectionTempByIds" parameterType="String">
A 178         delete from da_param_collection_temp where id in 
179         <foreach item="id" collection="array" open="(" separator="," close=")">
180             #{id}
181         </foreach>
182     </delete>
183 </mapper>