| | |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "每日预警、报警数量变化趋势", notes = "一周每日预警、报警数量统计,返回参数alarmDayCount为一周每日报警统计数量列表,参数warningDayCount为一周每日预警统计数量列表") |
| | | @ApiOperation(value = "每日预警报警数量变化趋势", notes = "一周每日预警、报警数量统计,返回参数alarmDayCount为一周每日报警统计数量列表,参数warningDayCount为一周每日预警统计数量列表") |
| | | @GetMapping("/everydayCount") |
| | | public Result everydayCount() { |
| | | return Result.OK(warningService.countEverydayAlarmAndWarning()); |
| | | public Result everydayCount(@RequestParam(value = "end", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | Date endDate = null == date ? new Date() : date; |
| | | return Result.OK(warningService.everydayCount(endDate)); |
| | | } |
| | | |
| | | @ApiOperationSupport(order = 4) |
| | |
| | | @GetMapping("/locationDataChange") |
| | | public Result locationDataChange(@RequestParam(value = "end", required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") Date date) { |
| | | Date endDate = null == date ? new Date() : date; |
| | | |
| | | return Result.OK(warningService.select3Hours(endDate)); |
| | | } |
| | | |
| | |
| | | |
| | | public List<Qxsh> selectMonthTop10(String time); |
| | | |
| | | public List<Qxsh> select3Hours(@Param("times") List<String> times); |
| | | |
| | | public Double selectLastYearVal(@Param("time") Integer time, @Param("name") String name); |
| | | public List<Qxsh> selectByBeginAndEnd(@Param("start") Integer start, @Param("end") Integer end); |
| | | |
| | | public Qxsh selectByTimeAndName(@Param("time") Integer time, @Param("name") String name); |
| | | |
| | | public List<Qxsh> selectByBeginAndEnd(@Param("start") Integer start, @Param("end") Integer end); |
| | | public List<Qxsh> selectForReport(@Param("start") Integer start, @Param("end") Integer end); |
| | | |
| | | public Double selectLastYearVal(@Param("time") Integer time, @Param("name") String name); |
| | | } |
| | |
| | | return result; |
| | | } |
| | | |
| | | public Map<String, List<Map<String, Object>>> countEverydayAlarmAndWarning() { |
| | | /** |
| | | * 每日预警、报警数量变化趋势 |
| | | */ |
| | | public Map<String, List<Map<String, Object>>> everydayCount(Date endDate) { |
| | | Integer end = Integer.parseInt(DateUtils.getYyyyMmDdHh(endDate)); |
| | | Date startDate = DateUtils.getAPeriodOfTime(endDate, -6, Calendar.DATE); |
| | | Integer start = Integer.parseInt(DateUtils.getYyyyMmDdHh(startDate)); |
| | | |
| | | |
| | | |
| | | |
| | | Map<String, List<Map<String, Object>>> result = new HashMap<>(); |
| | | |
| | | Map<String, Object> param = new HashMap<String, Object>(); |
| | |
| | | Integer start = Integer.parseInt(strStart); |
| | | Integer end = Integer.parseInt(strEnd); |
| | | |
| | | List<Qxsh> rsList = qxshMapper.selectByBeginAndEnd(start, end); |
| | | List<Qxsh> rsList = qxshMapper.selectForReport(start, end); |
| | | if (null == rsList || rsList.isEmpty()) return null; |
| | | |
| | | Hashtable<String, Boolean> dict = getExistTabDict(rsList); |
| | |
| | | |
| | | <select id="selectMonthTop10" resultType="com.yssh.entity.Qxsh"> |
| | | with rs as ( |
| | | select id, name, format(value, 2) "value", time |
| | | select id, name, lon, lat, format(value, 2) "value", time |
| | | from yssh_qxsh |
| | | where time like #{time} and name like 'AI-%' |
| | | ) |
| | | select id, name, value, time from rs |
| | | select id, name, lon, lat, value, time from rs |
| | | order by value desc |
| | | limit 10; |
| | | </select> |
| | | |
| | | <select id="select3Hours" resultType="com.yssh.entity.Qxsh"> |
| | | <select id="count7DayForWarn" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, format(value, 2) "value", time |
| | | from yssh_qxsh |
| | | where name like 'AI-%' and time in |
| | | <foreach collection="times" item="time" open="(" separator="," close=")"> |
| | | #{time} |
| | | </foreach> |
| | | order by name, time; |
| | | where time between #{start} and #{end} |
| | | and value > (select jcyj from alert_config limit 1) and name like 'AI-%' |
| | | order by time, name; |
| | | </select> |
| | | |
| | | <select id="selectByBeginAndEnd" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, lon, lat, format(value, 2) "value", time |
| | | from yssh_qxsh |
| | | where time between #{start} and #{end} |
| | | and value > (select jcyj from alert_config limit 1) and name like 'AI-%' |
| | | order by time, name; |
| | | </select> |
| | | |
| | | <select id="selectForReport" resultType="com.yssh.entity.Qxsh"> |
| | | select id, name, format(value, 2) "value", time |
| | | from yssh_qxsh |
| | | where time between #{start} and #{end} |