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