春风项目四线(合箱线、总装线)
wujian
2024-07-26 778d3d8b387ca0a8d1b51ef68f783fb0b407ef20
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
<?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.da.tileMatchCollection.mapper.DaTileMatchCollectionMapper">
    
    <resultMap type="DaTileMatchCollection" id="DaTileMatchCollectionResult">
        <result property="id"    column="id"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="paramCode"    column="param_code"    />
        <result property="paramName"    column="param_name"    />
        <result property="createTime"    column="create_time"    />
        <result property="remarks"    column="remarks"    />
        <result property="locationCode"    column="location_code"    />
    </resultMap>
 
    <sql id="selectDaTileMatchCollectionVo">
        select id, sfc_code, param_code, param_name, create_time, remarks, location_code,param_value from da_tile_match_collection
    </sql>
 
    <select id="selectDaTileMatchCollectionList" parameterType="DaTileMatchCollection" resultMap="DaTileMatchCollectionResult">
        <include refid="selectDaTileMatchCollectionVo"/>
        <where>  
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="paramCode != null  and paramCode != ''"> and param_code = #{paramCode}</if>
            <if test="paramValue != null  and paramValue != ''"> and param_value = #{paramValue}</if>
            <if test="paramName != null  and paramName != ''"> and param_name like concat('%', #{paramValue}, '%')</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
        </where>
    </select>
    
    <select id="selectDaTileMatchCollectionById" parameterType="Long" resultMap="DaTileMatchCollectionResult">
        <include refid="selectDaTileMatchCollectionVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertDaTileMatchCollection" parameterType="DaTileMatchCollection">
        insert into da_tile_match_collection
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="paramCode != null">param_code,</if>
            <if test="paramName != null">param_name,</if>
            <if test="paramValue != null">param_value,</if>
            <if test="createTime != null">create_time,</if>
            <if test="remarks != null">remarks,</if>
            <if test="locationCode != null">location_code,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="paramCode != null">#{paramCode},</if>
            <if test="paramName != null">#{paramName},</if>
            <if test="paramValue != null">#{paramValue},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="locationCode != null">#{locationCode},</if>
         </trim>
    </insert>
 
    <update id="updateDaTileMatchCollection" parameterType="DaTileMatchCollection">
        update da_tile_match_collection
        <trim prefix="SET" suffixOverrides=",">
            <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
            <if test="paramCode != null">param_code = #{paramCode},</if>
            <if test="paramName != null">param_name = #{paramName},</if>
            <if test="paramValue != null">param_value = #{paramValue},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="locationCode != null">location_code = #{locationCode},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaTileMatchCollectionById" parameterType="Long">
        delete from da_tile_match_collection where id = #{id}
    </delete>
 
    <delete id="deleteDaTileMatchCollectionByIds" parameterType="String">
        delete from da_tile_match_collection where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>