|
@@ -191,16 +191,17 @@
|
|
|
</update>
|
|
|
<update id="updateFinishDateAboutProcessEqu">
|
|
|
update
|
|
|
- aps_process_operation_process_equ apope
|
|
|
- join aps_process_operation apo on apo.id = apope.PROCESSID
|
|
|
- set
|
|
|
- apope.PLANSTARTDATE=DATE_SUB(apope.ACTUALFINISHDATE,INTERVAL TIMESTAMPdiff(SECOND, apope.PLANSTARTDATE, apope.PLANENDDATE) SECOND),
|
|
|
- apope.PLANENDDATE=apope.ACTUALFINISHDATE
|
|
|
+ aps_process_operation_process_equ apope
|
|
|
+ join aps_process_operation apo on apo.id = apope.PROCESSID
|
|
|
+ set
|
|
|
+ apope.PLANSTARTDATE=IF(apope.ACTUALFINISHDATE IS NOT NULL,DATE_SUB(apope.ACTUALFINISHDATE,INTERVAL TIMESTAMPdiff(SECOND, apope.PLANSTARTDATE, apope.PLANENDDATE) SECOND), apope.ACTUALSTARTDATE),
|
|
|
+ apope.PLANENDDATE=IF(apope.ACTUALFINISHDATE IS NOT NULL, apope.ACTUALFINISHDATE, DATE_ADD(apope.ACTUALSTARTDATE,INTERVAL TIMESTAMPdiff(SECOND, apope.PLANSTARTDATE, apope.PLANENDDATE) SECOND))
|
|
|
where
|
|
|
- apo.DELETED='0' and apope.deleted='0'
|
|
|
- and apope.ACTUALFINISHDATE is not null
|
|
|
- and apope.PLANENDDATE > CURRENT_TIME
|
|
|
- and apo.PROCESS != '铸轧'
|
|
|
+ apo.DELETED='0' and apope.deleted='0'
|
|
|
+ AND (apope.ACTUALSTARTDATE IS NOT NULL OR apope.ACTUALFINISHDATE IS NOT NULL)
|
|
|
+ and (apope.ACTUALSTARTDATE < apope.PLANSTARTDATE OR apope.ACTUALFINISHDATE < apope.PLANENDDATE)
|
|
|
+ and apope.PLANENDDATE > #{needScheduleDate}
|
|
|
+ and apo.PROCESS != '铸轧'
|
|
|
</update>
|
|
|
<update id="removeLockNextDayProcessEqu">
|
|
|
with tomorroworder as(
|
|
@@ -227,7 +228,7 @@
|
|
|
set apope.LOCKMARKDETAIL = 'n',apo.LOCKMARK='n',abo.SCHEDULINGSTATUS = '20'
|
|
|
where apope.deleted='0' and apo.deleted='0'
|
|
|
and apo.PROCESS != '铸轧' and apope.WORKSTATUS = '待开工'
|
|
|
- and apope.PLANSTARTDATE >= DATE_ADD(#{needScheduleDate},INTERVAL 2 DAY) and apope.PLANSTARTDATE < DATE_ADD(#{needScheduleDate},INTERVAL 3 DAY)
|
|
|
+ and apope.PLANSTARTDATE >= DATE_ADD(#{needScheduleDate},INTERVAL 1 DAY) and apope.PLANSTARTDATE < DATE_ADD(#{needScheduleDate},INTERVAL 2 DAY)
|
|
|
</update>
|
|
|
<select id="checkConflictByBlankId" resultType="java.lang.Integer">
|
|
|
select count(*) from aps_process_operation_process_equ
|