Commit db5b0ce3 authored by 高飞's avatar 高飞

修改定时器改为oracle job

parent aea918b5
......@@ -35,9 +35,9 @@ public class ScheduleTaskConfig {
Integer result = traffFlowService.statisVehiclesByDay(date);
//抽取前一天的事件统计到新表中
Integer resultrecord = traffalarmrecordService.statisTraffalarmrecordstatByDay(date);
//删除当天的数据
traffFlowService.deleteVehiclesByDay();
//
// //删除当天的数据
// traffFlowService.deleteVehiclesByDay();
}
......@@ -52,14 +52,14 @@ public class ScheduleTaskConfig {
}
}
@Scheduled(cron = "0 30/5 6-19 * * ?")//每隔5分钟统计当天目前为止的数据
private void statistoday() {
//判断是否为空表
//执行查询存在更新,不存在新增
log.info("每隔5分钟");
Integer result= traffFlowService.insertOrUpdatevehicleTodaystatistic();
log.info("today"+result);
}
// @Scheduled(cron = "0 30/5 6-19 * * ?")//每隔5分钟统计当天目前为止的数据
// private void statistoday() {
// //判断是否为空表
// //执行查询存在更新,不存在新增
// log.info("每隔5分钟");
// Integer result= traffFlowService.insertOrUpdatevehicleTodaystatistic();
// log.info("today"+result);
//
// }
}
......@@ -115,7 +115,7 @@
SELECT
video_id,
TO_CHAR (CREATE_TIME, 'yyyy-mm-dd') ts,
TYPE,ruletag,
TYPE,nvl(ruletag,0)ruletag,
COUNT (*) total,
NVL(sum(case when CREATE_TIME>= (SYSDATE-5/1440) then 1 else 0 end),0)five
FROM
......@@ -140,8 +140,8 @@
) t2 ON (
t1.video_id = t2.video_id
AND t1.ts = t2.ts
AND t1. TYPE = t2. TYPE
and t1.ruletag=t2.ruletag
AND t1.TYPE = t2.TYPE
AND t1.ruletag=t2.ruletag
)
WHEN MATCHED THEN
UPDATE
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment