| | |
| | | import com.ycl.api.CommonResult; |
| | | import com.ycl.dto.trend.TrendAnalysisParam; |
| | | import com.ycl.service.trend.TrendAnalysisService; |
| | | import com.ycl.vo.TrendAnalysisVo; |
| | | import com.ycl.vo.TrendVo; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | return CommonResult.success(trendAnalysisService.queryPointInfo(longitude,latitude)); |
| | | } |
| | | |
| | | @ApiOperation("点位数据查询") |
| | | @GetMapping("/queryPointInfoByTime") |
| | | public CommonResult<TrendAnalysisVo> queryPointInfoByTime(@RequestParam Long pointId, |
| | | @RequestParam(required = false) String startTime, |
| | | @RequestParam(required = false) String endTime) { |
| | | return CommonResult.success(trendAnalysisService.queryPointInfoByTime(pointId, startTime, endTime)); |
| | | } |
| | | |
| | | @ApiOperation("首次报警点位数据查询") |
| | | @PostMapping("/firstInfo") |
| | | public CommonResult<List<TrendVo>> queryListByCount(@RequestBody TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) { |
| | |
| | | @ExcelIgnore |
| | | private Long id; |
| | | |
| | | @ExcelIgnore |
| | | private String regionIds; |
| | | // @ExcelIgnore |
| | | // private String regionIds; |
| | | |
| | | /** |
| | | * 部门名称 |
| | |
| | | |
| | | |
| | | List<TrendVo> selectTrendPointInfo(String longitude, String latitude); |
| | | |
| | | List<TrendVo> queryPointInfoByTime(@Param("pointId") Long pointId, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | |
| | | List<TrendVo> queryPointInfoTypeByTime(@Param("pointId") Long pointId, @Param("startTime") String startTime, @Param("endTime") String endTime); |
| | | } |
| | |
| | | package com.ycl.service.trend; |
| | | |
| | | import com.ycl.dto.trend.TrendAnalysisParam; |
| | | import com.ycl.vo.TrendAnalysisVo; |
| | | import com.ycl.vo.TrendVo; |
| | | |
| | | import java.util.List; |
| | |
| | | List<TrendVo> queryListByCount(TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum); |
| | | |
| | | List<TrendVo> queryPointInfo(String longitude, String latitude); |
| | | |
| | | TrendAnalysisVo queryPointInfoByTime(Long pointId, String startTime, String endTime); |
| | | } |
| | |
| | | import com.ycl.dto.trend.TrendAnalysisParam; |
| | | import com.ycl.mapper.trend.TrendAnalysisMapper; |
| | | import com.ycl.service.trend.TrendAnalysisService; |
| | | import com.ycl.vo.TrendAnalysisVo; |
| | | import com.ycl.vo.TrendVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.autoconfigure.amqp.RabbitProperties; |
| | |
| | | } |
| | | |
| | | @Override |
| | | public TrendAnalysisVo queryPointInfoByTime(Long pointId, String startTime, String endTime) { |
| | | TrendAnalysisVo vo = new TrendAnalysisVo(); |
| | | vo.setTimeList(trendAnalysisMapper.queryPointInfoByTime(pointId, startTime, endTime)); |
| | | vo.setTypeList(trendAnalysisMapper.queryPointInfoTypeByTime(pointId, startTime, endTime)); |
| | | return vo; |
| | | } |
| | | |
| | | @Override |
| | | public List<TrendVo> queryListByCount(TrendAnalysisParam trendAnalysisParam, Integer pageSize, Integer pageNum) { |
| | | return trendAnalysisMapper.selectTrendInfo(trendAnalysisParam).stream().filter(item->1==item.getCount()).collect(Collectors.toList()); |
| | | } |
| | |
| | | |
| | | private IPage<UnlawfulDto> getUnlawfulDtoIPage(Double total, IPage<UnlawfulDto> page1) { |
| | | page1.getRecords().forEach(dto -> { |
| | | dto.setRatio(StringUtils.doubleTwo((double) dto.getCount() / total)); |
| | | dto.setRegisterRatio(StringUtils.doubleTwo((double) dto.getRegister() / (double) dto.getCount())); |
| | | dto.setCheckedRatio(StringUtils.doubleTwo((double) dto.getChecked() / (double) dto.getCount())); |
| | | dto.setAccuracyRatio(StringUtils.doubleTwo(1.0 - (double) dto.getRelearn() / (double) dto.getCount())); |
| | | dto.setRatio(StringUtils.doubleTwo((double) dto.getCount() * 100 / total) + "%"); |
| | | dto.setRegisterRatio(StringUtils.doubleTwo((double) dto.getRegister() * 100 / (double) dto.getCount()) + "%"); |
| | | dto.setCheckedRatio(StringUtils.doubleTwo((double) dto.getChecked() * 100 / (double) dto.getCount()) + "%"); |
| | | dto.setAccuracyRatio(StringUtils.doubleTwo(1.0 - (double) dto.getRelearn() * 100 / (double) dto.getCount()) + "%"); |
| | | |
| | | }); |
| | | return page1; |
New file |
| | |
| | | package com.ycl.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | @ApiModel(value = "趋势分析") |
| | | public class TrendAnalysisVo { |
| | | List<TrendVo> timeList; |
| | | List<TrendVo> typeList; |
| | | } |
| | |
| | | </where> |
| | | GROUP BY |
| | | t1.video_point_id,DATE_FORMAT(t3.alarm_time,"%Y-%m-%d") |
| | | </select> |
| | | <select id="queryPointInfoByTime" resultType="com.ycl.vo.TrendVo"> |
| | | SELECT t2.address, DATE_FORMAT(t3.alarm_time,"%Y-%m-%d") as dateTime,count(0) as count |
| | | FROM |
| | | ums_violations t1 |
| | | LEFT JOIN ums_video_point t2 ON t2.id = t1.video_point_id |
| | | LEFT JOIN ums_video_alarm_report t3 ON t3.id = t1.video_alarm_report_id |
| | | where t1.video_point_id = #{pointId} |
| | | <if test="startTime!=null and startTime != ''"> |
| | | and t3.alarm_time BETWEEN #{startTime} and #{endTime} |
| | | </if> |
| | | |
| | | GROUP BY |
| | | t1.video_point_id,DATE_FORMAT(t3.alarm_time,"%Y-%m-%d") |
| | | order by DATE_FORMAT(t3.alarm_time,"%Y-%m-%d") |
| | | </select> |
| | | <select id="queryPointInfoTypeByTime" resultType="com.ycl.vo.TrendVo"> |
| | | SELECT t3.algo_name as name,count(0) as count |
| | | FROM |
| | | ums_violations t1 |
| | | LEFT JOIN ums_video_point t2 ON t2.id = t1.video_point_id |
| | | LEFT JOIN ums_video_alarm_report t3 ON t3.id = t1.video_alarm_report_id |
| | | where t3.algo_name is not null |
| | | and t1.video_point_id = #{pointId} |
| | | <if test="startTime!=null and startTime != ''"> |
| | | and t3.alarm_time BETWEEN #{startTime} and #{endTime} |
| | | </if> |
| | | GROUP BY t3.algo_name |
| | | order by t3.algo_name |
| | | </select> |
| | | |
| | | </mapper> |