-
懒羊羊
2024-04-12 d5d31b9096d6e50cdac2069426b19b4507a91237
提交 | 用户 | 时间
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.bs.processFile.mapper.BsProcessFileMapper">
6     
7     <resultMap type="BsProcessFile" id="BsProcessFileResult">
8         <result property="id"    column="id"    />
9         <result property="productCode"    column="product_code"    />
10         <result property="productName"    column="product_name"    />
11         <result property="processesCode"    column="processes_code"    />
12         <result property="processesName"    column="processes_name"    />
13         <result property="fileCode"    column="file_code"    />
14         <result property="fileName"    column="file_name"    />
15         <result property="fileAddress"    column="file_address"    />
16         <result property="status"    column="status"    />
17         <result property="createUser"    column="create_user"    />
18         <result property="createTime"    column="create_time"    />
19         <result property="updateUser"    column="update_user"    />
20         <result property="updateTime"    column="update_time"    />
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         <result property="remarks"    column="remarks"    />
26     </resultMap>
27
28     <sql id="selectBsProcessFileVo">
29         select id, product_code, product_name, processes_code, processes_name, file_code, file_name, file_address, status, create_user, create_time, update_user, update_time, spare_field_1, spare_field_2, spare_field_3, spare_field_4, remarks from bs_process_file
30     </sql>
31
32     <select id="selectBsProcessFileList" parameterType="BsProcessFile" resultMap="BsProcessFileResult">
33         <include refid="selectBsProcessFileVo"/>
34         <where>  
35             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
36             <if test="productName != null  and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
37             <if test="processesCode != null  and processesCode != ''"> and processes_code = #{processesCode}</if>
38             <if test="processesName != null  and processesName != ''"> and processes_name like concat('%', #{processesName}, '%')</if>
39             <if test="fileCode != null  and fileCode != ''"> and file_code = #{fileCode}</if>
40             <if test="fileName != null  and fileName != ''"> and file_name like concat('%', #{fileName}, '%')</if>
41             <if test="fileAddress != null  and fileAddress != ''"> and file_address = #{fileAddress}</if>
42             <if test="status != null  and status != ''"> and status = #{status}</if>
43             <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
44             <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
45             <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
46         </where>
47     </select>
48     
49     <select id="selectBsProcessFileById" parameterType="Long" resultMap="BsProcessFileResult">
50         <include refid="selectBsProcessFileVo"/>
51         where id = #{id}
52     </select>
53         
54     <insert id="insertBsProcessFile" parameterType="BsProcessFile" useGeneratedKeys="true" keyProperty="id">
55         insert into bs_process_file
56         <trim prefix="(" suffix=")" suffixOverrides=",">
57             <if test="productCode != null">product_code,</if>
58             <if test="productName != null">product_name,</if>
59             <if test="processesCode != null">processes_code,</if>
60             <if test="processesName != null">processes_name,</if>
61             <if test="fileCode != null">file_code,</if>
62             <if test="fileName != null">file_name,</if>
63             <if test="fileAddress != null">file_address,</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="spareField1 != null">spare_field_1,</if>
70             <if test="spareField2 != null">spare_field_2,</if>
71             <if test="spareField3 != null">spare_field_3,</if>
72             <if test="spareField4 != null">spare_field_4,</if>
73             <if test="remarks != null">remarks,</if>
74          </trim>
75         <trim prefix="values (" suffix=")" suffixOverrides=",">
76             <if test="productCode != null">#{productCode},</if>
77             <if test="productName != null">#{productName},</if>
78             <if test="processesCode != null">#{processesCode},</if>
79             <if test="processesName != null">#{processesName},</if>
80             <if test="fileCode != null">#{fileCode},</if>
81             <if test="fileName != null">#{fileName},</if>
82             <if test="fileAddress != null">#{fileAddress},</if>
83             <if test="status != null">#{status},</if>
84             <if test="createUser != null">#{createUser},</if>
85             <if test="createTime != null">#{createTime},</if>
86             <if test="updateUser != null">#{updateUser},</if>
87             <if test="updateTime != null">#{updateTime},</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             <if test="remarks != null">#{remarks},</if>
93          </trim>
94     </insert>
95
96     <update id="updateBsProcessFile" parameterType="BsProcessFile">
97         update bs_process_file
98         <trim prefix="SET" suffixOverrides=",">
99             <if test="productCode != null">product_code = #{productCode},</if>
100             <if test="productName != null">product_name = #{productName},</if>
101             <if test="processesCode != null">processes_code = #{processesCode},</if>
102             <if test="processesName != null">processes_name = #{processesName},</if>
103             <if test="fileCode != null">file_code = #{fileCode},</if>
104             <if test="fileName != null">file_name = #{fileName},</if>
105             <if test="fileAddress != null">file_address = #{fileAddress},</if>
106             <if test="status != null">status = #{status},</if>
107             <if test="createUser != null">create_user = #{createUser},</if>
108             <if test="createTime != null">create_time = #{createTime},</if>
109             <if test="updateUser != null">update_user = #{updateUser},</if>
110             <if test="updateTime != null">update_time = #{updateTime},</if>
111             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
112             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
113             <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
114             <if test="spareField4 != null">spare_field_4 = #{spareField4},</if>
115             <if test="remarks != null">remarks = #{remarks},</if>
116         </trim>
117         where id = #{id}
118     </update>
119
120     <delete id="deleteBsProcessFileById" parameterType="Long">
121         delete from bs_process_file where id = #{id}
122     </delete>
123
124     <delete id="deleteBsProcessFileByIds" parameterType="String">
125         delete from bs_process_file where id in 
126         <foreach item="id" collection="array" open="(" separator="," close=")">
127             #{id}
128         </foreach>
129     </delete>
130 </mapper>