sfd
2025-05-26 2a64b537e8e3bce9ce030585a3da17d48379c0ad
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
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
<?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.aps.job.mapper.ApsWorkOrderJobMapper">
    
    <resultMap type="com.aps.job.domain.ApsWorkOrderJob" id="ApsWorkOrderJobResult">
        <result property="id"    column="id"    />
        <result property="orderId"    column="order_id"    />
        <result property="docNo"    column="doc_no"    />
        <result property="mainitemCode"    column="mainitem_code"    />
        <result property="mainitemFigure"    column="mainitem_figure"    />
        <result property="customerName"    column="customer_name"    />
        <result property="businessType"    column="business_type"    />
        <result property="demandType"    column="demand_type"    />
        <result property="docStatus"    column="doc_status"    />
        <result property="itemCode"    column="item_code"    />
        <result property="itemFigure"    column="item_figure"    />
        <result property="itemFigureVersion"    column="item_figure_version"    />
        <result property="pruductQty"    column="pruduct_qty"    />
        <result property="workQty"    column="work_qty"    />
        <result property="opNum"    column="op_num"    />
        <result property="workCenter"    column="work_center"    />
        <result property="dept"    column="dept"    />
        <result property="startDate"    column="start_date"    />
        <result property="completeDate"    column="complete_date"    />
        <result property="nextDept"    column="next_dept"    />
        <result property="isHoldRelease"    column="is_hold_release"    />
        <result property="isOutSource"    column="is_out_source"    />
        <result property="org"    column="org"    />
        <result property="pageNum"    column="page_num"    />
        <result property="pageIndex"    column="page_index"    />
        <result property="delFlag"    column="del_flag"    />
        <result property="createBy"    column="create_by"    />
        <result property="createTime"    column="create_time"    />
        <result property="updateBy"    column="update_by"    />
        <result property="updateTime"    column="update_time"    />
        <result property="processStatus"    column="process_status"    />
        <result property="stdOp"    column="std_op"    />
        <result property="opStatus"    column="op_status"    />
        <result property="nextOpName"    column="next_op_name"    />
        <result property="lowOrderCode"    column="low_order_code"    />
        <result property="orderCreateTime"    column="order_create_time"    />
        <result property="approveOn"    column="approve_on"    />
        <result property="startWorkDate"    column="start_work_date"    />
    </resultMap>
 
    <sql id="selectApsWorkOrderJobVo">
        select id, order_id, doc_no, mainitem_code, mainitem_figure, customer_name, business_type, demand_type,
               doc_status, item_code, item_figure, item_figure_version, pruduct_qty, work_qty, op_num, work_center,
               dept, start_date, complete_date, next_dept, is_hold_release, is_out_source, org, page_num, page_index,
               del_flag, create_by, create_time, update_by, update_time , process_status,org_code, std_op, op_status, next_op_name,
               low_order_code, order_create_time, approve_on, start_work_date
        from aps_work_order_job
    </sql>
 
    <select id="selectApsWorkOrderJobList" parameterType="com.aps.job.domain.ApsWorkOrderJob" resultMap="ApsWorkOrderJobResult">
        <include refid="selectApsWorkOrderJobVo"/>
        <where>  
            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
            <if test="docNo != null  and docNo != ''"> and doc_no = #{docNo}</if>
            <if test="mainitemCode != null  and mainitemCode != ''"> and mainitem_code = #{mainitemCode}</if>
            <if test="mainitemFigure != null  and mainitemFigure != ''"> and mainitem_figure = #{mainitemFigure}</if>
            <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
            <if test="businessType != null "> and business_type = #{businessType}</if>
            <if test="demandType != null  and demandType != ''"> and demand_type = #{demandType}</if>
            <if test="docStatus != null "> and doc_status = #{docStatus}</if>
            <if test="itemCode != null  and itemCode != ''"> and item_code = #{itemCode}</if>
            <if test="itemFigure != null  and itemFigure != ''"> and item_figure = #{itemFigure}</if>
            <if test="itemFigureVersion != null  and itemFigureVersion != ''"> and item_figure_version = #{itemFigureVersion}</if>
            <if test="pruductQty != null "> and pruduct_qty = #{pruductQty}</if>
            <if test="workQty != null "> and work_qty = #{workQty}</if>
            <if test="opNum != null  and opNum != ''"> and op_num = #{opNum}</if>
            <if test="workCenter != null "> and work_center = #{workCenter}</if>
            <if test="dept != null  and dept != ''"> and dept = #{dept}</if>
            <if test="startDate != null  and startDate != ''"> and start_date = #{startDate}</if>
            <if test="completeDate != null  and completeDate != ''"> and complete_date = #{completeDate}</if>
            <if test="nextDept != null  and nextDept != ''"> and next_dept = #{nextDept}</if>
            <if test="isHoldRelease != null "> and is_hold_release = #{isHoldRelease}</if>
            <if test="isOutSource != null  and isOutSource != ''"> and is_out_source = #{isOutSource}</if>
            <if test="org != null  and org != ''"> and org = #{org}</if>
            <if test="pageNum != null "> and page_num = #{pageNum}</if>
            <if test="pageIndex != null "> and page_index = #{pageIndex}</if>
            <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
            <if test="processStatus != null  and processStatus != ''"> and process_status = #{processStatus}</if>
            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
            <if test="opStatus != null  and opStatus != ''"> and op_status = #{opStatus}</if>
            <if test="nextOpName != null  and nextOpName != ''"> and next_op_name = #{nextOpName}</if>
        </where>
    </select>
 
    <select id="selectApsWorkOrderJobListDocNoNotNull" parameterType="com.aps.job.domain.ApsWorkOrderJob" resultMap="ApsWorkOrderJobResult">
        <include refid="selectApsWorkOrderJobVo"/>
        <where>
            <if test="orderId != null  and orderId != ''"> and order_id = #{orderId}</if>
            <if test="docNo != null  and docNo != ''"> and doc_no = #{docNo}</if>
            <if test="mainitemCode != null  and mainitemCode != ''"> and mainitem_code = #{mainitemCode}</if>
            <if test="mainitemFigure != null  and mainitemFigure != ''"> and mainitem_figure = #{mainitemFigure}</if>
            <if test="customerName != null  and customerName != ''"> and customer_name like concat('%', #{customerName}, '%')</if>
            <if test="businessType != null "> and business_type = #{businessType}</if>
            <if test="demandType != null  and demandType != ''"> and demand_type = #{demandType}</if>
            <if test="docStatus != null "> and doc_status = #{docStatus}</if>
            <if test="itemCode != null  and itemCode != ''"> and item_code = #{itemCode}</if>
            <if test="itemFigure != null  and itemFigure != ''"> and item_figure = #{itemFigure}</if>
            <if test="itemFigureVersion != null  and itemFigureVersion != ''"> and item_figure_version = #{itemFigureVersion}</if>
            <if test="pruductQty != null "> and pruduct_qty = #{pruductQty}</if>
            <if test="workQty != null "> and work_qty = #{workQty}</if>
            <if test="opNum != null  and opNum != ''"> and op_num = #{opNum}</if>
            <if test="workCenter != null "> and work_center = #{workCenter}</if>
            <if test="dept != null  and dept != ''"> and dept = #{dept}</if>
            <if test="startDate != null  and startDate != ''"> and start_date = #{startDate}</if>
            <if test="completeDate != null  and completeDate != ''"> and complete_date = #{completeDate}</if>
            <if test="nextDept != null  and nextDept != ''"> and next_dept = #{nextDept}</if>
            <if test="isHoldRelease != null "> and is_hold_release = #{isHoldRelease}</if>
            <if test="isOutSource != null  and isOutSource != ''"> and is_out_source = #{isOutSource}</if>
            <if test="org != null  and org != ''"> and org = #{org}</if>
            <if test="pageNum != null "> and page_num = #{pageNum}</if>
            <if test="pageIndex != null "> and page_index = #{pageIndex}</if>
            <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
            <if test="processStatus != null  and processStatus != ''"> and process_status = #{processStatus}</if>
            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
            <if test="opStatus != null  and opStatus != ''"> and op_status = #{opStatus}</if>
            <if test="nextOpName != null  and nextOpName != ''"> and next_op_name = #{nextOpName}</if>
            and doc_no is not null
        </where>
    </select>
    
    <select id="selectApsWorkOrderJobById" parameterType="Long" resultMap="ApsWorkOrderJobResult">
        <include refid="selectApsWorkOrderJobVo"/>
        where id = #{id}
    </select>
 
    <insert id="insertApsWorkOrderJob" parameterType="com.aps.job.domain.ApsWorkOrderJob" useGeneratedKeys="true" keyProperty="id">
        insert into aps_work_order_job
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="orderId != null">order_id,</if>
            <if test="docNo != null">doc_no,</if>
            <if test="mainitemCode != null">mainitem_code,</if>
            <if test="mainitemFigure != null">mainitem_figure,</if>
            <if test="customerName != null">customer_name,</if>
            <if test="businessType != null">business_type,</if>
            <if test="demandType != null">demand_type,</if>
            <if test="docStatus != null">doc_status,</if>
            <if test="itemCode != null">item_code,</if>
            <if test="itemFigure != null">item_figure,</if>
            <if test="itemFigureVersion != null">item_figure_version,</if>
            <if test="pruductQty != null">pruduct_qty,</if>
            <if test="workQty != null">work_qty,</if>
            <if test="opNum != null">op_num,</if>
            <if test="workCenter != null">work_center,</if>
            <if test="dept != null">dept,</if>
            <if test="startDate != null">start_date,</if>
            <if test="completeDate != null">complete_date,</if>
            <if test="nextDept != null">next_dept,</if>
            <if test="isHoldRelease != null">is_hold_release,</if>
            <if test="isOutSource != null">is_out_source,</if>
            <if test="org != null">org,</if>
            <if test="pageNum != null">page_num,</if>
            <if test="pageIndex != null">page_index,</if>
            <if test="delFlag != null">del_flag,</if>
            <if test="createBy != null">create_by,</if>
            <if test="createTime != null">create_time,</if>
            <if test="updateBy != null">update_by,</if>
            <if test="updateTime != null">update_time,</if>
            <if test="orgCode != null">org_code,</if>
            <if test="processStatus != null">process_status,</if>
            <if test="stdOp != null">std_op,</if>
            <if test="opStatus != null">op_status,</if>
            <if test="nextOpName != null">next_op_name,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="orderId != null">#{orderId},</if>
            <if test="docNo != null">#{docNo},</if>
            <if test="mainitemCode != null">#{mainitemCode},</if>
            <if test="mainitemFigure != null">#{mainitemFigure},</if>
            <if test="customerName != null">#{customerName},</if>
            <if test="businessType != null">#{businessType},</if>
            <if test="demandType != null">#{demandType},</if>
            <if test="docStatus != null">#{docStatus},</if>
            <if test="itemCode != null">#{itemCode},</if>
            <if test="itemFigure != null">#{itemFigure},</if>
            <if test="itemFigureVersion != null">#{itemFigureVersion},</if>
            <if test="pruductQty != null">#{pruductQty},</if>
            <if test="workQty != null">#{workQty},</if>
            <if test="opNum != null">#{opNum},</if>
            <if test="workCenter != null">#{workCenter},</if>
            <if test="dept != null">#{dept},</if>
            <if test="startDate != null">#{startDate},</if>
            <if test="completeDate != null">#{completeDate},</if>
            <if test="nextDept != null">#{nextDept},</if>
            <if test="isHoldRelease != null">#{isHoldRelease},</if>
            <if test="isOutSource != null">#{isOutSource},</if>
            <if test="org != null">#{org},</if>
            <if test="pageNum != null">#{pageNum},</if>
            <if test="pageIndex != null">#{pageIndex},</if>
            <if test="delFlag != null">#{delFlag},</if>
            <if test="createBy != null">#{createBy},</if>
            <if test="createTime != null">#{createTime},</if>
            <if test="updateBy != null">#{updateBy},</if>
            <if test="updateTime != null">#{updateTime},</if>
            <if test="orgCode != null">#{orgCode},</if>
            <if test="processStatus != null">#{processStatus},</if>
            <if test="stdOp != null">#{stdOp},</if>
            <if test="opStatus != null">#{opStatus},</if>
            <if test="nextOpName != null">#{nextOpName},</if>
         </trim>
    </insert>
 
    <update id="updateApsWorkOrderJob" parameterType="com.aps.job.domain.ApsWorkOrderJob">
        update aps_work_order_job
        <trim prefix="SET" suffixOverrides=",">
            <if test="orderId != null">order_id = #{orderId},</if>
            <if test="docNo != null">doc_no = #{docNo},</if>
            <if test="mainitemCode != null">mainitem_code = #{mainitemCode},</if>
            <if test="mainitemFigure != null">mainitem_figure = #{mainitemFigure},</if>
            <if test="customerName != null">customer_name = #{customerName},</if>
            <if test="businessType != null">business_type = #{businessType},</if>
            <if test="demandType != null">demand_type = #{demandType},</if>
            <if test="docStatus != null">doc_status = #{docStatus},</if>
            <if test="itemCode != null">item_code = #{itemCode},</if>
            <if test="itemFigure != null">item_figure = #{itemFigure},</if>
            <if test="itemFigureVersion != null">item_figure_version = #{itemFigureVersion},</if>
            <if test="pruductQty != null">pruduct_qty = #{pruductQty},</if>
            <if test="workQty != null">work_qty = #{workQty},</if>
            <if test="opNum != null">op_num = #{opNum},</if>
            <if test="workCenter != null">work_center = #{workCenter},</if>
            <if test="dept != null">dept = #{dept},</if>
            <if test="startDate != null">start_date = #{startDate},</if>
            <if test="completeDate != null">complete_date = #{completeDate},</if>
            <if test="nextDept != null">next_dept = #{nextDept},</if>
            <if test="isHoldRelease != null">is_hold_release = #{isHoldRelease},</if>
            <if test="isOutSource != null">is_out_source = #{isOutSource},</if>
            <if test="org != null">org = #{org},</if>
            <if test="pageNum != null">page_num = #{pageNum},</if>
            <if test="pageIndex != null">page_index = #{pageIndex},</if>
            <if test="delFlag != null">del_flag = #{delFlag},</if>
            <if test="createBy != null">create_by = #{createBy},</if>
            <if test="createTime != null">create_time = #{createTime},</if>
            <if test="updateBy != null">update_by = #{updateBy},</if>
            <if test="updateTime != null">update_time = #{updateTime},</if>
            <if test="orgCode != null"> org_code= #{orgCode},</if>
            <if test="processStatus != null"> process_status= #{processStatus},</if>
            <if test="stdOp != null"> std_op= #{stdOp},</if>
            <if test="opStatus != null"> op_status= #{opStatus},</if>
            <if test="nextOpName != null"> next_op_name= #{nextOpName},</if>
        </trim>
        where id = #{id}
    </update>
 
    <delete id="deleteApsWorkOrderJobById" parameterType="Long">
        delete from aps_work_order_job where id = #{id}
    </delete>
 
    <delete id="deleteApsWorkOrderJobByIds" parameterType="String">
        delete from aps_work_order_job where id in 
        <foreach item="id" collection="array" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <insert id="batchInsertApsWorkOrderJob" parameterType="java.util.List">
        insert into aps_work_order_job
        <trim prefix="(" suffix=")" suffixOverrides=",">
            id,
            order_id,
            doc_no,
            mainitem_code,
            mainitem_figure,
            customer_name,
            business_type,
            demand_type,
            doc_status,
            item_code,
            item_figure,
            item_figure_version,
            pruduct_qty,
            work_qty,
            op_num,
            work_center,
            dept,
            start_date,
            complete_date,
            next_dept,
            is_hold_release,
            is_out_source,
            org,
            page_num,
            page_index,
            del_flag,
            create_by,
            create_time,
            update_by,
            update_time,
            org_code,
            process_status,
            std_op,
            op_status,
            next_op_name,
            low_order_code,
            order_create_time,
            approve_on,
            start_work_date
        </trim>
        values
        <foreach collection="list" item="job" separator=",">
            (
            #{job.id},
            #{job.orderId},
            #{job.docNo},
            #{job.mainitemCode},
            #{job.mainitemFigure},
            #{job.customerName},
            #{job.businessType},
            #{job.demandType},
            #{job.docStatus},
            #{job.itemCode},
            #{job.itemFigure},
            #{job.itemFigureVersion},
            #{job.pruductQty},
            #{job.workQty},
            #{job.opNum},
            #{job.workCenter},
            #{job.dept},
            #{job.startDate},
            #{job.completeDate},
            #{job.nextDept},
            #{job.isHoldRelease},
            #{job.isOutSource},
            #{job.org},
            #{job.pageNum},
            #{job.pageIndex},
            #{job.delFlag},
            #{job.createBy},
            #{job.createTime},
            #{job.updateBy},
            #{job.updateTime},
            #{job.orgCode},
            #{job.processStatus},
            #{job.stdOp},
            #{job.opStatus},
            #{job.nextOpName},
            #{job.lowOrderCode},
            #{job.orderCreateTime},
            #{job.approveOn},
            #{job.startWorkDate}
            )
        </foreach>
    </insert>
    <delete id="deleteWorkOrderJobByOrderIds" parameterType="String">
        delete from aps_work_order_job where order_id in
        <foreach item="id" collection="orderIds" open="(" separator="," close=")">
            #{id}
        </foreach>
    </delete>
 
    <update id="updateApsWorkOrderJobPrccessStatus" parameterType="map">
        update aps_work_order_job
        set process_status = #{status}
        where doc_no in
        <foreach item="docNo" collection="docNos" open="(" separator="," close=")">
            #{docNo}
        </foreach>
    </update>
 
    <delete id="deleteAllPartPlan" >
        delete from aps_part_plan where del_flag in ('0','1')
    </delete>
    <insert id="batchInsertPartPlan">
        insert into aps_part_plan
        (
            document_number,main_part_number,main_part_drawing_number,
            customer,business_type,requirement_type,
            document_status,item_number,drawing_no,
            version_number,production_quantity,good_products_quantity,
            process_number,work_center,department,
            plan_start_day,plan_end_day,next_process_deparment,
            is_suspended,is_outsourcing,account,
            id,create_time,del_flag,plant,order_status,std_op,op_status,next_op_name
        )
        select
            doc_no,mainitem_code,mainitem_figure,
            customer_name,business_type,demand_type,
            doc_status,item_code,item_figure,
            item_figure_version,pruduct_qty,work_qty,
            op_num,work_center,dept,
            start_date,complete_date,next_dept,
            is_hold_release,is_out_source,org_code,
            order_id,now(),'0',org_code,doc_status,std_op,op_status,next_op_name
        from aps_work_order_job
        where ( doc_status in (0,1,2,4) and is_hold_release='0'
                and (item_code like 'M01%' or item_code like 'M02%'or item_code like 'M05%' or item_code like 'M10%'
                    or item_code like 'M14%'or item_code like 'M15%' or item_code like 'F%' or item_code like 'Z%'
                )
        );
    </insert>
    <delete id="deleteAllPlatePlan" >
        delete from aps_plate_plan where del_flag in ('0','1')
    </delete>
    <insert id="batchInsertPlatePlan">
        insert into aps_plate_plan
        (
            document_number,main_part_number,main_part_drawing_number,
            customer,business_type,requirement_type,
            document_status,item_number,drawing_no,
            version_number,production_quantity,good_products_quantity,
            process_number,work_center,department,
            plan_start_day,plan_end_day,next_process_deparment,
            is_suspended,is_outsourcing,account,
            id,create_time,del_flag,plant,order_status,std_op,op_status,next_op_name,
            professional_affiliation,order_create_time,approve_on,start_work_date,low_order_code
        )
        select
            doc_no,mainitem_code,mainitem_figure,
            customer_name,business_type,demand_type,
            doc_status,item_code,item_figure,
            item_figure_version,pruduct_qty,work_qty,
            op_num,work_center,dept,
            start_date,complete_date,next_dept,
            is_hold_release,is_out_source,org_code,
            cast(order_id as bigint) as id,now(),'0',org_code,doc_status,std_op,op_status,next_op_name,
            (case when low_order_code='0' then 'main' else 'sub' end ) as professional_affiliation,
            order_create_time,
            approve_on,
            start_work_date,
            low_order_code
        from aps_work_order_job
        where ( doc_status in (0,1,2,4) and is_hold_release='0'
                and (item_code like 'M03%' or item_code like 'M04%'or item_code like 'A75%')
              );
    </insert>
 
    <delete id="deleteAllGasPiping" >
        delete from aps_gas_piping_plan where del_flag in ('0','1')
    </delete>
    <insert id="batchInsertGasPiping">
        insert into aps_gas_piping_plan
        (
            document_number,main_part_number,main_part_drawing_number,
            customer,business_type,requirement_type,
            document_status,item_number,drawing_no,
            version_number,production_quantity,good_products_quantity,
            process_number,work_center,department,
            plan_start_day,plan_end_day,next_process_deparment,
            is_suspended,is_outsourcing,account,
            id,create_time,del_flag,plant,order_status,std_op,op_status,next_op_name,plan_type,
            order_create_time,
            approve_on,
            start_work_date,
            low_order_code
        )
        select
            doc_no,mainitem_code,mainitem_figure,
            customer_name,business_type,demand_type,
            doc_status,item_code,item_figure,
            item_figure_version,pruduct_qty,work_qty,
            op_num,work_center,dept,
            start_date,complete_date,next_dept,
            is_hold_release,is_out_source,org_code,
            order_id,now(),'0',org_code,doc_status,std_op,op_status,next_op_name,
            case when substr(item_code,0,4)='A65' then 'gas' else  'piping' end as plan_type,
            order_create_time,
            approve_on,
            start_work_date,
            low_order_code
        from aps_work_order_job
        where ( doc_status in (0,1,2,4) and is_hold_release='0'
            and (item_code like 'A65%' or item_code like 'W%'));
    </insert>
 
    <delete id="deleteAllWorkOrderJob" >
        delete from aps_work_order_job where del_flag in ('0','1')
    </delete>
</mapper>