春风项目四线(合箱线、总装线)
yyt
2024-05-22 696fd55ecc1243bce1d421d95cb9fba4b0a598b1
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
159
160
<?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.paramCollection.mapper.DaParamCollectionMapper">
    
    <resultMap type="DaParamCollection" id="DaParamCollectionResult">
        <result property="id"    column="id"    />
        <result property="workOrderNo"    column="work_order_no"    />
        <result property="sfcCode"    column="sfc_code"    />
        <result property="productCode"    column="product_code"    />
        <result property="productionLine"    column="production_line"    />
        <result property="locationCode"    column="location_code"    />
        <result property="equipmentNo"    column="equipment_no"    />
        <result property="paramCode"    column="param_code"    />
        <result property="paramValue"    column="param_value"    />
        <result property="paramUpper"    column="param_upper"    />
        <result property="paramLower"    column="param_lower"    />
        <result property="paramStandard"    column="param_standard"    />
        <result property="collectionTime"    column="collection_time"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <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="state"    column="state"    />
        <result property="paramName"    column="param_name"    />
        <result property="unit"    column="unit"    />
        <result property="type"    column="type"    />
        <result property="repairFlag"    column="repair_flag"    />
    </resultMap>
 
    <sql id="selectDaParamCollectionVo">
        select id, work_order_no, sfc_code, product_code, production_line, location_code, equipment_no, param_code, param_value, param_upper, param_lower, param_standard, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, state, param_name, unit, type, repair_flag from da_param_collection
    </sql>
 
    <select id="selectDaParamCollectionList" parameterType="DaParamCollection" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        <where>  
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
            <if test="type != null  and type != ''"> and type = #{type}</if>
            <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
            <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
            <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
            <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
            <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</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="dateConditions != null  and dateConditions != ''"> and collection_time BETWEEN #{startTime} AND #{endTime}</if>
        </where>
        ORDER BY id DESC
    </select>
    
    <select id="selectDaParamCollectionById" parameterType="Long" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        where id = #{id}
    </select>
    <select id="getListBySfcCode" resultMap="DaParamCollectionResult">
        <include refid="selectDaParamCollectionVo"/>
        where sfc_code in
        <foreach collection="engineNoList" open="(" close=")" item="code" separator=",">
            #{code}
        </foreach>
    </select>
 
    <insert id="insertDaParamCollection" parameterType="DaParamCollection">
        insert into da_param_collection
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="workOrderNo != null and workOrderNo != ''">work_order_no,</if>
            <if test="sfcCode != null and sfcCode != ''">sfc_code,</if>
            <if test="productCode != null and productCode != ''">product_code,</if>
            <if test="productionLine != null and productionLine != ''">production_line,</if>
            <if test="locationCode != null and locationCode != ''">location_code,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="paramCode != null and paramCode != ''">param_code,</if>
            <if test="paramValue != null and paramValue != ''">param_value,</if>
            <if test="paramUpper != null">param_upper,</if>
            <if test="paramLower != null">param_lower,</if>
            <if test="paramStandard != null">param_standard,</if>
            <if test="collectionTime != null">collection_time,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</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="state != null">state,</if>
            <if test="paramName != null">param_name,</if>
            <if test="unit != null">unit,</if>
            <if test="type != null">type,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="workOrderNo != null and workOrderNo != ''">#{workOrderNo},</if>
            <if test="sfcCode != null and sfcCode != ''">#{sfcCode},</if>
            <if test="productCode != null and productCode != ''">#{productCode},</if>
            <if test="productionLine != null and productionLine != ''">#{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">#{locationCode},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">#{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">#{paramValue},</if>
            <if test="paramUpper != null">#{paramUpper},</if>
            <if test="paramLower != null">#{paramLower},</if>
            <if test="paramStandard != null">#{paramStandard},</if>
            <if test="collectionTime != null">#{collectionTime},</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>
            <if test="state != null">#{state},</if>
            <if test="paramName != null">#{paramName},</if>
            <if test="unit != null">#{unit},</if>
            <if test="type != null">#{type},</if>
         </trim>
    </insert>
 
    <update id="updateDaParamCollection" parameterType="DaParamCollection">
        update da_param_collection
        <trim prefix="SET" suffixOverrides=",">
            <if test="workOrderNo != null and workOrderNo != ''">work_order_no = #{workOrderNo},</if>
            <if test="sfcCode != null and sfcCode != ''">sfc_code = #{sfcCode},</if>
            <if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
            <if test="productionLine != null and productionLine != ''">production_line = #{productionLine},</if>
            <if test="locationCode != null and locationCode != ''">location_code = #{locationCode},</if>
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="paramCode != null and paramCode != ''">param_code = #{paramCode},</if>
            <if test="paramValue != null and paramValue != ''">param_value = #{paramValue},</if>
            <if test="paramUpper != null">param_upper = #{paramUpper},</if>
            <if test="paramLower != null">param_lower = #{paramLower},</if>
            <if test="paramStandard != null">param_standard = #{paramStandard},</if>
            <if test="collectionTime != null">collection_time = #{collectionTime},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{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>
            <if test="state != null">state = #{state},</if>
            <if test="paramName != null">param_name = #{paramName},</if>
            <if test="unit != null">unit = #{unit},</if>
            <if test="type != null">type = #{type},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaParamCollectionById" parameterType="Long">
        delete from da_param_collection where id = #{id}
    </delete>
 
    <delete id="deleteDaParamCollectionByIds" parameterType="String">
        delete from da_param_collection where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
</mapper>