Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-trialdrive-admin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 012b69dd
authored
Dec 27, 2021
by
杨林龙
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
统计设备离线时间
1 parent
eec90c6b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
0 deletions
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
src/main/resources/mapper/VehicleMapper.xml
src/main/java/cn/com/glsx/admin/modules/mapper/VehicleMapper.java
View file @
012b69d
...
@@ -10,6 +10,7 @@ import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
...
@@ -10,6 +10,7 @@ import com.glsx.plat.mybatis.mapper.CommonBaseMapper;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -221,4 +222,12 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
...
@@ -221,4 +222,12 @@ public interface VehicleMapper extends CommonBaseMapper<Vehicle> {
*/
*/
@DataPerm
(
showSql
=
true
)
@DataPerm
(
showSql
=
true
)
List
<
JourneyDailyExport
>
findJourneyDailyList
(
JourneyDailySearch
journeyDailySearch
);
List
<
JourneyDailyExport
>
findJourneyDailyList
(
JourneyDailySearch
journeyDailySearch
);
/**
* 统计设备离线报警
*
* @param lostBegin 离线时间
* @return
*/
Integer
getOffLineAlarmCount
(
@Param
(
"lostBegin"
)
Date
lostBegin
);
}
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/admin/modules/service/HomeService.java
View file @
012b69d
...
@@ -134,6 +134,11 @@ public class HomeService {
...
@@ -134,6 +134,11 @@ public class HomeService {
Integer
powerOffAlarmCount
=
remoteAlarmService
.
getPowerOffAlertCount
(
sns
,
startTime
,
endTime
);
Integer
powerOffAlarmCount
=
remoteAlarmService
.
getPowerOffAlertCount
(
sns
,
startTime
,
endTime
);
returnMap
.
put
(
"powerOffAlarmCount"
,
powerOffAlarmCount
);
returnMap
.
put
(
"powerOffAlarmCount"
,
powerOffAlarmCount
);
// 统计设备离线报警
Date
lostBegin
=
DateUtils
.
addHours
(
new
Date
(),
-
72
);
Integer
offLineAlarmCount
=
vehicleMapper
.
getOffLineAlarmCount
(
lostBegin
);
returnMap
.
put
(
"offLineAlarmCount"
,
offLineAlarmCount
);
// 查询大数据研判警情 大数据研判报警总数包括 聚集 黑区 二押
// 查询大数据研判警情 大数据研判报警总数包括 聚集 黑区 二押
Integer
stuJudgeAlarmCount
=
remoteStuJudgeAlarmService
.
getStuJudgeAlarmCount
(
sns
,
startTime
,
endTime
);
Integer
stuJudgeAlarmCount
=
remoteStuJudgeAlarmService
.
getStuJudgeAlarmCount
(
sns
,
startTime
,
endTime
);
returnMap
.
put
(
"stuJudgeAlarmCount"
,
stuJudgeAlarmCount
);
returnMap
.
put
(
"stuJudgeAlarmCount"
,
stuJudgeAlarmCount
);
...
...
src/main/resources/mapper/VehicleMapper.xml
View file @
012b69d
...
@@ -847,4 +847,18 @@
...
@@ -847,4 +847,18 @@
)
)
</if>
</if>
</select>
</select>
<select
id=
"getOffLineAlarmCount"
resultType=
"Integer"
>
SELECT count(1)
from t_vehicle tv
left join t_vehicle_device tvd on tvd.vehicle_id = tv.id
left join t_device_location tdl on tdl.sn = tvd.sn
left join t_device td on td.sn = tvd.sn
where 1= 1 and tvd.created_date > '2013-01-01 00:00:00.0'
<!--离线时间-->
<if
test=
"lostBegin != null"
>
and ((tdl.last_gps_time
<
#{lostBegin} and tdl.last_bs_time
<
#{lostBegin} and td.source = 1)
or (tdl.last_bs_time
<
#{lostBegin} and td.source = 0))
</if>
</select>
</mapper>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
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 post a comment