admin
2024-08-04 bf64f645a709f2155085b438b6846ec03ccba163
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
<?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.psConf.mapper.DaPsConfMapper">
    
    <resultMap type="DaPsConf" id="DaPsConfResult">
        <result property="id"    column="id"    />
        <result property="mfCode"    column="mf_code"    />
        <result property="proTypeCode"    column="pro_type_code"    />
        <result property="batteryTypeCode"    column="battery_type_code"    />
        <result property="specificationsCode"    column="specifications_code"    />
        <result property="traceInfoCode"    column="trace_info_code"    />
        <result property="proDateCode"    column="pro_date_code"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="state"    column="state"    />
        <result property="remarks"    column="remarks"    />
        <result property="spareField1"    column="spare_field1"    />
        <result property="spareField2"    column="spare_field2"    />
        <result property="createUser"    column="create_user"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateUser"    column="update_user"    />
        <result property="updateTime"    column="update_time"    />
    </resultMap>
 
    <sql id="selectDaPsConfVo">
        select id, mf_code, pro_type_code, battery_type_code, specifications_code, trace_info_code, pro_date_code, sfc_code, state, remarks, spare_field1, spare_field2, create_user, create_time, update_user, update_time from da_ps_conf
    </sql>
 
    <select id="selectDaPsConfList" parameterType="DaPsConf" resultMap="DaPsConfResult">
        <include refid="selectDaPsConfVo"/>
        <where>  
            <if test="mfCode != null  and mfCode != ''"> and mf_code = #{mfCode}</if>
            <if test="proTypeCode != null  and proTypeCode != ''"> and pro_type_code = #{proTypeCode}</if>
            <if test="batteryTypeCode != null  and batteryTypeCode != ''"> and battery_type_code = #{batteryTypeCode}</if>
            <if test="specificationsCode != null  and specificationsCode != ''"> and specifications_code = #{specificationsCode}</if>
            <if test="traceInfoCode != null  and traceInfoCode != ''"> and trace_info_code = #{traceInfoCode}</if>
            <if test="proDateCode != null  and proDateCode != ''"> and pro_date_code = #{proDateCode}</if>
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="state != null  and state != ''"> and state = #{state}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field2 = #{spareField2}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
        </where>
    </select>
    
    <select id="selectDaPsConfById" parameterType="Long" resultMap="DaPsConfResult">
        <include refid="selectDaPsConfVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertDaPsConf" parameterType="DaPsConf" useGeneratedKeys="true" keyProperty="id">
        insert into da_ps_conf
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="mfCode != null">mf_code,</if>
            <if test="proTypeCode != null">pro_type_code,</if>
            <if test="batteryTypeCode != null">battery_type_code,</if>
            <if test="specificationsCode != null">specifications_code,</if>
            <if test="traceInfoCode != null">trace_info_code,</if>
            <if test="proDateCode != null">pro_date_code,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="state != null">state,</if>
            <if test="remarks != null">remarks,</if>
            <if test="spareField1 != null">spare_field1,</if>
            <if test="spareField2 != null">spare_field2,</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>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="mfCode != null">#{mfCode},</if>
            <if test="proTypeCode != null">#{proTypeCode},</if>
            <if test="batteryTypeCode != null">#{batteryTypeCode},</if>
            <if test="specificationsCode != null">#{specificationsCode},</if>
            <if test="traceInfoCode != null">#{traceInfoCode},</if>
            <if test="proDateCode != null">#{proDateCode},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="state != null">#{state},</if>
            <if test="remarks != null">#{remarks},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</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>
         </trim>
    </insert>
 
    <update id="updateDaPsConf" parameterType="DaPsConf">
        update da_ps_conf
        <trim prefix="SET" suffixOverrides=",">
            <if test="mfCode != null">mf_code = #{mfCode},</if>
            <if test="proTypeCode != null">pro_type_code = #{proTypeCode},</if>
            <if test="batteryTypeCode != null">battery_type_code = #{batteryTypeCode},</if>
            <if test="specificationsCode != null">specifications_code = #{specificationsCode},</if>
            <if test="traceInfoCode != null">trace_info_code = #{traceInfoCode},</if>
            <if test="proDateCode != null">pro_date_code = #{proDateCode},</if>
            <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
            <if test="state != null">state = #{state},</if>
            <if test="remarks != null">remarks = #{remarks},</if>
            <if test="spareField1 != null">spare_field1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field2 = #{spareField2},</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>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaPsConfById" parameterType="Long">
        delete from da_ps_conf where id = #{id}
    </delete>
 
    <delete id="deleteDaPsConfByIds" parameterType="String">
        delete from da_ps_conf where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>