Commit 012b69dd by 杨林龙

统计设备离线时间

1 parent eec90c6b
...@@ -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
...@@ -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);
......
...@@ -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 &lt; #{lostBegin} and tdl.last_bs_time &lt; #{lostBegin} and td.source = 1)
or (tdl.last_bs_time &lt; #{lostBegin} and td.source = 0))
</if>
</select>
</mapper> </mapper>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!