Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
H
hzjtpushdateService
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
建金
hzjtpushdateService
Commits
db5b0ce3
Commit
db5b0ce3
authored
Dec 18, 2020
by
高飞
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改定时器改为oracle job
parent
aea918b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
+12
-12
src/main/resources/mapper/TraffFlow.xml
src/main/resources/mapper/TraffFlow.xml
+3
-3
No files found.
src/main/java/com/hzjt/config/ScheduleTaskConfig.java
View file @
db5b0ce3
...
@@ -35,9 +35,9 @@ public class ScheduleTaskConfig {
...
@@ -35,9 +35,9 @@ public class ScheduleTaskConfig {
Integer
result
=
traffFlowService
.
statisVehiclesByDay
(
date
);
Integer
result
=
traffFlowService
.
statisVehiclesByDay
(
date
);
//抽取前一天的事件统计到新表中
//抽取前一天的事件统计到新表中
Integer
resultrecord
=
traffalarmrecordService
.
statisTraffalarmrecordstatByDay
(
date
);
Integer
resultrecord
=
traffalarmrecordService
.
statisTraffalarmrecordstatByDay
(
date
);
//
//删除当天的数据
//
//删除当天的数据
traffFlowService
.
deleteVehiclesByDay
();
//
traffFlowService.deleteVehiclesByDay();
}
}
...
@@ -52,14 +52,14 @@ public class ScheduleTaskConfig {
...
@@ -52,14 +52,14 @@ public class ScheduleTaskConfig {
}
}
}
}
@Scheduled
(
cron
=
"0 30/5 6-19 * * ?"
)
//每隔5分钟统计当天目前为止的数据
//
@Scheduled(cron = "0 30/5 6-19 * * ?")//每隔5分钟统计当天目前为止的数据
private
void
statistoday
()
{
//
private void statistoday() {
//判断是否为空表
//
//判断是否为空表
//执行查询存在更新,不存在新增
//
//执行查询存在更新,不存在新增
log
.
info
(
"每隔5分钟"
);
//
log.info("每隔5分钟");
Integer
result
=
traffFlowService
.
insertOrUpdatevehicleTodaystatistic
();
//
Integer result= traffFlowService.insertOrUpdatevehicleTodaystatistic();
log
.
info
(
"today"
+
result
);
//
log.info("today"+result);
//
}
//
}
}
}
src/main/resources/mapper/TraffFlow.xml
View file @
db5b0ce3
...
@@ -115,7 +115,7 @@
...
@@ -115,7 +115,7 @@
SELECT
SELECT
video_id,
video_id,
TO_CHAR (CREATE_TIME, 'yyyy-mm-dd') ts,
TO_CHAR (CREATE_TIME, 'yyyy-mm-dd') ts,
TYPE,ruletag,
TYPE,
nvl(ruletag,0)
ruletag,
COUNT (*) total,
COUNT (*) total,
NVL(sum(case when CREATE_TIME>= (SYSDATE-5/1440) then 1 else 0 end),0)five
NVL(sum(case when CREATE_TIME>= (SYSDATE-5/1440) then 1 else 0 end),0)five
FROM
FROM
...
@@ -140,8 +140,8 @@
...
@@ -140,8 +140,8 @@
) t2 ON (
) t2 ON (
t1.video_id = t2.video_id
t1.video_id = t2.video_id
AND t1.ts = t2.ts
AND t1.ts = t2.ts
AND t1.
TYPE = t2.
TYPE
AND t1.
TYPE = t2.
TYPE
and
t1.ruletag=t2.ruletag
AND
t1.ruletag=t2.ruletag
)
)
WHEN MATCHED THEN
WHEN MATCHED THEN
UPDATE
UPDATE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment