春风项目四线(合箱线、总装线)
wujian
5 天以前 ea3c33c8561df39d4f123d1424fda99dd0f0c51d
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
<?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.bs.orderScheduling.mapper.BsOrderSchedulingMapper">
 
    <resultMap type="BsOrderScheduling" id="BsOrderSchedulingResult">
        <result property="id"    column="id"    />
        <result property="orderNo"    column="order_no"    />
        <result property="engineNo"    column="engine_no"    />
        <result property="productType"    column="product_type"    />
        <result property="model"    column="model"    />
        <result property="productionStatus"    column="production_status"    />
        <result property="workingHours"    column="working_hours"    />
        <result property="currentWorkstation"    column="current_workstation"    />
        <result property="qualityStatus"    column="quality_status"    />
        <result property="whetherOrPrint"    column="whether_or_print"    />
        <result property="report10"    column="report_10"    />
        <result property="report20"    column="report_20"    />
        <result property="combinedBoxTime"    column="combined_box_time"    />
        <result property="finalAssemblyTime"    column="final_assembly_time"    />
        <result property="operator"    column="operator"    />
        <result property="operateTime"    column="operate_time"    />
        <result property="status"    column="status"    />
        <result property="spareField1"    column="spare_field_1"    />
        <result property="spareField2"    column="spare_field_2"    />
        <result property="spareField3"    column="spare_field_3"    />
        <result property="spareField4"    column="spare_field_4"    />
        <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="remarks"    column="remarks"    />
        <result property="report30"    column="report_30"    />
        <result property="boxClosingOnlineTime"    column="box_closing_online_time"    />
        <result property="closingBoxOfflineTime"    column="closing_box_offline_time"    />
        <result property="finalAssemblyLaunchTime"    column="final_assembly_launch_time"    />
        <result property="finalAssemblyOfflineTime"    column="final_assembly_offline_time"    />
        <result property="cvtLaunchTime"    column="cvt_launch_time"    />
        <result property="cvtOfflineTime"    column="cvt_offline_time"    />
 
    </resultMap>
 
    <sql id="selectBsOrderSchedulingVo">
        select id, order_no, engine_no, product_type, model, production_status, working_hours, current_workstation, quality_status, whether_or_print, report_10, report_20, combined_box_time, final_assembly_time, operator, operate_time, status, spare_field_1, spare_field_2, spare_field_3, spare_field_4, create_user, create_time, update_user, update_time, remarks, report_30, box_closing_online_time, closing_box_offline_time, final_assembly_launch_time, final_assembly_offline_time, cvt_launch_time, cvt_offline_time from bs_order_scheduling
    </sql>
 
    <sql id="selectBsOrderSchedulingForReport">
        select id, engine_no, report_20, remarks from bs_order_scheduling
    </sql>
 
    <select id="selectBsOrderSchedulingForReport"
            parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult">
        <include refid="selectBsOrderSchedulingForReport"/>
            <where>
                <if test="engineNoList != null and engineNoList.size() > 0">
                    and engine_no in
                    <foreach collection="engineNoList" open="(" close=")" separator="," item="engine">
                        #{engine}
                    </foreach>
                </if>
            </where>
    </select>
 
    <select id="selectBsOrderSchedulingList" parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult">
        <include refid="selectBsOrderSchedulingVo"/>
        <where>
            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
            <if test="engineNo != null  and engineNo != ''"> and engine_no = #{engineNo}</if>
            <if test="productType != null  and productType != ''"> and product_type = #{productType}</if>
            <if test="model != null  and model != ''"> and model = #{model}</if>
            <if test="productionStatus != null  and productionStatus != ''"> and production_status = #{productionStatus}</if>
            <if test="workingHours != null  and workingHours != ''"> and working_hours = #{workingHours}</if>
            <if test="currentWorkstation != null  and currentWorkstation != ''"> and current_workstation = #{currentWorkstation}</if>
            <if test="qualityStatus != null  and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
            <if test="whetherOrPrint != null  and whetherOrPrint != ''"> and whether_or_print = #{whetherOrPrint}</if>
            <if test="report10 != null  and report10 != ''"> and report_10 = #{report10}</if>
            <if test="report20 != null  and report20 != ''"> and report_20 = #{report20}</if>
            <if test="combinedBoxTime != null  and combinedBoxTime != ''"> and combined_box_time = #{combinedBoxTime}</if>
            <if test="finalAssemblyTime != null  and finalAssemblyTime != ''"> and final_assembly_time = #{finalAssemblyTime}</if>
            <if test="operator != null  and operator != ''"> and operator = #{operator}</if>
            <if test="operateTime != null  and operateTime != ''"> and operate_time = #{operateTime}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and isnull(spare_field_1,'') != #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and isnull(spare_field_2,'') != #{spareField2}</if>
            <if test="spareField3 != null  and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
            <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="report30 != null  and report30 != ''"> and report_30 = #{report30}</if>
            <if test="dateConditions != null  and dateConditions != ''"> and operate_time BETWEEN #{startTime} AND #{endTime}</if>
            <if test="boxClosingOnlineTime != null  and boxClosingOnlineTime != ''"> and box_closing_online_time = #{boxClosingOnlineTime}</if>
            <if test="closingBoxOfflineTime != null  and closingBoxOfflineTime != ''"> and closing_box_offline_time = #{closingBoxOfflineTime}</if>
            <if test="finalAssemblyLaunchTime != null  and finalAssemblyLaunchTime != ''"> and final_assembly_launch_time = #{finalAssemblyLaunchTime}</if>
            <if test="finalAssemblyOfflineTime != null  and finalAssemblyOfflineTime != ''"> and final_assembly_offline_time = #{finalAssemblyOfflineTime}</if>
            <if test="cvtLaunchTime != null  and cvtLaunchTime != ''"> and cvt_launch_time = #{cvtLaunchTime}</if>
            <if test="cvtOfflineTime != null  and cvtOfflineTime != ''"> and cvt_offline_time = #{cvtOfflineTime}</if>
            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and final_assembly_offline_time between #{startTime} and #{endTime}</if>
            <if test="engineNoList != null and engineNoList.size() > 0">
                and engine_no in
                <foreach collection="engineNoList" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
            <if test="engineNoListExcel != null and engineNoListExcel.size() > 0">
                and engine_no in
                <foreach collection="engineNoListExcel" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
        </where>
    </select>
 
    <select id="selectBsOrderSchedulingPage" parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult">
        <include refid="selectBsOrderSchedulingVo"/>
        <where>
            <if test="orderNo != null  and orderNo != ''"> and order_no = #{orderNo}</if>
            <if test="engineNo != null  and engineNo != ''"> and engine_no = #{engineNo}</if>
            <if test="productType != null  and productType != ''"> and product_type = #{productType}</if>
            <if test="model != null  and model != ''"> and model = #{model}</if>
            <if test="productionStatus != null  and productionStatus != ''"> and production_status = #{productionStatus}</if>
            <if test="workingHours != null  and workingHours != ''"> and working_hours = #{workingHours}</if>
            <if test="currentWorkstation != null  and currentWorkstation != ''"> and current_workstation = #{currentWorkstation}</if>
            <if test="qualityStatus != null  and qualityStatus != ''"> and quality_status = #{qualityStatus}</if>
            <if test="whetherOrPrint != null  and whetherOrPrint != ''"> and whether_or_print = #{whetherOrPrint}</if>
            <if test="report10 != null  and report10 != ''"> and report_10 = #{report10}</if>
            <if test="report20 != null  and report20 != ''"> and report_20 = #{report20}</if>
            <if test="combinedBoxTime != null  and combinedBoxTime != ''"> and combined_box_time = #{combinedBoxTime}</if>
            <if test="finalAssemblyTime != null  and finalAssemblyTime != ''"> and final_assembly_time = #{finalAssemblyTime}</if>
            <if test="operator != null  and operator != ''"> and operator = #{operator}</if>
            <if test="operateTime != null  and operateTime != ''"> and operate_time = #{operateTime}</if>
            <if test="status != null  and status != ''"> and status = #{status}</if>
            <if test="spareField1 != null  and spareField1 != ''"> and spare_field_1 = #{spareField1}</if>
            <if test="spareField2 != null  and spareField2 != ''"> and spare_field_2 = #{spareField2}</if>
            <if test="spareField3 != null  and spareField3 != ''"> and spare_field_3 = #{spareField3}</if>
            <if test="spareField4 != null  and spareField4 != ''"> and spare_field_4 = #{spareField4}</if>
            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
            <if test="remarks != null  and remarks != ''"> and remarks = #{remarks}</if>
            <if test="report30 != null  and report30 != ''"> and report_30 = #{report30}</if>
            <if test="dateConditions != null  and dateConditions != ''"> and operate_time BETWEEN #{startTime} AND #{endTime}</if>
            <if test="boxClosingOnlineTime != null  and boxClosingOnlineTime != ''"> and box_closing_online_time = #{boxClosingOnlineTime}</if>
            <if test="closingBoxOfflineTime != null  and closingBoxOfflineTime != ''"> and closing_box_offline_time = #{closingBoxOfflineTime}</if>
            <if test="finalAssemblyLaunchTime != null  and finalAssemblyLaunchTime != ''"> and final_assembly_launch_time = #{finalAssemblyLaunchTime}</if>
            <if test="finalAssemblyOfflineTime != null  and finalAssemblyOfflineTime != ''"> and final_assembly_offline_time = #{finalAssemblyOfflineTime}</if>
            <if test="cvtLaunchTime != null  and cvtLaunchTime != ''"> and cvt_launch_time = #{cvtLaunchTime}</if>
            <if test="cvtOfflineTime != null  and cvtOfflineTime != ''"> and cvt_offline_time = #{cvtOfflineTime}</if>
            <if test="startTime != null and startTime != '' and endTime != null and endTime != ''"> and cvt_offline_time between #{startTime} and #{endTime}</if>
            <if test="engineNoList != null and engineNoList.size() > 0">
                and engine_no in
                <foreach collection="engineNoList" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
            <if test="engineNoListExcel != null and engineNoListExcel.size() > 0">
                and engine_no in
                <foreach collection="engineNoListExcel" open="(" close=")" separator="," item="engine">
                    #{engine}
                </foreach>
            </if>
            and (production_status = '2' or production_status = '3')
        </where>
        order by create_time DESC
    </select>
 
    <select id="selectBsOrderSchedulingById" parameterType="Long" resultMap="BsOrderSchedulingResult">
        <include refid="selectBsOrderSchedulingVo"/>
        where id = #{id}
    </select>
 
    <select id="selectBsOrderSchedulingSNCode" parameterType="String" resultMap="BsOrderSchedulingResult">
        <include refid="selectBsOrderSchedulingVo"/>
        where engine_no = #{sncode}
    </select>
 
    <select id="getPrepareOnlineList" resultType="com.jcdm.main.bs.orderScheduling.domain.BsOrderScheduling">
        select bos.* from bs_order_scheduling bos
        <where>
            <if test="prepareOnlineQuery.orderNo != null and prepareOnlineQuery.orderNo != '' ">
                and bos.order_no = #{prepareOnlineQuery.orderNo}
            </if>
            <if test="prepareOnlineQuery.engineNo != null and prepareOnlineQuery.engineNo != '' ">
                and bos.engine_no = #{prepareOnlineQuery.engineNo}
            </if>
        </where>
    </select>
    <select id="getProduceNumToday" resultType="java.lang.Integer">
        select count(*) from bs_order_scheduling
        where ${queryField} BETWEEN #{startTime} AND #{endTime}
    </select>
    <select id="getProductNum" resultType="com.jcdm.main.da.passingStationCollection.domain.ProductNumVO">
        SELECT model,count(*) as num FROM bs_order_scheduling
        <where>
            <if test="queryDate != null and queryDate != ''">
             final_assembly_offline_time between #{queryDate} and #{addQueryDate}
            </if>
        </where>
        GROUP BY model
    </select>
 
    <select id="selectBsOrderSchedulingListForNum"
            parameterType="BsOrderScheduling" resultMap="BsOrderSchedulingResult">
        select model,final_assembly_offline_time,final_assembly_launch_time,box_closing_online_time
        from bs_order_scheduling
        <where>
            <if test="queryDate != null and queryDate != ''">
                final_assembly_offline_time between #{queryDate} and #{addQueryDate}
        or final_assembly_launch_time between #{queryDate} and #{addQueryDate}
        or box_closing_online_time between #{queryDate} and #{addQueryDate}
            </if>
        </where>
    </select>
 
 
    <insert id="insertBsOrderScheduling" parameterType="BsOrderScheduling" useGeneratedKeys="true" keyProperty="id">
        insert into bs_order_scheduling
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="orderNo != null">order_no,</if>
            <if test="engineNo != null">engine_no,</if>
            <if test="productType != null">product_type,</if>
            <if test="model != null">model,</if>
            <if test="productionStatus != null">production_status,</if>
            <if test="workingHours != null">working_hours,</if>
            <if test="currentWorkstation != null">current_workstation,</if>
            <if test="qualityStatus != null">quality_status,</if>
            <if test="whetherOrPrint != null">whether_or_print,</if>
            <if test="report10 != null">report_10,</if>
            <if test="report20 != null">report_20,</if>
            <if test="combinedBoxTime != null">combined_box_time,</if>
            <if test="finalAssemblyTime != null">final_assembly_time,</if>
            <if test="operator != null">operator,</if>
            <if test="operateTime != null">operate_time,</if>
            <if test="status != null">status,</if>
            <if test="spareField1 != null">spare_field_1,</if>
            <if test="spareField2 != null">spare_field_2,</if>
            <if test="spareField3 != null">spare_field_3,</if>
            <if test="spareField4 != null">spare_field_4,</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="remarks != null">remarks,</if>
            <if test="report30 != null">report_30,</if>
            <if test="boxClosingOnlineTime != null">box_closing_online_time,</if>
            <if test="closingBoxOfflineTime != null">closing_box_offline_time,</if>
            <if test="finalAssemblyLaunchTime != null">final_assembly_launch_time,</if>
            <if test="finalAssemblyOfflineTime != null">final_assembly_offline_time,</if>
            <if test="cvtLaunchTime != null">cvt_launch_time,</if>
            <if test="cvtOfflineTime != null">cvt_offline_time,</if>
        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="orderNo != null">#{orderNo},</if>
            <if test="engineNo != null">#{engineNo},</if>
            <if test="productType != null">#{productType},</if>
            <if test="model != null">#{model},</if>
            <if test="productionStatus != null">#{productionStatus},</if>
            <if test="workingHours != null">#{workingHours},</if>
            <if test="currentWorkstation != null">#{currentWorkstation},</if>
            <if test="qualityStatus != null">#{qualityStatus},</if>
            <if test="whetherOrPrint != null">#{whetherOrPrint},</if>
            <if test="report10 != null">#{report10},</if>
            <if test="report20 != null">#{report20},</if>
            <if test="combinedBoxTime != null">#{combinedBoxTime},</if>
            <if test="finalAssemblyTime != null">#{finalAssemblyTime},</if>
            <if test="operator != null">#{operator},</if>
            <if test="operateTime != null">#{operateTime},</if>
            <if test="status != null">#{status},</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>
            <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="remarks != null">#{remarks},</if>
            <if test="report30 != null">#{report30},</if>
            <if test="boxClosingOnlineTime != null">#{boxClosingOnlineTime},</if>
            <if test="closingBoxOfflineTime != null">#{closingBoxOfflineTime},</if>
            <if test="finalAssemblyLaunchTime != null">#{finalAssemblyLaunchTime},</if>
            <if test="finalAssemblyOfflineTime != null">#{finalAssemblyOfflineTime},</if>
            <if test="cvtLaunchTime != null">#{cvtLaunchTime},</if>
            <if test="cvtOfflineTime != null">#{cvtOfflineTime},</if>
 
        </trim>
    </insert>
 
    <update id="updateBsOrderScheduling" parameterType="BsOrderScheduling">
        update bs_order_scheduling
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderNo != null">order_no = #{orderNo},</if>
            <if test="engineNo != null">engine_no = #{engineNo},</if>
            <if test="productType != null">product_type = #{productType},</if>
            <if test="model != null">model = #{model},</if>
            <if test="productionStatus != null">production_status = #{productionStatus},</if>
            <if test="workingHours != null">working_hours = #{workingHours},</if>
            <if test="currentWorkstation != null">current_workstation = #{currentWorkstation},</if>
            <if test="qualityStatus != null">quality_status = #{qualityStatus},</if>
            <if test="whetherOrPrint != null">whether_or_print = #{whetherOrPrint},</if>
            <if test="report10 != null">report_10 = #{report10},</if>
            <if test="report20 != null">report_20 = #{report20},</if>
            <if test="combinedBoxTime != null">combined_box_time = #{combinedBoxTime},</if>
            <if test="finalAssemblyTime != null">final_assembly_time = #{finalAssemblyTime},</if>
            <if test="operator != null">operator = #{operator},</if>
            <if test="operateTime != null">operate_time = #{operateTime},</if>
            <if test="status != null">status = #{status},</if>
            <if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
            <if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
            <if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
            <if test="spareField4 != null">spare_field_4 = #{spareField4},</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="remarks != null">remarks = #{remarks},</if>
            <if test="report30 != null">report_30 = #{report30},</if>
            <if test="boxClosingOnlineTime != null">box_closing_online_time = #{boxClosingOnlineTime},</if>
            <if test="closingBoxOfflineTime != null">closing_box_offline_time = #{closingBoxOfflineTime},</if>
            <if test="finalAssemblyLaunchTime != null">final_assembly_launch_time = #{finalAssemblyLaunchTime},</if>
            <if test="finalAssemblyOfflineTime != null">final_assembly_offline_time = #{finalAssemblyOfflineTime},</if>
            <if test="cvtLaunchTime != null">cvt_launch_time = #{cvtLaunchTime},</if>
            <if test="cvtOfflineTime != null">cvt_offline_time = #{cvtOfflineTime},</if>
 
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteBsOrderSchedulingById" parameterType="Long">
        delete from bs_order_scheduling where id = #{id}
    </delete>
 
    <delete id="deleteBsOrderSchedulingByIds" parameterType="String">
        delete from bs_order_scheduling where id in
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
 
</mapper>