yyt
6 天以前 0cceb649e1dc443c2a91d26d81eacb0867c96db3
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
161
162
<?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.passingStationCollection.mapper.DaPassingStationCollectionMapper">
    
    <resultMap type="DaPassingStationCollection" id="DaPassingStationCollectionResult">
        <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="inboundTime"    column="inbound_time"    />
        <result property="outboundTime"    column="outbound_time"    />
        <result property="inRsSign"    column="in_rs_sign"    />
        <result property="inMsgSign"    column="in_msg_sign"    />
        <result property="outRsSign"    column="out_rs_sign"    />
        <result property="outMsgSign"    column="out_msg_sign"    />
        <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="beatTime"    column="beat_time"    />
        <result property="repairFlag"    column="repair_flag"    />
    </resultMap>
 
    <sql id="selectDaPassingStationCollectionVo">
        select id, work_order_no, sfc_code, product_code, production_line, location_code, equipment_no, inbound_time, outbound_time, in_rs_sign, in_msg_sign, out_rs_sign, out_msg_sign, collection_time, spare_field_1, spare_field_2, create_user, create_time, update_user, update_time, beat_time, repair_flag from da_passing_station_collection
    </sql>
 
    <select id="selectDaPassingStationCollectionList" parameterType="DaPassingStationCollection" resultMap="DaPassingStationCollectionResult">
        <include refid="selectDaPassingStationCollectionVo"/>
        <where>  
            <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</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="inboundTime != null "> and inbound_time = #{inboundTime}</if>
            <if test="outboundTime != null "> and outbound_time = #{outboundTime}</if>
            <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
            <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and outbound_time between #{startTime} and #{endTime}</if>
        </where>
    </select>
    
    <select id="selectDaPassingStationCollectionById" parameterType="Long" resultMap="DaPassingStationCollectionResult">
        <include refid="selectDaPassingStationCollectionVo"/>
        where id = #{id}
    </select>
    <select id="getListBySfcCode"
            resultMap="DaPassingStationCollectionResult">
        <include refid="selectDaPassingStationCollectionVo"/>
        where sfc_code in
            <foreach collection="engineNoList" open="(" close=")" item="code" separator=",">
            #{code}
            </foreach>
    </select>
 
    <insert id="insertDaPassingStationCollection" parameterType="DaPassingStationCollection">
        insert into da_passing_station_collection
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="workOrderNo != null">work_order_no,</if>
            <if test="sfcCode != null">sfc_code,</if>
            <if test="productCode != null">product_code,</if>
            <if test="productionLine != null">production_line,</if>
            <if test="locationCode != null">location_code,</if>
            <if test="equipmentNo != null">equipment_no,</if>
            <if test="inboundTime != null">inbound_time,</if>
            <if test="outboundTime != null">outbound_time,</if>
            <if test="inRsSign != null">in_rs_sign,</if>
            <if test="inMsgSign != null">in_msg_sign,</if>
            <if test="outRsSign != null">out_rs_sign,</if>
            <if test="outMsgSign != null">out_msg_sign,</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="beatTime != null">beat_time,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id},</if>
            <if test="workOrderNo != null">#{workOrderNo},</if>
            <if test="sfcCode != null">#{sfcCode},</if>
            <if test="productCode != null">#{productCode},</if>
            <if test="productionLine != null">#{productionLine},</if>
            <if test="locationCode != null">#{locationCode},</if>
            <if test="equipmentNo != null">#{equipmentNo},</if>
            <if test="inboundTime != null">#{inboundTime},</if>
            <if test="outboundTime != null">#{outboundTime},</if>
            <if test="inRsSign != null">#{inRsSign},</if>
            <if test="inMsgSign != null">#{inMsgSign},</if>
            <if test="outRsSign != null">#{outRsSign},</if>
            <if test="outMsgSign != null">#{outMsgSign},</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="beatTime != null">#{beatTime},</if>
         </trim>
    </insert>
 
    <update id="updateDaPassingStationCollection" parameterType="DaPassingStationCollection">
        update da_passing_station_collection
        <trim prefix="SET" suffixOverrides=",">
            <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
            <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
            <if test="productCode != null">product_code = #{productCode},</if>
            <if test="productionLine != null">production_line = #{productionLine},</if>
            <if test="locationCode != null">location_code = #{locationCode},</if>
            <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
            <if test="inboundTime != null">inbound_time = #{inboundTime},</if>
            <if test="outboundTime != null">outbound_time = #{outboundTime},</if>
            <if test="inRsSign != null">in_rs_sign = #{inRsSign},</if>
            <if test="inMsgSign != null">in_msg_sign = #{inMsgSign},</if>
            <if test="outRsSign != null">out_rs_sign = #{outRsSign},</if>
            <if test="outMsgSign != null">out_msg_sign = #{outMsgSign},</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="beatTime != null">beat_time = #{beatTime},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteDaPassingStationCollectionById" parameterType="Long">
        delete from da_passing_station_collection where id = #{id}
    </delete>
 
    <delete id="deleteDaPassingStationCollectionByIds" parameterType="String">
        delete from da_passing_station_collection where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <select id="SelectSN" parameterType="java.util.Map" statementType="CALLABLE" resultType="java.lang.String">
        {
            call SNRetrieval(
                #{SN_CODE,mode=IN,jdbcType=VARCHAR},
                #{Success,mode=OUT,jdbcType=VARCHAR}
            )
        }
    </select>
</mapper>