|
@@ -99,29 +99,48 @@
|
|
|
</select>
|
|
|
|
|
|
<delete id="delTaskOld">
|
|
|
- delete from onsite_task where id in(
|
|
|
- select a.id from onsite_calendar b,
|
|
|
- (
|
|
|
- select IF
|
|
|
- ( date_format( task_time, '%w' ) = 0,
|
|
|
- 7,
|
|
|
- date_format( task_time, '%w')
|
|
|
- ) wd , onsite_calendar_id,id
|
|
|
+ delete
|
|
|
from onsite_task
|
|
|
- ) a where a.onsite_calendar_id=b.id and a.wd!=b.week_day and b.type_flag=1
|
|
|
- )
|
|
|
- and ADDDATE(task_time, interval 1 day) < now() ;
|
|
|
-
|
|
|
-
|
|
|
- delete from onsite_task where id in(
|
|
|
- select a.id from onsite_calendar b,
|
|
|
- (
|
|
|
- select
|
|
|
- date_format( task_time, '%e') mh , onsite_calendar_id,id
|
|
|
- from onsite_task
|
|
|
- ) a where a.onsite_calendar_id=b.id and a.mh!=b.month_day and b.type_flag=2
|
|
|
- )
|
|
|
- and ADDDATE(task_time, interval 1 day) < now() ;
|
|
|
+ where id in (
|
|
|
+ select a.id
|
|
|
+ from onsite_calendar b,
|
|
|
+ (
|
|
|
+ select IF
|
|
|
+ (date_format(task_time, '%w') = 0,
|
|
|
+ 7,
|
|
|
+ date_format(task_time, '%w')
|
|
|
+ ) wd,
|
|
|
+ onsite_calendar_id,
|
|
|
+ id
|
|
|
+ from onsite_task
|
|
|
+ ) a
|
|
|
+ where a.onsite_calendar_id = b.id
|
|
|
+ and a.wd
|
|
|
+ !=b.week_day
|
|
|
+ and b.type_flag=1
|
|
|
+ )
|
|
|
+ and ADDDATE(task_time
|
|
|
+ , interval 1 day)
|
|
|
+ < now();
|
|
|
+
|
|
|
+
|
|
|
+ delete
|
|
|
+ from onsite_task
|
|
|
+ where id in (
|
|
|
+ select a.id
|
|
|
+ from onsite_calendar b,
|
|
|
+ (
|
|
|
+ select date_format(task_time, '%e') mh, onsite_calendar_id, id
|
|
|
+ from onsite_task
|
|
|
+ ) a
|
|
|
+ where a.onsite_calendar_id = b.id
|
|
|
+ and a.mh
|
|
|
+ !=b.month_day
|
|
|
+ and b.type_flag=2
|
|
|
+ )
|
|
|
+ and ADDDATE(task_time
|
|
|
+ , interval 1 day)
|
|
|
+ < now();
|
|
|
</delete>
|
|
|
|
|
|
<select id="getRemindWork" resultMap="calendarOnsite">
|