cl
2024-09-06 e0391b17f64e4c79f7b1d4ffa2963772c2ebed52
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
<?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.cellData.mapper.DaCellDataMapper">
    
    <resultMap type="DaCellData" id="DaCellDataResult">
        <result property="id"    column="id"    />
        <result property="serviceId"    column="service_id"    />
        <result property="siteCode"    column="site_code"    />
        <result property="moduleSerial"    column="module_serial"    />
        <result property="moduleModel"    column="module_model"    />
        <result property="ABModule"    column="ab_module"    />
        <result property="packageNo"    column="package_no"    />
        <result property="supplierModuleBarcode"    column="supplier_module_barcode"    />
        <result property="customerModuleBarcode"    column="customer_module_barcode"    />
        <result property="cellSerial"    column="cell_serial"    />
        <result property="cellModel"    column="cell_model"    />
        <result property="gbModuleCode"    column="gb_Module_code"    />
        <result property="gbCellCode"    column="gb_cell_code"    />
        <result property="cellItem"    column="cell_item"    />
        <result property="cellValue"    column="cell_value"    />
        <result property="createTime"    column="create_time"    />
        <result property="createUser"    column="create_user"    />
        <result property="spareField1"    column="spare_field1"    />
        <result property="spareField2"    column="spare_field2"    />
        <result property="spareField3"    column="spare_field3"    />
        <result property="spareField4"    column="spare_field4"    />
    </resultMap>
 
    <sql id="selectDaCellDataVo">
        select id, service_id, site_code, module_serial, module_model, ab_module, package_no, supplier_module_barcode, customer_module_barcode, cell_serial, cell_model, gb_Module_code, gb_cell_code, cell_item, cell_value, create_time, create_user, spare_field1, spare_field2, spare_field3, spare_field4 from da_cell_data
    </sql>
 
    <select id="selectDaCellDataList" parameterType="DaCellData" resultMap="DaCellDataResult">
        <include refid="selectDaCellDataVo"/>
        <where>  
            <if test="serviceId != null  and serviceId != ''"> and service_id = #{serviceId}</if>
            <if test="siteCode != null  and siteCode != ''"> and site_code = #{siteCode}</if>
            <if test="moduleSerial != null  and moduleSerial != ''"> and module_serial = #{moduleSerial}</if>
            <if test="moduleModel != null  and moduleModel != ''"> and module_model = #{moduleModel}</if>
            <if test="ABModule != null  and ABModule != ''"> and ABModule = #{ABModule}</if>
            <if test="packageNo != null  and packageNo != ''"> and package_no = #{packageNo}</if>
            <if test="supplierModuleBarcode != null  and supplierModuleBarcode != ''"> and supplier_module_barcode = #{supplierModuleBarcode}</if>
            <if test="customerModuleBarcode != null  and customerModuleBarcode != ''"> and customer_module_barcode = #{customerModuleBarcode}</if>
            <if test="cellSerial != null  and cellSerial != ''"> and cell_serial = #{cellSerial}</if>
            <if test="cellModel != null  and cellModel != ''"> and cell_model = #{cellModel}</if>
            <if test="cellItem != null  and cellItem != ''"> and cell_item = #{cellItem}</if>
            <if test="cellValue != null  and cellValue != ''"> and cell_value = #{cellValue}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</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="spareField3 != null  and spareField3 != ''"> and spare_field3 = #{spareField3}</if>
            <if test="spareField4 != null  and spareField4 != ''"> and spare_field4 = #{spareField4}</if>
        </where>
    </select>
    
    <select id="selectDaCellDataById" parameterType="Long" resultMap="DaCellDataResult">
        <include refid="selectDaCellDataVo"/>
        where id = #{id}
    </select>
        
    <insert id="insertDaCellData" parameterType="DaCellData" useGeneratedKeys="true" keyProperty="id">
        insert into da_cell_data
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="serviceId != null">service_id,</if>
            <if test="siteCode != null">site_code,</if>
            <if test="moduleSerial != null">module_serial,</if>
            <if test="moduleModel != null">module_model,</if>
            <if test="ABModule != null">ABModule,</if>
            <if test="packageNo != null">package_no,</if>
            <if test="supplierModuleBarcode != null">supplier_module_barcode,</if>
            <if test="customerModuleBarcode != null">customer_module_barcode,</if>
            <if test="cellSerial != null">cell_serial,</if>
            <if test="cellModel != null">cell_model,</if>
            <if test="cellItem != null">cell_item,</if>
            <if test="cellValue != null">cell_value,</if>
            <if test="createTime != null">create_time,</if>
            <if test="createUser != null">create_user,</if>
            <if test="spareField1 != null">spare_field1,</if>
            <if test="spareField2 != null">spare_field2,</if>
            <if test="spareField3 != null">spare_field3,</if>
            <if test="spareField4 != null">spare_field4,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="serviceId != null">#{serviceId},</if>
            <if test="siteCode != null">#{siteCode},</if>
            <if test="moduleSerial != null">#{moduleSerial},</if>
            <if test="moduleModel != null">#{moduleModel},</if>
            <if test="ABModule != null">#{ABModule},</if>
            <if test="packageNo != null">#{packageNo},</if>
            <if test="supplierModuleBarcode != null">#{supplierModuleBarcode},</if>
            <if test="customerModuleBarcode != null">#{customerModuleBarcode},</if>
            <if test="cellSerial != null">#{cellSerial},</if>
            <if test="cellModel != null">#{cellModel},</if>
            <if test="cellItem != null">#{cellItem},</if>
            <if test="cellValue != null">#{cellValue},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="createUser != null">#{createUser},</if>
            <if test="spareField1 != null">#{spareField1},</if>
            <if test="spareField2 != null">#{spareField2},</if>
            <if test="spareField3 != null">#{spareField3},</if>
            <if test="spareField4 != null">#{spareField4},</if>
         </trim>
    </insert>
 
    <update id="updateDaCellData" parameterType="DaCellData">
        update da_cell_data
        <trim prefix="SET" suffixOverrides=",">
            <if test="serviceId != null">service_id = #{serviceId},</if>
            <if test="siteCode != null">site_code = #{siteCode},</if>
            <if test="moduleSerial != null">module_serial = #{moduleSerial},</if>
            <if test="moduleModel != null">module_model = #{moduleModel},</if>
            <if test="ABModule != null">ABModule = #{ABModule},</if>
            <if test="packageNo != null">package_no = #{packageNo},</if>
            <if test="supplierModuleBarcode != null">supplier_module_barcode = #{supplierModuleBarcode},</if>
            <if test="customerModuleBarcode != null">customer_module_barcode = #{customerModuleBarcode},</if>
            <if test="cellSerial != null">cell_serial = #{cellSerial},</if>
            <if test="cellModel != null">cell_model = #{cellModel},</if>
            <if test="cellItem != null">cell_item = #{cellItem},</if>
            <if test="cellValue != null">cell_value = #{cellValue},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="createUser != null">create_user = #{createUser},</if>
            <if test="spareField1 != null">spare_field1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field4 = #{spareField4},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaCellDataById" parameterType="Long">
        delete from da_cell_data where id = #{id}
    </delete>
 
    <delete id="deleteDaCellDataByIds" parameterType="String">
        delete from da_cell_data where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <delete id="deleteDaCellDataByGbCellCode" parameterType="String">
        DELETE
        FROM
            da_cell_data
        WHERE
            gb_cell_code = #{gbCellCode}
    </delete>
 
    <delete id="deleteDaCellDataByCellSerial" parameterType="String">
        DELETE
        FROM
            da_cell_data
        WHERE
            cell_serial = #{cellSerial}
    </delete>
</mapper>