|
@@ -189,6 +189,45 @@
|
|
|
</foreach>
|
|
|
</where>
|
|
|
</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
|
|
|
+ where
|
|
|
+ apo.DELETED='0' and apope.deleted='0'
|
|
|
+ and apope.ACTUALFINISHDATE > DATE_ADD(CURRENT_DATE,INTERVAL 1 DAY)
|
|
|
+ and apo.PROCESS != '铸轧'
|
|
|
+ </update>
|
|
|
+ <update id="removeLockNextDayProcessEqu">
|
|
|
+ with tomorroworder as(
|
|
|
+ select DISTINCT apope.blankid
|
|
|
+ from aps_process_operation_process_equ apope
|
|
|
+ where apope.deleted='0'
|
|
|
+ and DATE(apope.PLANSTARTDATE) = #{needScheduleDate}
|
|
|
+ )
|
|
|
+ update
|
|
|
+ aps_process_operation_process_equ apope
|
|
|
+ join aps_process_operation apo on apo.id = apope.PROCESSID
|
|
|
+ join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
+ join tomorroworder on apope.blankid=tomorroworder.blankid
|
|
|
+ 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 > #{needScheduleDate}
|
|
|
+ </update>
|
|
|
+ <update id="removeLockNextTwoDayProcessEqu">
|
|
|
+ update
|
|
|
+ aps_process_operation_process_equ apope
|
|
|
+ join aps_process_operation apo on apo.id = apope.PROCESSID
|
|
|
+ join aps_blank_order abo on apo.BLANKID = abo.id
|
|
|
+ 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)
|
|
|
+ </update>
|
|
|
<select id="checkConflictByBlankId" resultType="java.lang.Integer">
|
|
|
select count(*) from aps_process_operation_process_equ
|
|
|
<where>
|