Ver Fonte

修改空判断首件历史

guozx há 3 anos atrás
pai
commit
ca334b4c41

+ 41 - 22
application-task/src/main/resources/mappers/OnsiteTaskMapper.xml

@@ -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) &lt; 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) &lt; 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)
+         &lt; 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)
+         &lt; now();
     </delete>
 
     <select id="getRemindWork" resultMap="calendarOnsite">