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