春风项目四线(合箱线、总装线)
yyt
2024-05-06 bbc5784cc34d65e64d639d949e75b978fe07bdb3
提交 | 用户 | 时间
fd2207 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.om.workReport.mapper.OmWorkReportMapper">
6     
7     <resultMap type="OmWorkReport" id="OmWorkReportResult">
8         <result property="id"    column="id"    />
9         <result property="workOrderCode"    column="work_order_code"    />
10         <result property="sfcCode"    column="sfc_code"    />
11         <result property="productCode"    column="product_code"    />
12         <result property="productName"    column="product_name"    />
13         <result property="upTime"    column="up_time"    />
14         <result property="offlineTime"    column="offline_time"    />
15         <result property="status"    column="status"    />
16         <result property="createUser"    column="create_user"    />
17         <result property="createTime"    column="create_time"    />
18         <result property="updateUser"    column="update_user"    />
19         <result property="updateTime"    column="update_time"    />
20         <result property="remark"    column="remark"    />
21         <result property="spareField1"    column="spare_field_1"    />
22         <result property="spareField2"    column="spare_field_2"    />
23         <result property="spareField3"    column="spare_field_3"    />
24         <result property="spareField4"    column="spare_field_4"    />
25     </resultMap>
26
27     <sql id="selectOmWorkReportVo">
28         select id, work_order_code, sfc_code, product_code, product_name, up_time, offline_time, status, create_user, create_time, update_user, update_time, remark, spare_field_1, spare_field_2, spare_field_3, spare_field_4 from om_work_report
29     </sql>
30
31     <select id="selectOmWorkReportList" parameterType="OmWorkReport" resultMap="OmWorkReportResult">
32         <include refid="selectOmWorkReportVo"/>
33         <where>  
34             <if test="workOrderCode != null  and workOrderCode != ''"> and work_order_code = #{workOrderCode}</if>
35             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
36             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
37             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
38             <if test="upTime != null  and upTime != ''"> and up_time = #{upTime}</if>
39             <if test="offlineTime != null  and offlineTime != ''"> and offline_time = #{offlineTime}</if>
40             <if test="status != null  and status != ''"> and status = #{status}</if>
41             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
42             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
43             <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
44             <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
45             <if test="spareField3 != null  and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
46             <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
47         </where>
48     </select>
49     
50     <select id="selectOmWorkReportById" parameterType="Long" resultMap="OmWorkReportResult">
51         <include refid="selectOmWorkReportVo"/>
52         where id = #{id}
53     </select>
54         
55     <insert id="insertOmWorkReport" parameterType="OmWorkReport" useGeneratedKeys="true" keyProperty="id">
56         insert into om_work_report
57         <trim prefix="(" suffix=")" suffixOverrides=",">
58             <if test="workOrderCode != null">work_order_code,</if>
59             <if test="sfcCode != null">sfc_code,</if>
60             <if test="productCode != null">product_code,</if>
61             <if test="productName != null">product_name,</if>
62             <if test="upTime != null">up_time,</if>
63             <if test="offlineTime != null">offline_time,</if>
64             <if test="status != null">status,</if>
65             <if test="createUser != null">create_user,</if>
66             <if test="createTime != null">create_time,</if>
67             <if test="updateUser != null">update_user,</if>
68             <if test="updateTime != null">update_time,</if>
69             <if test="remark != null">remark,</if>
70             <if test="spareField1 != null">spare_field_1,</if>
71             <if test="spareField2 != null">spare_field_2,</if>
72             <if test="spareField3 != null">spare_field_3,</if>
73             <if test="spareField4 != null">spare_field_4,</if>
74          </trim>
75         <trim prefix="values (" suffix=")" suffixOverrides=",">
76             <if test="workOrderCode != null">#{workOrderCode},</if>
77             <if test="sfcCode != null">#{sfcCode},</if>
78             <if test="productCode != null">#{productCode},</if>
79             <if test="productName != null">#{productName},</if>
80             <if test="upTime != null">#{upTime},</if>
81             <if test="offlineTime != null">#{offlineTime},</if>
82             <if test="status != null">#{status},</if>
83             <if test="createUser != null">#{createUser},</if>
84             <if test="createTime != null">#{createTime},</if>
85             <if test="updateUser != null">#{updateUser},</if>
86             <if test="updateTime != null">#{updateTime},</if>
87             <if test="remark != null">#{remark},</if>
88             <if test="spareField1 != null">#{spareField1},</if>
89             <if test="spareField2 != null">#{spareField2},</if>
90             <if test="spareField3 != null">#{spareField3},</if>
91             <if test="spareField4 != null">#{spareField4},</if>
92          </trim>
93     </insert>
94
95     <update id="updateOmWorkReport" parameterType="OmWorkReport">
96         update om_work_report
97         <trim prefix="SET" suffixOverrides=",">
98             <if test="workOrderCode != null">work_order_code = #{workOrderCode},</if>
99             <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
100             <if test="productCode != null">product_code = #{productCode},</if>
101             <if test="productName != null">product_name = #{productName},</if>
102             <if test="upTime != null">up_time = #{upTime},</if>
103             <if test="offlineTime != null">offline_time = #{offlineTime},</if>
104             <if test="status != null">status = #{status},</if>
105             <if test="createUser != null">create_user = #{createUser},</if>
106             <if test="createTime != null">create_time = #{createTime},</if>
107             <if test="updateUser != null">update_user = #{updateUser},</if>
108             <if test="updateTime != null">update_time = #{updateTime},</if>
109             <if test="remark != null">remark = #{remark},</if>
110             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
111             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
112             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
113             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
114         </trim>
115         where id = #{id}
116     </update>
117
118     <delete id="deleteOmWorkReportById" parameterType="Long">
119         delete from om_work_report where id = #{id}
120     </delete>
121
122     <delete id="deleteOmWorkReportByIds" parameterType="String">
123         delete from om_work_report where id in 
124         <foreach item="id" collection="array" open="(" separator="," close=")">
125             #{id}
126         </foreach>
127     </delete>
128 </mapper>