|
@@ -175,9 +175,10 @@
|
|
|
Date(a6.PROMISEDELIVERYDATE) as PROMISEDELIVERYDATE,
|
|
|
Date(a6.SCHEDULEDELIVERYDATE) as SCHEDULEDELIVERYDATE,
|
|
|
if((a6.PROMISEDELIVERYDATE is not null and DATE(a6.SCHEDULEDELIVERYDATE)> DATE(a6.PROMISEDELIVERYDATE))
|
|
|
- or ((a6.PROMISEDELIVERYDATE is null or DATE(a6.SCHEDULEDELIVERYDATE) <= DATE(a6.PROMISEDELIVERYDATE)) and
|
|
|
+ or ((a6.PROMISEDELIVERYDATE is null or DATE(a6.SCHEDULEDELIVERYDATE) <= DATE(a6.PROMISEDELIVERYDATE)) and
|
|
|
DATE(a6.SCHEDULEDELIVERYDATE)> DATE(a6.DELIVERYDATE)
|
|
|
- ),1,0) as conflict
|
|
|
+ ),1,0) as conflict,
|
|
|
+ a1.CONFLICTLEVEL
|
|
|
FROM
|
|
|
aps_process_operation_process_equ a1
|
|
|
LEFT JOIN aps_process_operation a2 ON a1.PROCESSID = a2.ID
|
|
@@ -186,6 +187,10 @@
|
|
|
LEFT JOIN aps_product_detail a5 ON a4.PRODUCTID = a5.ID
|
|
|
LEFT JOIN aps_production_order a6 on a6.ID= a5.MAINID
|
|
|
LEFT JOIN aps_customer_management a7 on a6.CUSTOMID= a7.ID
|
|
|
+ <if test="productionLineIds != null and productionLineIds.size()>0">
|
|
|
+ LEFT JOIN aps_resources_equipment ape on ape.EQUIPMENTID = a1.PROCESSDEVICEID
|
|
|
+ LEFT JOIN aps_production_line apl on ape.MAINID =apl.ID
|
|
|
+ </if>
|
|
|
<where>
|
|
|
a1.DELETED ='0'
|
|
|
AND a2.DELETED = '0'
|
|
@@ -193,21 +198,37 @@
|
|
|
AND a4.DELETED = '0'
|
|
|
AND a5.DELETED = '0'
|
|
|
AND a6.DELETED='0'
|
|
|
+ <if test="productionLineIds != null and productionLineIds.size()>0">
|
|
|
+ AND ape.DELETED = '0'
|
|
|
+ AND apl.DELETED = '0'
|
|
|
+ </if>
|
|
|
<if test="workshopIds != null and workshopIds.size()>0">
|
|
|
and a1.PROCESSWORKSHOPID in
|
|
|
<foreach collection="workshopIds" item="workshopId" open="(" close=")" separator=",">
|
|
|
#{workshopId}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
- <if test="factoryId != null and factoryId != '' and factoryId != 'ALL'">and a1.TENANTID = #{factoryId}</if>
|
|
|
- <if test="startTime != null ">and a1.PLANSTARTDATE >= #{startTime}</if>
|
|
|
- <if test="endTime != null ">and a1.PLANENDDATE <= #{endTime}</if>
|
|
|
<if test="orderNos !=null and orderNos.size()>0">
|
|
|
- and a6.ORDERNO in
|
|
|
+ and a6.ORDERNO in
|
|
|
<foreach collection="orderNos" item="orderNo" open="(" close=")" separator=",">
|
|
|
#{orderNo}
|
|
|
</foreach>
|
|
|
</if>
|
|
|
+ <if test="equIds != null and equIds.size()>0">
|
|
|
+ and a1.PROCESSDEVICEID in
|
|
|
+ <foreach collection="equIds" item="equId" open="(" close=")" separator=",">
|
|
|
+ #{equId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="productionLineIds != null and productionLineIds.size()>0">
|
|
|
+ and apl.ID in
|
|
|
+ <foreach collection="productionLineIds" item="productionLineId" open="(" close=")" separator=",">
|
|
|
+ #{productionLineId}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <if test="factoryId != null and factoryId != '' and factoryId != 'ALL'">and a1.TENANTID = #{factoryId}</if>
|
|
|
+ <if test="startTime != null ">and a1.PLANSTARTDATE >= #{startTime}</if>
|
|
|
+ <if test="endTime != null ">and a1.PLANENDDATE <= #{endTime}</if>
|
|
|
<if test="processids != null ">and a1.PROCESSID in (${processids})</if>
|
|
|
</where>
|
|
|
order by a1.PLANSTARTDATE asc,a1.PLANENDDATE asc
|