春风项目四线(合箱线、总装线)
wujian
2024-10-23 2c65c31aceb16c1d06c692266e3fb555ecafdfb5
提交 | 用户 | 时间
fd2207 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.main.da.passingStationCollection.mapper.DaPassingStationCollectionMapper">
6     
7     <resultMap type="DaPassingStationCollection" id="DaPassingStationCollectionResult">
8         <result property="id"    column="id"    />
9         <result property="workOrderNo"    column="work_order_no"    />
10         <result property="sfcCode"    column="sfc_code"    />
11         <result property="productCode"    column="product_code"    />
12         <result property="productionLine"    column="production_line"    />
13         <result property="locationCode"    column="location_code"    />
14         <result property="equipmentNo"    column="equipment_no"    />
15         <result property="inboundTime"    column="inbound_time"    />
16         <result property="outboundTime"    column="outbound_time"    />
17         <result property="inRsSign"    column="in_rs_sign"    />
18         <result property="inMsgSign"    column="in_msg_sign"    />
19         <result property="outRsSign"    column="out_rs_sign"    />
20         <result property="outMsgSign"    column="out_msg_sign"    />
21         <result property="collectionTime"    column="collection_time"    />
22         <result property="spareField1"    column="spare_field_1"    />
23         <result property="spareField2"    column="spare_field_2"    />
24         <result property="createUser"    column="create_user"    />
25         <result property="createTime"    column="create_time"    />
26         <result property="updateUser"    column="update_user"    />
27         <result property="updateTime"    column="update_time"    />
28         <result property="beatTime"    column="beat_time"    />
8aafc5 29         <result property="repairFlag"    column="repair_flag"    />
fd2207 30     </resultMap>
31
32     <sql id="selectDaPassingStationCollectionVo">
8aafc5 33         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
fd2207 34     </sql>
35
2c65c3 36     <sql id="selectDaPassingStationCollectionForSearch">
W 37         select id, work_order_no, sfc_code, product_code, location_code, inbound_time, outbound_time, out_rs_sign, collection_time from da_passing_station_collection
38     </sql>
39
40     <select id="selectDaPassingStationCollectionForSearch" parameterType="DaPassingStationCollection" resultMap="DaPassingStationCollectionResult">
41         <include refid="selectDaPassingStationCollectionForSearch"/>
42         <where>
43             <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
44             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
45             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
46             <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
47             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
48             <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
49             <if test="inboundTime != null "> and CAST(inbound_time as DATE) = #{inboundTime}</if>
50             <if test="outboundTime != null "> and CAST(outbound_time as DATE) = #{outboundTime}</if>
51             <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
52             <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
53             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and outbound_time between #{startTime} and #{endTime}</if>
54         </where>
55     </select>
56
fd2207 57     <select id="selectDaPassingStationCollectionList" parameterType="DaPassingStationCollection" resultMap="DaPassingStationCollectionResult">
58         <include refid="selectDaPassingStationCollectionVo"/>
59         <where>  
60             <if test="workOrderNo != null  and workOrderNo != ''"> and work_order_no = #{workOrderNo}</if>
61             <if test="sfcCode != null  and sfcCode != ''"> and sfc_code = #{sfcCode}</if>
62             <if test="productCode != null  and productCode != ''"> and product_code = #{productCode}</if>
63             <if test="productionLine != null  and productionLine != ''"> and production_line = #{productionLine}</if>
64             <if test="locationCode != null  and locationCode != ''"> and location_code = #{locationCode}</if>
65             <if test="equipmentNo != null  and equipmentNo != ''"> and equipment_no = #{equipmentNo}</if>
131e8c 66             <if test="inboundTime != null "> and CAST(inbound_time as DATE) = #{inboundTime}</if>
W 67             <if test="outboundTime != null "> and CAST(outbound_time as DATE) = #{outboundTime}</if>
ff985a 68             <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
69             <if test="outRsSign != null "> and out_rs_sign = #{outRsSign}</if>
020295 70             <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and outbound_time between #{startTime} and #{endTime}</if>
fd2207 71         </where>
72     </select>
73     
74     <select id="selectDaPassingStationCollectionById" parameterType="Long" resultMap="DaPassingStationCollectionResult">
75         <include refid="selectDaPassingStationCollectionVo"/>
76         where id = #{id}
77     </select>
c74dcb 78     <select id="getListBySfcCode"
W 79             resultMap="DaPassingStationCollectionResult">
80         <include refid="selectDaPassingStationCollectionVo"/>
81         where sfc_code in
82             <foreach collection="engineNoList" open="(" close=")" item="code" separator=",">
83             #{code}
84             </foreach>
85     </select>
86
fd2207 87     <insert id="insertDaPassingStationCollection" parameterType="DaPassingStationCollection">
88         insert into da_passing_station_collection
89         <trim prefix="(" suffix=")" suffixOverrides=",">
90             <if test="id != null">id,</if>
91             <if test="workOrderNo != null">work_order_no,</if>
92             <if test="sfcCode != null">sfc_code,</if>
93             <if test="productCode != null">product_code,</if>
94             <if test="productionLine != null">production_line,</if>
95             <if test="locationCode != null">location_code,</if>
96             <if test="equipmentNo != null">equipment_no,</if>
97             <if test="inboundTime != null">inbound_time,</if>
98             <if test="outboundTime != null">outbound_time,</if>
99             <if test="inRsSign != null">in_rs_sign,</if>
100             <if test="inMsgSign != null">in_msg_sign,</if>
101             <if test="outRsSign != null">out_rs_sign,</if>
102             <if test="outMsgSign != null">out_msg_sign,</if>
103             <if test="collectionTime != null">collection_time,</if>
104             <if test="spareField1 != null">spare_field_1,</if>
105             <if test="spareField2 != null">spare_field_2,</if>
106             <if test="createUser != null">create_user,</if>
107             <if test="createTime != null">create_time,</if>
108             <if test="updateUser != null">update_user,</if>
109             <if test="updateTime != null">update_time,</if>
110             <if test="beatTime != null">beat_time,</if>
111          </trim>
112         <trim prefix="values (" suffix=")" suffixOverrides=",">
113             <if test="id != null">#{id},</if>
114             <if test="workOrderNo != null">#{workOrderNo},</if>
115             <if test="sfcCode != null">#{sfcCode},</if>
116             <if test="productCode != null">#{productCode},</if>
117             <if test="productionLine != null">#{productionLine},</if>
118             <if test="locationCode != null">#{locationCode},</if>
119             <if test="equipmentNo != null">#{equipmentNo},</if>
120             <if test="inboundTime != null">#{inboundTime},</if>
121             <if test="outboundTime != null">#{outboundTime},</if>
122             <if test="inRsSign != null">#{inRsSign},</if>
123             <if test="inMsgSign != null">#{inMsgSign},</if>
124             <if test="outRsSign != null">#{outRsSign},</if>
125             <if test="outMsgSign != null">#{outMsgSign},</if>
126             <if test="collectionTime != null">#{collectionTime},</if>
127             <if test="spareField1 != null">#{spareField1},</if>
128             <if test="spareField2 != null">#{spareField2},</if>
129             <if test="createUser != null">#{createUser},</if>
130             <if test="createTime != null">#{createTime},</if>
131             <if test="updateUser != null">#{updateUser},</if>
132             <if test="updateTime != null">#{updateTime},</if>
133             <if test="beatTime != null">#{beatTime},</if>
134          </trim>
135     </insert>
136
137     <update id="updateDaPassingStationCollection" parameterType="DaPassingStationCollection">
138         update da_passing_station_collection
139         <trim prefix="SET" suffixOverrides=",">
140             <if test="workOrderNo != null">work_order_no = #{workOrderNo},</if>
141             <if test="sfcCode != null">sfc_code = #{sfcCode},</if>
142             <if test="productCode != null">product_code = #{productCode},</if>
143             <if test="productionLine != null">production_line = #{productionLine},</if>
144             <if test="locationCode != null">location_code = #{locationCode},</if>
145             <if test="equipmentNo != null">equipment_no = #{equipmentNo},</if>
146             <if test="inboundTime != null">inbound_time = #{inboundTime},</if>
147             <if test="outboundTime != null">outbound_time = #{outboundTime},</if>
148             <if test="inRsSign != null">in_rs_sign = #{inRsSign},</if>
149             <if test="inMsgSign != null">in_msg_sign = #{inMsgSign},</if>
150             <if test="outRsSign != null">out_rs_sign = #{outRsSign},</if>
151             <if test="outMsgSign != null">out_msg_sign = #{outMsgSign},</if>
152             <if test="collectionTime != null">collection_time = #{collectionTime},</if>
153             <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
154             <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
155             <if test="createUser != null">create_user = #{createUser},</if>
156             <if test="createTime != null">create_time = #{createTime},</if>
157             <if test="updateUser != null">update_user = #{updateUser},</if>
158             <if test="updateTime != null">update_time = #{updateTime},</if>
159             <if test="beatTime != null">beat_time = #{beatTime},</if>
160         </trim>
161         where id = #{id}
162     </update>
163
164     <delete id="deleteDaPassingStationCollectionById" parameterType="Long">
165         delete from da_passing_station_collection where id = #{id}
166     </delete>
167
168     <delete id="deleteDaPassingStationCollectionByIds" parameterType="String">
169         delete from da_passing_station_collection where id in 
170         <foreach item="id" collection="array" open="(" separator="," close=")">
171             #{id}
172         </foreach>
173     </delete>
059083 174
W 175     <select id="SelectSN" parameterType="java.util.Map" statementType="CALLABLE" resultType="java.lang.String">
176         {
177             call SNRetrieval(
178                 #{SN_CODE,mode=IN,jdbcType=VARCHAR},
179                 #{Node,mode=IN,jdbcType=VARCHAR},
180                 #{Success,mode=OUT,jdbcType=VARCHAR}
181                  )
182             }
183     </select>
fd2207 184 </mapper>