春风项目四线(合箱线、总装线)
wujian
2024-04-27 cffac1169880b8c55aa64517fdcaad118a3a972e
提交 | 用户 | 时间
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.bs.workshop.mapper.BsWorkshopInfoMapper">
6     
7     <resultMap type="BsWorkshopInfo" id="BsWorkshopInfoResult">
8         <result property="id"    column="id"    />
9         <result property="workshopCode"    column="workshop_code"    />
10         <result property="workshopName"    column="workshop_name"    />
11         <result property="spareField1"    column="spare_field_1"    />
12         <result property="spareField2"    column="spare_field_2"    />
13         <result property="remarks"    column="remarks"    />
14         <result property="createUser"    column="create_user"    />
15         <result property="createTime"    column="create_time"    />
16         <result property="updateUser"    column="update_user"    />
17         <result property="updateTime"    column="update_time"    />
18         <result property="status"    column="status"    />
19     </resultMap>
20
21     <sql id="selectBsWorkshopInfoVo">
22         select id, workshop_code, workshop_name, spare_field_1, spare_field_2, remarks, create_user, create_time, update_user, update_time,status from bs_workshop_info
23     </sql>
24
25     <select id="selectBsWorkshopInfoList" parameterType="BsWorkshopInfo" resultMap="BsWorkshopInfoResult">
26         <include refid="selectBsWorkshopInfoVo"/>
27         <where>  
28             <if test="workshopCode != null  and workshopCode != ''"> and workshop_code like concat('%', #{workshopCode}, '%')</if>
29             <if test="workshopName != null  and workshopName != ''"> and workshop_name like concat('%', #{workshopName}, '%')</if>
30             <if test="remarks != null  and remarks != ''"> and remarks like concat('%', #{remarks}, '%')</if>
31             <if test="createUser != null  and createUser != ''"> and create_user like concat('%', #{createUser}, '%')</if>
32         </where>
33     </select>
34     
35     <select id="selectBsWorkshopInfoById" parameterType="Long" resultMap="BsWorkshopInfoResult">
36         <include refid="selectBsWorkshopInfoVo"/>
37         where id = #{id}
38     </select>
39         
40     <insert id="insertBsWorkshopInfo" parameterType="BsWorkshopInfo">
41         insert into bs_workshop_info
42         <trim prefix="(" suffix=")" suffixOverrides=",">
43             <if test="id != null">id,</if>
44             <if test="workshopCode != null">workshop_code,</if>
45             <if test="workshopName != null">workshop_name,</if>
46             <if test="spareField1 != null">spare_field_1,</if>
47             <if test="spareField2 != null">spare_field_2,</if>
48             <if test="remarks != null">remarks,</if>
49             <if test="createUser != null">create_user,</if>
50             <if test="createTime != null">create_time,</if>
51             <if test="updateUser != null">update_user,</if>
52             <if test="updateTime != null">update_time,</if>
53             <if test="status != null">status,</if>
54          </trim>
55         <trim prefix="values (" suffix=")" suffixOverrides=",">
56             <if test="id != null">#{id},</if>
57             <if test="workshopCode != null">#{workshopCode},</if>
58             <if test="workshopName != null">#{workshopName},</if>
59             <if test="spareField1 != null">#{spareField1},</if>
60             <if test="spareField2 != null">#{spareField2},</if>
61             <if test="remarks != null">#{remarks},</if>
62             <if test="createUser != null">#{createUser},</if>
63             <if test="createTime != null">#{createTime},</if>
64             <if test="updateUser != null">#{updateUser},</if>
65             <if test="updateTime != null">#{updateTime},</if>
66             <if test="status != null">#{status},</if>
67          </trim>
68     </insert>
69
70     <update id="updateBsWorkshopInfo" parameterType="BsWorkshopInfo">
71         update bs_workshop_info
72         <trim prefix="SET" suffixOverrides=",">
73             <if test="workshopCode != null">workshop_code = #{workshopCode},</if>
74             <if test="workshopName != null">workshop_name = #{workshopName},</if>
75             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
76             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
77             <if test="remarks != null">remarks = #{remarks},</if>
78             <if test="createUser != null">create_user = #{createUser},</if>
79             <if test="createTime != null">create_time = #{createTime},</if>
80             <if test="updateUser != null">update_user = #{updateUser},</if>
81             <if test="updateTime != null">update_time = #{updateTime},</if>
82             <if test="status != null">status = #{status},</if>
83         </trim>
84         where id = #{id}
85     </update>
86
87     <delete id="deleteBsWorkshopInfoById" parameterType="Long">
88         delete from bs_workshop_info where id = #{id}
89     </delete>
90
91     <delete id="deleteBsWorkshopInfoByIds" parameterType="String">
92         delete from bs_workshop_info where id in 
93         <foreach item="id" collection="array" open="(" separator="," close=")">
94             #{id}
95         </foreach>
96     </delete>
97 </mapper>