|
@@ -232,6 +232,36 @@
|
|
and apo.PROCESS != '铸轧' and apope.WORKSTATUS = '待开工'
|
|
and apo.PROCESS != '铸轧' and apope.WORKSTATUS = '待开工'
|
|
and apope.PLANSTARTDATE >= DATE_ADD(#{needScheduleDate},INTERVAL 1 DAY) and apope.PLANSTARTDATE < DATE_ADD(#{needScheduleDate},INTERVAL 2 DAY)
|
|
and apope.PLANSTARTDATE >= DATE_ADD(#{needScheduleDate},INTERVAL 1 DAY) and apope.PLANSTARTDATE < DATE_ADD(#{needScheduleDate},INTERVAL 2 DAY)
|
|
</update>
|
|
</update>
|
|
|
|
+ <update id="setLenZhaNextDay">
|
|
|
|
+ update
|
|
|
|
+ aps_process_operation apo
|
|
|
|
+ JOIN aps_process_operation_process_equ apope ON apo.ID = apope.PROCESSID AND apope.DELETED = 0
|
|
|
|
+ set
|
|
|
|
+ apope.PLANSTARTDATE=DATE_ADD(apope.PLANSTARTDATE, INTERVAL 1 DAY),
|
|
|
|
+ apope.PLANENDDATE=DATE_ADD(apope.PLANENDDATE, INTERVAL 1 DAY)
|
|
|
|
+ WHERE
|
|
|
|
+ apo.DELETED = '0'
|
|
|
|
+ and apope.TENANTID = #{tenantId}
|
|
|
|
+ and apo.PROCESS not in ('铸轧','中退','成退','小卷成退')
|
|
|
|
+ and apope.WORKSTATUS = '待开工'
|
|
|
|
+ and apope.PLANSTARTDATE between #{chongpaiStartDate} and #{chongpaiEndDate} -- 调度开始时间之后计划开工
|
|
|
|
+ and apope.LOCKMARKDETAIL = 'y'
|
|
|
|
+ </update>
|
|
|
|
+ <update id="setTuiHuoNextDay">
|
|
|
|
+ update
|
|
|
|
+ aps_process_operation apo
|
|
|
|
+ JOIN aps_process_operation_process_equ apope ON apo.ID = apope.PROCESSID AND apope.DELETED = 0
|
|
|
|
+ set
|
|
|
|
+ apope.PLANSTARTDATE=DATE_ADD(apope.PLANSTARTDATE, INTERVAL 1 DAY),
|
|
|
|
+ apope.PLANENDDATE=DATE_ADD(apope.PLANENDDATE, INTERVAL 1 DAY)
|
|
|
|
+ WHERE
|
|
|
|
+ apo.DELETED = '0'
|
|
|
|
+ and apope.TENANTID = #{tenantId}
|
|
|
|
+ and apo.PROCESS in ('中退','成退','小卷成退')
|
|
|
|
+ and apope.WORKSTATUS = '待开工'
|
|
|
|
+ and apope.PLANSTARTDATE between #{chongpaiStartDate} and #{chongpaiEndDate} -- 调度开始时间之后计划开工
|
|
|
|
+ and apope.LOCKMARKDETAIL = 'y'
|
|
|
|
+ </update>
|
|
<select id="checkConflictByBlankId" resultType="java.lang.Integer">
|
|
<select id="checkConflictByBlankId" resultType="java.lang.Integer">
|
|
select count(*) from aps_process_operation_process_equ
|
|
select count(*) from aps_process_operation_process_equ
|
|
<where>
|
|
<where>
|
|
@@ -426,7 +456,7 @@
|
|
<select id="selectNeedRescheduleEqu2"
|
|
<select id="selectNeedRescheduleEqu2"
|
|
resultType="com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo">
|
|
resultType="com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo">
|
|
SELECT apope.*
|
|
SELECT apope.*
|
|
- FROM
|
|
|
|
|
|
+ from
|
|
aps_process_operation_process_equ apope
|
|
aps_process_operation_process_equ apope
|
|
join aps_process_operation apo on apo.ID = apope.PROCESSID
|
|
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'
|
|
left join aps_process_operation_process_equ preapope on apope.PREVIOUSPROCESSESIDS = preapope.id AND preapope.DELETED = '0'
|
|
@@ -435,19 +465,24 @@
|
|
and apope.TENANTID = #{tenantId}
|
|
and apope.TENANTID = #{tenantId}
|
|
and apo.PROCESS in ('中退','成退','小卷成退')
|
|
and apo.PROCESS in ('中退','成退','小卷成退')
|
|
and apope.WORKSTATUS = '待开工'
|
|
and apope.WORKSTATUS = '待开工'
|
|
- and apope.PLANSTARTDATE >= #{chongpaiStartDate} -- 调度开始时间之后开工
|
|
|
|
- AND (apope.PLANSTARTDATE <= #{chongpaiEndDate} -- 调度结束时间之前开工
|
|
|
|
- OR date_add(preapope.PLANENDDATE, -- 前道计划完工时间 + 流转时间
|
|
|
|
- INTERVAL GREATEST(ifnull(apo.MINFLOWWAITMIN,0), -- 最小流转等待时间
|
|
|
|
- if(apope.PROCESSWORKSHOPID!=preapope.PROCESSWORKSHOPID,#{workshopcross}, -- 车间流转时间
|
|
|
|
- if(apope.PROCESSDEVICEID!=preapope.PROCESSDEVICEID,#{workshopin},0))) MINUTE -- 机台流转时间
|
|
|
|
- ) <= #{chongpaiEndDate} -- 调度结束时间之前可以开工
|
|
|
|
|
|
+ and apope.PLANSTARTDATE >= #{chongpaiStartDate} -- 调度开始时间之后计划开工
|
|
|
|
+ AND (
|
|
|
|
+ apope.PLANSTARTDATE <= #{chongpaiEndDate} OR
|
|
|
|
+ (ifnull(apope.PREVIOUSPROCESSESIDS,'')='' -- 没有前道
|
|
|
|
+ and apope.PLANSTARTDATE < DATE_ADD(#{chongpaiStartDate}, INTERVAL 3 DAY)) -- 调度开始时间+5天内计划开工
|
|
|
|
+ OR (ifnull(apope.PREVIOUSPROCESSESIDS,'')!='' -- 有前道
|
|
|
|
+ and preapope.PLANSTARTDATE <= #{chongpaiStartDate} -- 前道计划开工时间在调度开始时间之前,表示该作业是需要调度的作业的第一道
|
|
|
|
+ and date_add(preapope.PLANENDDATE, -- 前道计划完工时间 + 流转时间 小于 调度结束时间
|
|
|
|
+ INTERVAL GREATEST(ifnull(apo.MINFLOWWAITMIN,0), -- 最小流转等待时间
|
|
|
|
+ if(apope.PROCESSWORKSHOPID!=preapope.PROCESSWORKSHOPID,#{workshopcross}, -- 车间流转时间
|
|
|
|
+ if(apope.PROCESSDEVICEID!=preapope.PROCESSDEVICEID,#{workshopin},0))) MINUTE -- 机台流转时间
|
|
|
|
+ ) <= #{chongpaiEndDate}) -- 调度结束时间之前可以开工
|
|
)
|
|
)
|
|
</select>
|
|
</select>
|
|
<select id="selectNeedRescheduleEqu3"
|
|
<select id="selectNeedRescheduleEqu3"
|
|
resultType="com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo">
|
|
resultType="com.rongwei.bsentity.domain.ApsProcessOperationProcessEquDo">
|
|
SELECT apope.*
|
|
SELECT apope.*
|
|
- FROM
|
|
|
|
|
|
+ from
|
|
aps_process_operation_process_equ apope
|
|
aps_process_operation_process_equ apope
|
|
join aps_process_operation apo on apo.ID = apope.PROCESSID
|
|
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'
|
|
left join aps_process_operation_process_equ preapope on apope.PREVIOUSPROCESSESIDS = preapope.id AND preapope.DELETED = '0'
|
|
@@ -456,13 +491,18 @@
|
|
and apope.TENANTID = #{tenantId}
|
|
and apope.TENANTID = #{tenantId}
|
|
and apo.PROCESS not in ('铸轧','中退','成退','小卷成退')
|
|
and apo.PROCESS not in ('铸轧','中退','成退','小卷成退')
|
|
and apope.WORKSTATUS = '待开工'
|
|
and apope.WORKSTATUS = '待开工'
|
|
- and apope.PLANSTARTDATE >= #{chongpaiStartDate} -- 调度开始时间之后开工
|
|
|
|
- AND (apope.PLANSTARTDATE <= #{chongpaiEndDate} -- 调度结束时间之前开工
|
|
|
|
- OR date_add(preapope.PLANENDDATE, -- 前道计划完工时间 + 流转时间
|
|
|
|
|
|
+ and apope.PLANSTARTDATE >= #{chongpaiStartDate} -- 调度开始时间之后计划开工
|
|
|
|
+ AND (
|
|
|
|
+ apope.PLANSTARTDATE <= #{chongpaiEndDate} OR
|
|
|
|
+ (ifnull(apope.PREVIOUSPROCESSESIDS,'')='' -- 没有前道
|
|
|
|
+ and apope.PLANSTARTDATE < DATE_ADD(#{chongpaiStartDate}, INTERVAL 3 DAY)) -- 调度开始时间+5天内计划开工
|
|
|
|
+ OR (ifnull(apope.PREVIOUSPROCESSESIDS,'')!='' -- 有前道
|
|
|
|
+ and preapope.PLANSTARTDATE <= #{chongpaiStartDate} -- 前道计划开工时间在调度开始时间之前,表示该作业是需要调度的作业的第一道
|
|
|
|
+ and date_add(preapope.PLANENDDATE, -- 前道计划完工时间 + 流转时间 小于 调度结束时间
|
|
INTERVAL GREATEST(ifnull(apo.MINFLOWWAITMIN,0), -- 最小流转等待时间
|
|
INTERVAL GREATEST(ifnull(apo.MINFLOWWAITMIN,0), -- 最小流转等待时间
|
|
if(apope.PROCESSWORKSHOPID!=preapope.PROCESSWORKSHOPID,#{workshopcross}, -- 车间流转时间
|
|
if(apope.PROCESSWORKSHOPID!=preapope.PROCESSWORKSHOPID,#{workshopcross}, -- 车间流转时间
|
|
if(apope.PROCESSDEVICEID!=preapope.PROCESSDEVICEID,#{workshopin},0))) MINUTE -- 机台流转时间
|
|
if(apope.PROCESSDEVICEID!=preapope.PROCESSDEVICEID,#{workshopin},0))) MINUTE -- 机台流转时间
|
|
- ) <= #{chongpaiEndDate} -- 调度结束时间之前可以开工
|
|
|
|
|
|
+ ) <= #{chongpaiEndDate}) -- 调度结束时间之前可以开工
|
|
)
|
|
)
|
|
</select>
|
|
</select>
|
|
</mapper>
|
|
</mapper>
|