|
@@ -219,22 +219,6 @@
|
|
|
and apope.PLANENDDATE > #{needScheduleDate} -- 计划完工时间大于调度开始时间,即占用了调度时间
|
|
|
and apo.PROCESS != '铸轧'
|
|
|
and apope.TENANTID = #{tenantId};
|
|
|
- update
|
|
|
- aps_process_operation_process_equ apope
|
|
|
- join aps_process_operation apo on apo.ID = apope.PROCESSID
|
|
|
- left join aps_process_operation_process_equ preapope on apope.PREVIOUSPROCESSESIDS = preapope.id AND preapope.DELETED = '0'
|
|
|
- set
|
|
|
- apope.PLANSTARTDATE=DATE_SUB(date_add(preapope.PLANENDDATE, INTERVAL ifnull(apo.MAXFLOWWAITMIN,0) MINUTE),INTERVAL TIMESTAMPdiff(SECOND, apope.PLANSTARTDATE, apope.PLANENDDATE) SECOND),
|
|
|
- apope.PLANENDDATE=date_add(preapope.PLANENDDATE, INTERVAL ifnull(apo.MAXFLOWWAITMIN,0) MINUTE)
|
|
|
- WHERE
|
|
|
- apope.deleted = '0' AND apo.DELETED = '0'
|
|
|
- and apope.TENANTID = #{tenantId}
|
|
|
- and apo.PROCESS != '铸轧'
|
|
|
- and apope.WORKSTATUS = '待开工'
|
|
|
- and apope.PLANSTARTDATE between #{chongpaiStartDate} and #{chongpaiEndDate} -- 占用调度时间范围内
|
|
|
- and ifnull(apo.MAXFLOWWAITMIN,0) > 0 -- 有最大流转等待时间
|
|
|
- AND ifnull(apope.PREVIOUSPROCESSESIDS,'') != '' -- 有前道
|
|
|
- and date_add(preapope.PLANENDDATE, INTERVAL ifnull(apo.MAXFLOWWAITMIN,0) MINUTE) < #{chongpaiStartDate} -- 前道完工时间+最大流转时间小于调度开始时间
|
|
|
</update>
|
|
|
<update id="removeLockNextDayProcessEqu">
|
|
|
with tomorroworder as(
|