hdy
2024-01-08 60ebb5f4610ce79742a3781c71f7eda4043b7fac
提交 | 用户 | 时间
94f7fb 1 <?xml version="1.0" encoding="UTF-8" ?>
YY 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.paramCollection.mapper.DaParamCollectionMapper">
6     
7     <resultMap type="DaParamCollection" id="DaParamCollectionResult">
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="spareField1"    column="spare_field_1"    />
22         <result property="spareField2"    column="spare_field_2"    />
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"    />
c96526 31         <result property="parameterSetCode"    column="parameter_set_code"    />
H 32         <result property="parameterSetName"    column="parameter_set_name"    />
33         <result property="processesCode"    column="processes_code"    />
34         <result property="processesName"    column="processes_name"    />
35
94f7fb 36     </resultMap>
YY 37
38     <sql id="selectDaParamCollectionVo">
c96526 39         select id, work_order_no, sfc_code,processes_name,processes_code, parameter_set_code ,parameter_set_name, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, state, param_name, unit, type from da_param_collection
94f7fb 40     </sql>
YY 41
42     <select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
43         <include refid="selectDaParamCollectionVo"/>
44         <where>  
45             <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
46             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
47             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
c96526 48             <if test="parameterSetCode != null  and parameterSetCode != ''"> and parameter_set_code = #{parameterSetCode}</if>
H 49             <if test="parameterSetName != null  and parameterSetName != ''"> and parameter_set_name = #{parameterSetName}</if>
50             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
51             <if test="processesName != null  and processesName != ''"> and processes_name = #{processesName}</if>
94f7fb 52             <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
YY 53             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
54             <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
55             <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
56         </where>
57     </select>
58     
59     <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
60         <include refid="selectDaParamCollectionVo"/>
61         where id = #{id}
62     </select>
63         
64     <insert id="insertDaParamCollection" parameterType="DaParamCollection">
65         insert into da_param_collection
66         <trim prefix="(" suffix=")" suffixOverrides=",">
67             <if test="id != null">id,</if>
68             <if test="workOrderNo != null and workOrderNo != ''">work_order_no,</if>
69             <if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
70             <if test="productCode != null and productCode != ''">product_code,</if>
71             <if test="productionLine != null and productionLine != ''">production_line,</if>
72             <if test="locationCode != null and locationCode != ''">location_code,</if>
c96526 73             <if test="parameterSetCode != null and parameterSetCode != ''">parameter_set_code,</if>
H 74             <if test="parameterSetName != null and parameterSetName != ''">parameter_set_name,</if>
75             <if test="processesCode != null and processesCode != ''">processes_code,</if>
76             <if test="processesName != null and processesName != ''">processes_name,</if>
94f7fb 77             <if test="equipmentNo != null">equipment_no,</if>
YY 78             <if test="paramCode != null and paramCode != ''">param_code,</if>
79             <if test="paramValue != null and paramValue != ''">param_value,</if>
80             <if test="paramUpper != null">param_upper,</if>
81             <if test="paramLower != null">param_lower,</if>
82             <if test="paramStandard != null">param_standard,</if>
83             <if test="collectionTime != null">collection_time,</if>
84             <if test="spareField1 != null">spare_field_1,</if>
85             <if test="spareField2 != null">spare_field_2,</if>
86             <if test="createUser != null">create_user,</if>
87             <if test="createTime != null">create_time,</if>
88             <if test="updateUser != null">update_user,</if>
89             <if test="updateTime != null">update_time,</if>
90             <if test="state != null">state,</if>
91             <if test="paramName != null">param_name,</if>
92             <if test="unit != null">unit,</if>
93             <if test="type != null">type,</if>
94          </trim>
95         <trim prefix="values (" suffix=")" suffixOverrides=",">
96             <if test="id != null">#{id},</if>
97             <if test="workOrderNo != null and workOrderNo != ''">#{workOrderNo},</if>
98             <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
99             <if test="productCode != null and productCode != ''">#{productCode},</if>
100             <if test="productionLine != null and productionLine != ''">#{productionLine},</if>
101             <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
c96526 102             <if test="parameterSetCode != null and parameterSetCode != ''">#{parameter_set_code},</if>
H 103             <if test="parameterSetName != null and parameterSetName != ''">#{parameter_set_name},</if>
104             <if test="processesCode != null and processesCode != ''">#{processes_code},</if>
105             <if test="processesName != null and processesName != ''">#{processes_name},</if>
94f7fb 106             <if test="equipmentNo != null">#{equipmentNo},</if>
YY 107             <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
108             <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
109             <if test="paramUpper != null">#{paramUpper},</if>
110             <if test="paramLower != null">#{paramLower},</if>
111             <if test="paramStandard != null">#{paramStandard},</if>
112             <if test="collectionTime != null">#{collectionTime},</if>
113             <if test="spareField1 != null">#{spareField1},</if>
114             <if test="spareField2 != null">#{spareField2},</if>
115             <if test="createUser != null">#{createUser},</if>
116             <if test="createTime != null">#{createTime},</if>
117             <if test="updateUser != null">#{updateUser},</if>
118             <if test="updateTime != null">#{updateTime},</if>
119             <if test="state != null">#{state},</if>
120             <if test="paramName != null">#{paramName},</if>
121             <if test="unit != null">#{unit},</if>
122             <if test="type != null">#{type},</if>
123          </trim>
124     </insert>
125
126     <update id="updateDaParamCollection" parameterType="DaParamCollection">
127         update da_param_collection
128         <trim prefix="SET" suffixOverrides=",">
129             <if test="workOrderNo != null and workOrderNo != ''">work_order_no = #{workOrderNo},</if>
130             <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
131             <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
132             <if test="productionLine != null and productionLine != ''">production_line = #{productionLine},</if>
133             <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
c96526 134             <if test="parameterSetCode != null and parameterSetCode != ''">parameter_set_code = #{parameterSetCode},</if>
H 135             <if test="parameterSetName != null and parameterSetName != ''">parameter_set_name = #{parameterSetName},</if>
136             <if test="processesCode != null and processesCode != ''">processes_code = #{processesCode},</if>
137             <if test="processesName != null and processesName != ''">processes_name = #{processesName},</if>
94f7fb 138             <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
YY 139             <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
140             <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
141             <if test="paramUpper != null">param_upper = #{paramUpper},</if>
142             <if test="paramLower != null">param_lower = #{paramLower},</if>
143             <if test="paramStandard != null">param_standard = #{paramStandard},</if>
144             <if test="collectionTime != null">collection_time = #{collectionTime},</if>
145             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
146             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
147             <if test="createUser != null">create_user = #{createUser},</if>
148             <if test="createTime != null">create_time = #{createTime},</if>
149             <if test="updateUser != null">update_user = #{updateUser},</if>
150             <if test="updateTime != null">update_time = #{updateTime},</if>
151             <if test="state != null">state = #{state},</if>
152             <if test="paramName != null">param_name = #{paramName},</if>
153             <if test="unit != null">unit = #{unit},</if>
154             <if test="type != null">type = #{type},</if>
155         </trim>
156         where id = #{id}
157     </update>
158
159     <delete id="deleteDaParamCollectionById" parameterType="Long">
160         delete from da_param_collection where id = #{id}
161     </delete>
162
163     <delete id="deleteDaParamCollectionByIds" parameterType="String">
164         delete from da_param_collection where id in 
165         <foreach item="id" collection="array" open="(" separator="," close=")">
166             #{id}
167         </foreach>
168     </delete>
169 </mapper>