| | |
| | | IPage<UnlawfulDto> page = new Page<>(); |
| | | List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByType((currentPage - 1) * pageSize, pageSize, startTime, endTime1); |
| | | |
| | | page.setTotal(unlawfulByType.size()); |
| | | page.setTotal(unlawfulService.getTotalByType(startTime, endTime1)); |
| | | page.setRecords(unlawfulByType); |
| | | return CommonResult.success(page); |
| | | } |
| | |
| | | IPage<UnlawfulDto> page = new Page<>(); |
| | | List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1); |
| | | |
| | | page.setTotal(unlawfulByType.size()); |
| | | page.setTotal(unlawfulService.getTotalBySite(startTime, endTime1)); |
| | | page.setRecords(unlawfulByType); |
| | | return CommonResult.success(page); |
| | | } |
| | |
| | | } |
| | | IPage<UnlawfulDto> page = new Page<>(); |
| | | List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByTime((currentPage - 1) * pageSize, pageSize, startTime, endTime1); |
| | | |
| | | page.setTotal(unlawfulByType.size()); |
| | | page.setTotal(unlawfulService.getTotalByTime(startTime, endTime1)); |
| | | page.setRecords(unlawfulByType); |
| | | return CommonResult.success(page); |
| | | } |
| | |
| | | endTime1 = beginTime.format(fmt); |
| | | } |
| | | IPage<UnlawfulDto> page = new Page<>(); |
| | | List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1); |
| | | List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByStreet((currentPage - 1) * pageSize, pageSize, startTime, endTime1); |
| | | |
| | | page.setTotal(unlawfulByType.size()); |
| | | page.setTotal(unlawfulService.getTotalByStreet(startTime, endTime1)); |
| | | page.setRecords(unlawfulByType); |
| | | return CommonResult.success(page); |
| | | } |
| | |
| | | EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulBySiteExport); |
| | | } |
| | | |
| | | @PostMapping("/export/unlawful/time") |
| | | @ApiOperation("按报警点位统计方式-导出") |
| | | public void exportTime(HttpServletResponse response) { |
| | | List<UnlawfulDto> unlawfulBySiteExport = unlawfulService.getUnlawfulByTimeExport(); |
| | | String sheetName = "按报警点位统计方式"; |
| | | EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulBySiteExport); |
| | | } |
| | | |
| | | /*@PostMapping("/export/shop") |
| | | @ApiOperation("门前三包-导出") |
| | | public void exportShop(HttpServletResponse response) { |
| | |
| | | StatusDto getStatusDataByTime(String startTime, String endTime, Integer id); |
| | | List<TimeDto> getDataByTimeExp(); |
| | | |
| | | |
| | | /** |
| | | * 获取分页总数 |
| | | */ |
| | | Integer getTotalByType(String startTime, String endTime); |
| | | Integer getTotalByStreet(String startTime, String endTime); |
| | | Integer getTotalBySite(String startTime, String endTime); |
| | | Integer getTotalByTime(String startTime, String endTime); |
| | | |
| | | |
| | | |
| | |
| | | */ |
| | | public List<UnlawfulDto> getUnlawfulByType(Integer currentPage, Integer pageSize, String startTime, String endTime); |
| | | public List<UnlawfulDto> getUnlawfulByTypeExport(); |
| | | public Integer getTotalByType(String startTime, String endTime); |
| | | |
| | | /** |
| | | * 按区域 |
| | | */ |
| | | public List<UnlawfulDto> getUnlawfulByStreet(Integer currentPage, Integer pageSize, String startTime, String endTime); |
| | | public List<UnlawfulDto> getUnlawfulByStreetExport(); |
| | | public Integer getTotalByStreet(String startTime, String endTime); |
| | | |
| | | /** |
| | | * 按报警点位 |
| | | */ |
| | | public List<UnlawfulDto> getUnlawfulBySite(Integer currentPage, Integer pageSize, String startTime, String endTime); |
| | | |
| | | public List<UnlawfulDto> getUnlawfulBySiteExport(); |
| | | public Integer getTotalBySite(String startTime, String endTime); |
| | | |
| | | /** |
| | | * 按报警时间 |
| | | */ |
| | | public List<UnlawfulDto> getUnlawfulByTime(Integer currentPage, Integer pageSize, String startTime, String endTime); |
| | | |
| | | public List<UnlawfulDto> getUnlawfulByTimeExport(); |
| | | public Integer getTotalByTime(String startTime, String endTime); |
| | | } |
| | |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getTotalByType(String startTime, String endTime) { |
| | | return unlawfuldao.getTotalByType(startTime, endTime); |
| | | } |
| | | |
| | | /** |
| | | * 按区域 |
| | | */ |
| | |
| | | format(res, total, categoryDto, statusData); |
| | | }); |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getTotalByStreet(String startTime, String endTime) { |
| | | return unlawfuldao.getTotalByStreet(startTime, endTime); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Integer getTotalBySite(String startTime, String endTime) { |
| | | return unlawfuldao.getTotalBySite(startTime, endTime); |
| | | } |
| | | |
| | | @Override |
| | | public List<UnlawfulDto> getUnlawfulByTime(Integer currentPage, Integer pageSize, String startTime, String endTime) { |
| | | List<UnlawfulDto> res = new ArrayList<>(); |
| | | Double total = unlawfuldao.getTotal().doubleValue(); |
| | |
| | | }); |
| | | return res; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public List<UnlawfulDto> getUnlawfulByTimeExport() { |
| | |
| | | return res; |
| | | } |
| | | |
| | | @Override |
| | | public Integer getTotalByTime(String startTime, String endTime) { |
| | | return unlawfuldao.getTotalBySite(startTime, endTime); |
| | | } |
| | | |
| | | private Double changeFormat(Double previous){ |
| | | NumberFormat numberInstance = NumberFormat.getNumberInstance(); |
| | | numberInstance.setMaximumFractionDigits(2); |
| | | numberInstance.setMaximumFractionDigits(3); |
| | | numberInstance.setRoundingMode(RoundingMode.HALF_UP); |
| | | String format = numberInstance.format(previous); |
| | | return Double.parseDouble(format); |
| | |
| | | group by |
| | | ubc.alarm_time |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 分页数量--> |
| | | <select id="getTotalByType" resultType="java.lang.Integer"> |
| | | select |
| | | SUM(num) |
| | | from( |
| | | SELECT |
| | | count(*) num |
| | | FROM |
| | | `ums_base_case` AS ubc |
| | | JOIN ums_violations AS uv ON ubc.id = uv.id |
| | | LEFT JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id |
| | | LEFT JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id |
| | | LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id |
| | | WHERE |
| | | ubc.category =1 |
| | | and t4.`name` is NOT NULL |
| | | <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null"> |
| | | and ubc.create_time between #{startTime} and #{endTime} |
| | | </if> |
| | | group by |
| | | t4.id |
| | | ) a |
| | | </select> |
| | | <select id="getTotalByStreet" resultType="java.lang.Integer"> |
| | | select |
| | | SUM(num) |
| | | from( |
| | | SELECT |
| | | count(*) num |
| | | FROM |
| | | `ums_base_case` AS ubc |
| | | JOIN ums_violations AS uv ON ubc.id = uv.id |
| | | LEFT JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id |
| | | LEFT JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id |
| | | LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id |
| | | WHERE |
| | | ubc.category = 1 |
| | | AND t4.`name` IS NOT NULL |
| | | <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null"> |
| | | and ubc.create_time between #{startTime} and #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | ubc.community_id |
| | | ) a |
| | | </select> |
| | | <select id="getTotalBySite" resultType="java.lang.Integer"> |
| | | select |
| | | SUM(num) |
| | | from( |
| | | SELECT |
| | | count(*) num |
| | | FROM |
| | | `ums_base_case` AS ubc |
| | | JOIN ums_violations AS uv ON ubc.id = uv.id |
| | | LEFT JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id |
| | | LEFT JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id |
| | | LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id |
| | | WHERE |
| | | ubc.category = 1 |
| | | AND t4.`name` IS NOT NULL |
| | | <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null"> |
| | | and ubc.create_time between #{startTime} and #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | ubc.site |
| | | ) a |
| | | </select> |
| | | <select id="getTotalByTime" resultType="java.lang.Integer"> |
| | | select |
| | | SUM(num) |
| | | from( |
| | | SELECT |
| | | count(*) num |
| | | FROM |
| | | `ums_base_case` AS ubc |
| | | JOIN ums_violations AS uv ON ubc.id = uv.id |
| | | LEFT JOIN ums_data_dictionary AS t3 ON uv.category_id = t3.id |
| | | LEFT JOIN ums_data_dictionary AS t4 ON uv.type_id = t4.id |
| | | LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id |
| | | WHERE |
| | | ubc.category = 1 |
| | | AND t4.`name` IS NOT NULL |
| | | <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null"> |
| | | and ubc.alarm_time between #{startTime} and #{endTime} |
| | | </if> |
| | | GROUP BY |
| | | ubc.alarm_time |
| | | ) a |
| | | </select> |
| | | </mapper> |