zhanghua
2023-03-18 87a395a6024278594a0a80d25a24ba4ca5993513
统计修改
23个文件已修改
1个文件已添加
996 ■■■■■ 已修改文件
ycl-common/src/main/java/com/ycl/service/user/impl/UmsRoleServiceImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/utils/StringUtils.java 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/utils/listener/DepartListener.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java 52 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/dict/DatabaseDictionaryController.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/dto/statistics/UnlawfulDto.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/dict/DataDictionaryMapper.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/mapper/unlawful/UnlawfulMapper.java 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/dict/IDataDictionaryService.java 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/dict/impl/DataDictionaryServiceImpl.java 11 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/unlawful/UnlawfulService.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/service/unlawful/impl/UnlawfulServiceImpl.java 193 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/java/com/ycl/vo/dict/DataDictionaryVo.java 16 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/application-dev.yml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml 64 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml 362 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-platform/src/test/java/com/ycl/sccgplatform/Test1.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ycl-common/src/main/java/com/ycl/service/user/impl/UmsRoleServiceImpl.java
@@ -13,7 +13,6 @@
import com.ycl.mapper.user.UmsResourceMapper;
import com.ycl.mapper.user.UmsRoleMapper;
import com.ycl.service.user.*;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
ycl-common/src/main/java/com/ycl/utils/StringUtils.java
@@ -1,5 +1,8 @@
package com.ycl.utils;
import java.math.BigDecimal;
import java.text.DecimalFormat;
public class StringUtils {
    /**
@@ -48,13 +51,14 @@
     * hello_world=>helloWorld
     * HELLO_WORLD=>helloWorld
     * Hello_World=>helloWorld
     *
     * @param content
     * @return
     */
    public static String underlineToLowerCamelCase(String content) {
        return new StringBuilder(16)
                .append(content.substring(0,1).toLowerCase())
                .append(content.substring(1).replaceAll("_([a-zA-Z])","$1".toUpperCase()))
                .append(content.substring(0, 1).toLowerCase())
                .append(content.substring(1).replaceAll("_([a-zA-Z])", "$1".toUpperCase()))
                .toString();
    }
@@ -64,6 +68,7 @@
     * hello_world=>HelloWorld
     * HELLO_WORLD=>HelloWorld
     * Hello_World=>HelloWorld
     *
     * @param content
     * @return
     */
@@ -74,5 +79,7 @@
                .toString();
    }
    public static String doubleTwo(Double value) {
        return String.format("%.2f", value);
    }
}
ycl-common/src/main/java/com/ycl/utils/listener/DepartListener.java
@@ -5,7 +5,6 @@
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.ycl.dto.UmsDepartDto;
import com.ycl.entity.depart.UmsDepart;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.mapper.depart.UmsDepartMapper;
import com.ycl.mapper.dict.DataDictionaryMapper;
import org.springframework.stereotype.Component;
ycl-platform/src/main/java/com/ycl/controller/caseHandler/BaseCaseController.java
@@ -113,7 +113,6 @@
        }
        return CommonResult.failed("request parameter is null");
    }*/
    @ApiOperation(value = "查询违规违建")
    @GetMapping("/query")
    @ApiImplicitParams({
@@ -131,8 +130,8 @@
    })
    public CommonResult searchViolation(@RequestParam Integer size,
                                        @RequestParam Integer current,
                                        @RequestParam Integer state,
                                        @RequestParam(required = false) Integer type,
                                        @RequestParam(required = false) Integer state,
                                        @RequestParam Integer type,
                                        @RequestParam(required = false) Integer resource,
                                        @RequestParam(required = false) String code,
                                        @RequestParam(required = false) String categoryBig,
@@ -140,21 +139,18 @@
                                        @RequestParam(required = false) Integer street,
                                        @RequestParam(required = false) String site,
                                        @RequestParam(required = false) String startTime,
                                        @RequestParam(required = false) String endTime ){
        if (state != null) {
            Page<Object> queryList;
            Integer violation = 1;
            Integer illegalBuilding = 2;
            if (type == violation) {
                queryList = baseCaseService.listViolationsPage(new Page<>().setCurrent(current).setSize(size), state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime);
            } else if (type == illegalBuilding) {
                queryList = baseCaseService.listIllegalBuilding(new Page<>().setCurrent(current).setSize(size), state, resource);
            } else {
                return CommonResult.failed("bad request url");
            }
            return CommonResult.success(queryList);
                                        @RequestParam(required = false) String endTime,
                                        @RequestParam(required = false) Integer violationsTypeId) {
        Page<Object> queryList;
        if (type == 1) {
            queryList = baseCaseService.listViolationsPage(new Page<>().setCurrent(current).setSize(size), state, resource, code, categoryBig, categorySmall, street, site, startTime, endTime, violationsTypeId);
        } else if (type == 2) {
            queryList = baseCaseService.listIllegalBuilding(new Page<>().setCurrent(current).setSize(size), state, resource);
        } else {
            return CommonResult.failed("bad request url");
        }
        return CommonResult.failed("request parameter is null");
        return CommonResult.success(queryList);
    }
    /**
@@ -316,18 +312,18 @@
    @ApiOperation(value = "调度管理-批量删除")
    @DeleteMapping("/batch_case_delete")
    public CommonResult batchCaseDelete(@RequestParam List<Long> ids){
    public CommonResult batchCaseDelete(@RequestParam List<Long> ids) {
        ids.forEach(
            item->{
                BaseCase baseCase = baseCaseService.getOne(new LambdaQueryWrapper<BaseCase>().eq(BaseCase::getId, item));
                if (baseCase.getCategory()==1){
                    violationsService.removeById(item);
                    baseCaseService.removeById(item);
                }else {
                    illegalBuildingService.removeById(item);
                    baseCaseService.removeById(item);
                item -> {
                    BaseCase baseCase = baseCaseService.getOne(new LambdaQueryWrapper<BaseCase>().eq(BaseCase::getId, item));
                    if (baseCase.getCategory() == 1) {
                        violationsService.removeById(item);
                        baseCaseService.removeById(item);
                    } else {
                        illegalBuildingService.removeById(item);
                        baseCaseService.removeById(item);
                    }
                }
            }
        );
        return CommonResult.success("success");
    }
@@ -344,7 +340,7 @@
        Integer state = iDisposeRecordService
                .list(new LambdaQueryWrapper<DisposeRecord>()
                        .eq(DisposeRecord::getBaseCaseId, caseId).
                        orderByDesc(DisposeRecord::getCreateTime)).get(firstNum).getState();
                                orderByDesc(DisposeRecord::getCreateTime)).get(firstNum).getState();
        return CommonResult.success(baseCaseService
                .update(new LambdaUpdateWrapper<BaseCase>()
                        .eq(BaseCase::getId, caseId)
ycl-platform/src/main/java/com/ycl/controller/dict/DatabaseDictionaryController.java
@@ -7,6 +7,7 @@
import com.ycl.entity.dict.DataDictionary;
import com.ycl.enums.common.DictTypeEnum;
import com.ycl.service.dict.IDataDictionaryService;
import com.ycl.vo.dict.DataDictionaryVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
@@ -41,7 +42,7 @@
    @GetMapping("/queryByCode")
    @ApiOperation(("根据code获取字段信息"))
    private CommonResult<List<DataDictionary>> queryByCode(@RequestParam(value = "code") String code) {
        List<DataDictionary> dataDictionary = iDatabaseDictionaryService.queryByCode(code);
        List<DataDictionary> dataDictionary = iDatabaseDictionaryService.queryByCode(code, null);
        return CommonResult.success(dataDictionary);
    }
@@ -132,6 +133,20 @@
                ));
    }
    @GetMapping("/query_tree_type")
    @ApiOperation("通过类型编码查询树形类型-只有两级")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "typeCode", value = "01违规 02 事件等级 03证件类型 04文化 05名族 06违建 07用户类型 08 部门类型 09 角色类型 10 乡村街道 11 社区"),
            @ApiImplicitParam(name = "level", value = "1 顶级 2 一级子级 3 二级子级 4三级子级")
    }
    )
    private CommonResult queryTreeType(@RequestParam String typeCode, @RequestParam Integer level) {
        List<DataDictionaryVo> list = iDatabaseDictionaryService.queryTreeType(typeCode, level);
        return CommonResult.success(list);
    }
    @GetMapping("/addition")
    @ApiOperation("通用添加")
    private CommonResult queryType(@RequestBody DataDictionary dataDictionary) {
ycl-platform/src/main/java/com/ycl/controller/intelligentPatrol/StatisticsController.java
@@ -8,12 +8,14 @@
import com.ycl.dto.statistics.UnlawfulDto;
import com.ycl.service.unlawful.UnlawfulService;
import com.ycl.utils.EasyExcelUtils;
import com.ycl.vo.cockpit.CockpitVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
@@ -57,23 +59,11 @@
    @LogSave(operationType = "按违规类型统计", contain = "查询")
    public CommonResult<IPage<UnlawfulDto>> searchByType(@RequestParam(required = true) Integer currentPage,
                                                         @RequestParam(required = true) Integer pageSize,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTime = null;
        String endTime1 = null;
        if (beginTime != null){
            startTime = beginTime.format(fmt);
        }
        if (endTime != null){
            endTime1 = endTime.format(fmt);
        }
                                                         @RequestParam(required = false) String beginTime,
                                                         @RequestParam(required = false) String endTime) {
        IPage<UnlawfulDto> page = new Page<>();
        List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByType((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByType(currentPage, pageSize, beginTime, endTime);
        page.setTotal(unlawfulService.getTotalByType(startTime, endTime1));
        page.setRecords(unlawfulByType);
        return CommonResult.success(page);
    }
@@ -82,22 +72,11 @@
    @LogSave(operationType = "按点位统计", contain = "查询")
    public CommonResult<IPage<UnlawfulDto>> searchByPoint(@RequestParam(required = true) Integer currentPage,
                                                          @RequestParam(required = true) Integer pageSize,
                                                          @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime,
                                                          @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTime = null;
        String endTime1 = null;
        if (beginTime != null){
            startTime = beginTime.format(fmt);
        }
        if (endTime != null){
            endTime1 = endTime.format(fmt);
        }
        IPage<UnlawfulDto> page = new Page<>();
        List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulBySite((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
                                                          @RequestParam(required = false) String beginTime,
                                                          @RequestParam(required = false) String endTime) {
        page.setTotal(unlawfulService.getTotalBySite(startTime, endTime1));
        page.setRecords(unlawfulByType);
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByPoint(currentPage, pageSize, beginTime, endTime);
        return CommonResult.success(page);
    }
@@ -106,21 +85,11 @@
    @LogSave(operationType = "按时间统计", contain = "查询")
    public CommonResult<IPage<UnlawfulDto>> searchByTime(@RequestParam(required = true) Integer currentPage,
                                                         @RequestParam(required = true) Integer pageSize,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTime = null;
        String endTime1 = null;
        if (beginTime != null){
            startTime = beginTime.format(fmt);
        }
        if (endTime != null){
            endTime1 = endTime.format(fmt);
        }
        IPage<UnlawfulDto> page = new Page<>();
        List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByTime((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
        page.setTotal(unlawfulService.getTotalByTime(startTime, endTime1));
        page.setRecords(unlawfulByType);
                                                         @RequestParam(required = false) String beginTime,
                                                         @RequestParam(required = false) String endTime) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByTime(currentPage, pageSize, beginTime, endTime);
        return CommonResult.success(page);
    }
@@ -129,22 +98,10 @@
    @LogSave(operationType = "按区域统计", contain = "查询")
    public CommonResult<IPage<UnlawfulDto>> searchByArea(@RequestParam(required = true) Integer currentPage,
                                                         @RequestParam(required = true) Integer pageSize,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime beginTime,
                                                         @RequestParam(required = false) @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") LocalDateTime endTime) {
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        String startTime = null;
        String endTime1 = null;
        if (beginTime != null){
            startTime = beginTime.format(fmt);
        }
        if (endTime != null){
            endTime1 = endTime.format(fmt);
        }
        IPage<UnlawfulDto> page = new Page<>();
        List<UnlawfulDto> unlawfulByType = unlawfulService.getUnlawfulByStreet((currentPage - 1) * pageSize, pageSize, startTime, endTime1);
                                                         @RequestParam(required = false) String beginTime,
                                                         @RequestParam(required = false) String endTime) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByStreet(currentPage, pageSize, beginTime, endTime);
        page.setTotal(unlawfulService.getTotalByStreet(startTime, endTime1));
        page.setRecords(unlawfulByType);
        return CommonResult.success(page);
    }
@@ -175,44 +132,51 @@
        return CommonResult.success(page);
    }*/
    @PostMapping("/export/unlawful")
    @ApiOperation("按各种统计方式-导出")
    public void export(HttpServletResponse response) {
        List<UnlawfulDto> unlawfulByTypeExport = unlawfulService.getUnlawfulByTypeExport();
        String sheetName = "按统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByTypeExport);
    }
//    @PostMapping("/export/unlawful")
//    @ApiOperation("按各种统计方式-导出")
//    public void export(HttpServletResponse response) {
//        List<UnlawfulDto> unlawfulByTypeExport = unlawfulService.getUnlawfulByTypeExport();
//        String sheetName = "按统计方式";
//        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByTypeExport);
//    }
    @PostMapping("/export/unlawful/type")
    @ApiOperation("按类型统计方式-导出")
    public void exportType(HttpServletResponse response) {
        List<UnlawfulDto> unlawfulByTypeExport = unlawfulService.getUnlawfulByTypeExport();
        String sheetName = "按类型统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByTypeExport);
    public void exportType(HttpServletResponse response,
                           @RequestBody CockpitVO vo) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByType(1, 500, vo.getBeginTime(), vo.getEndTime());
        String sheetName = "按统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, page.getRecords());
    }
    @PostMapping("/export/unlawful/street")
    @ApiOperation("按区域统计方式-导出")
    public void exportStreet(HttpServletResponse response) {
        List<UnlawfulDto> unlawfulByStreetExport = unlawfulService.getUnlawfulByStreetExport();
    public void exportStreet(HttpServletResponse response,
                             @RequestBody CockpitVO vo) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByStreet(1, 500, vo.getBeginTime(), vo.getEndTime());
        String sheetName = "按区域统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulByStreetExport);
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, page.getRecords());
    }
    @PostMapping("/export/unlawful/site")
    @ApiOperation("按报警点位统计方式-导出")
    public void exportSite(HttpServletResponse response) {
        List<UnlawfulDto> unlawfulBySiteExport = unlawfulService.getUnlawfulBySiteExport();
    public void exportSite(HttpServletResponse response,
                           @RequestBody CockpitVO vo) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByPoint(1, 500, vo.getBeginTime(), vo.getEndTime());
        String sheetName = "按报警点位统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulBySiteExport);
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, page.getRecords());
    }
    @PostMapping("/export/unlawful/time")
    @ApiOperation("按报警点位统计方式-导出")
    public void exportTime(HttpServletResponse response) {
        List<UnlawfulDto> unlawfulBySiteExport = unlawfulService.getUnlawfulByTimeExport();
    public void exportTime(HttpServletResponse response,
                           @RequestBody CockpitVO vo) {
        IPage<UnlawfulDto> page = unlawfulService.getUnlawfulByTime(1, 500, vo.getBeginTime(), vo.getEndTime());
        String sheetName = "按报警点位统计方式";
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, unlawfulBySiteExport);
        EasyExcelUtils.export(response, sheetName, UnlawfulDto.class, page.getRecords());
    }
    /*@PostMapping("/export/shop")
ycl-platform/src/main/java/com/ycl/dto/statistics/UnlawfulDto.java
@@ -1,5 +1,6 @@
package com.ycl.dto.statistics;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
@@ -19,7 +20,11 @@
@NoArgsConstructor
@Builder
public class UnlawfulDto {
    /**
     * 类型名称
     */
    @ExcelIgnore
    private Long id;
    /**
     * 类型名称
     */
@@ -36,7 +41,7 @@
     * 占比
     */
    @ExcelProperty(value = "占比", index = 2)
    private Double ratio;
    private String ratio;
    /**
     * 立案
@@ -72,17 +77,17 @@
     * 审核率
     */
    @ExcelProperty(value = "审核率", index = 8)
    private Double checkedRatio;
    private String checkedRatio;
    /**
     * 立案率
     */
    @ExcelProperty(value = "立案率", index = 9)
    private Double registerRatio;
    private String registerRatio;
    /**
     * 准确率
     */
    @ExcelProperty(value = "准确率", index = 10)
    private Double accuracyRatio;
    private String accuracyRatio;
}
ycl-platform/src/main/java/com/ycl/entity/caseHandler/Violations.java
@@ -52,7 +52,7 @@
     */
    @TableField("grade_id")
    @ApiModelProperty(value = "事件等级")
    private Integer gradeId;
    private Long gradeId;
    /**
     * 案由
ycl-platform/src/main/java/com/ycl/mapper/caseHandler/BaseCaseMapper.java
@@ -25,7 +25,7 @@
 * @since 2022-09-24
 */
public interface BaseCaseMapper extends BaseMapper<BaseCase> {
    Page<CasePoolViolationVO> listViolationsPage(Page page, Integer state, Integer type, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime);
    Page<CasePoolViolationVO> listViolationsPage(Page page, Integer state, Integer type, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime, Integer violationsTypeId);
    Page<CasePoolIllegalBuildingVO> listIllegalBuildingsPage(Page page, Integer state, Integer type, Integer resource);
ycl-platform/src/main/java/com/ycl/mapper/dict/DataDictionaryMapper.java
@@ -4,6 +4,10 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.vo.ViolationSettingVO;
import com.ycl.vo.dict.DataDictionaryVo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * <p>
@@ -18,4 +22,6 @@
    Page<DataDictionary> listDataDictionaryPage(Page<DataDictionary> dataDictionaryPage, String keyWord);
    Page<ViolationSettingVO> listViolationPage(Page<ViolationSettingVO> dataDictionaryPage, String keyWord);
    List<DataDictionaryVo> queryTreeType(@Param("typeCode") String typeCode, @Param("level") Integer level);
}
ycl-platform/src/main/java/com/ycl/mapper/unlawful/UnlawfulMapper.java
@@ -1,8 +1,11 @@
package com.ycl.mapper.unlawful;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.dto.statistics.CategoryDto;
import com.ycl.dto.statistics.StatusDto;
import com.ycl.dto.statistics.TimeDto;
import com.ycl.dto.statistics.UnlawfulDto;
import java.util.List;
@@ -10,44 +13,27 @@
    /**
     * 获取总违规数量
     */
    Integer getTotal();
    Integer getTotal(String startTime, String endTime, Boolean type, Boolean street, Boolean video);
    /**
     *  按照违规类型统计
     * 按照违规类型统计
     */
    List<CategoryDto> getDataByType(Integer currentPage, Integer pageSize, String startTime, String endTime);
    StatusDto getStatusDataByType(String startTime, String endTime, Integer dictionaryId);
    List<CategoryDto> getDataByTypeExp();
    IPage<UnlawfulDto> getDataByType(Page<UnlawfulDto> page, String startTime, String endTime);
    /**
     *  按照区域统计
     * 按照区域统计
     */
    List<CategoryDto> getDataByStreet(Integer currentPage, Integer pageSize, String startTime, String endTime);
    StatusDto getStatusDataByStreet(String startTime, String endTime, Integer streetId);
    List<CategoryDto> getDataByStreetExp();
    IPage<UnlawfulDto> getDataByStreet(Page<UnlawfulDto> page, String startTime, String endTime);
    /**
     * 按点位统计
     */
    List<String> getDataBySite(Integer currentPage, Integer pageSize, String startTime, String endTime);
    StatusDto getStatusDataBySite(String startTime, String endTime, String site);
    List<String> getDataBySiteExp();
    IPage<UnlawfulDto> getDataByPoint(Page<UnlawfulDto> page, String startTime, String endTime);
    /**
     * 按报警时间
     */
    List<TimeDto> getDataByTime(Integer currentPage, Integer pageSize, String startTime, String endTime);
    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);
    IPage<UnlawfulDto> getDataByTime(Page<UnlawfulDto> page, String startTime, String endTime);
}
ycl-platform/src/main/java/com/ycl/service/caseHandler/IBaseCaseService.java
@@ -37,7 +37,7 @@
     */
    String uploadEvent(Long caseId);
    Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime);
    Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime,Integer violationsTypeId);
    Page listIllegalBuilding(Page page, Integer state, Integer resource);
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/BaseCaseServiceImpl.java
@@ -170,11 +170,11 @@
    }
    @Override
    public Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime) {
    public Page listViolationsPage(Page page, Integer state, Integer resource, String code, String categoryBig, String categorySmall, Integer street, String site, String startTime, String endTime,Integer violationsTypeId) {
        Integer type = 01;
        Integer hours = 60;
        Integer day = 24;
        Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime);
        Page<CasePoolViolationVO> violationsPage = baseCaseMapper.listViolationsPage(page, state, type, resource, code, categoryBig, categorySmall, street, site, startTime, endTime,violationsTypeId);
        violationsPage.getRecords().stream().forEach(item -> {
            if (item.getCloseTime() == null) {
                Duration duration = Duration.between(item.getAlarmTime(), LocalDateTime.now());
ycl-platform/src/main/java/com/ycl/service/caseHandler/impl/ViolationsServiceImpl.java
@@ -6,12 +6,15 @@
import com.ycl.entity.caseHandler.EventSource;
import com.ycl.entity.caseHandler.QuestionCategory;
import com.ycl.entity.caseHandler.Violations;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.entity.video.VideoAlarmReport;
import com.ycl.entity.video.VideoPoint;
import com.ycl.enums.common.DictTypeEnum;
import com.ycl.mapper.caseHandler.BaseCaseMapper;
import com.ycl.mapper.caseHandler.ViolationsMapper;
import com.ycl.service.caseHandler.IBaseCaseService;
import com.ycl.service.caseHandler.IViolationsService;
import com.ycl.service.dict.IDataDictionaryService;
import com.ycl.service.video.impl.IVideoPointService;
import com.ycl.vo.cockpit.enforcementEvents.VideoAndAreaVO;
import org.springframework.beans.factory.annotation.Autowired;
@@ -34,6 +37,7 @@
    private IVideoPointService videoPointService;
    private IBaseCaseService baseCaseService;
    private IDataDictionaryService dataDictionaryService;
    @Resource
    BaseCaseMapper baseCaseMapper;
@@ -46,6 +50,11 @@
    @Autowired
    public void setBaseCaseService(IBaseCaseService baseCaseService) {
        this.baseCaseService = baseCaseService;
    }
    @Autowired
    public void setDataDictionaryService(IDataDictionaryService dataDictionaryService) {
        this.dataDictionaryService = dataDictionaryService;
    }
    @Override
@@ -73,6 +82,12 @@
                violations.setVideoAlarmReportId(videoAlarmReport.getId());
                violations.setVideoPointId(videoPoint.getId());
                violations.setDescription(videoAlarmReport.getAlgoName());
                List<DataDictionary> list = dataDictionaryService.queryByCode(DictTypeEnum.EVENT_GRADE_TYPE.getCode(), videoAlarmReport.getAlarmName().trim());
                if (list.size() > 0) {
                    violations.setGradeId(list.get(0).getId());
                }
                baseMapper.insert(violations);
            }
        }
ycl-platform/src/main/java/com/ycl/service/dict/IDataDictionaryService.java
@@ -4,6 +4,7 @@
import com.baomidou.mybatisplus.extension.service.IService;
import com.ycl.entity.dict.DataDictionary;
import com.ycl.vo.ViolationSettingVO;
import com.ycl.vo.dict.DataDictionaryVo;
import java.util.List;
@@ -27,9 +28,11 @@
     * @param code
     * @return
     */
    List<DataDictionary> queryByCode(String code);
    List<DataDictionary> queryByCode(String code,String keyword);
    Page listIllegalBuildingSettings(Page<DataDictionary> dataDictionaryPage, String keyWork);
    Page listViolations(Page<ViolationSettingVO> dataDictionaryPage, String keyWord);
    List<DataDictionaryVo> queryTreeType(String typeCode, Integer level);
}
ycl-platform/src/main/java/com/ycl/service/dict/impl/DataDictionaryServiceImpl.java
@@ -12,6 +12,7 @@
import com.ycl.utils.common.LiveTimeMillisecond;
import com.ycl.utils.redis.RedisKey;
import com.ycl.vo.ViolationSettingVO;
import com.ycl.vo.dict.DataDictionaryVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -49,8 +50,11 @@
    }
    @Override
    public List<DataDictionary> queryByCode(String code) {
    public List<DataDictionary> queryByCode(String code, String keyword) {
        LambdaQueryWrapper<DataDictionary> queryWrapper = new LambdaQueryWrapper<DataDictionary>().eq(DataDictionary::getTypeCode, code);
        if (!com.aliyuncs.utils.StringUtils.isEmpty(keyword)) {
            queryWrapper.eq(DataDictionary::getName, keyword);
        }
        List<DataDictionary> dataDictionary = dataDictionaryMapper.selectList(queryWrapper);
        return dataDictionary;
    }
@@ -67,4 +71,9 @@
        Page<ViolationSettingVO> dataDictionaryPageList = dataDictionaryMapper.listViolationPage(dataDictionaryPage, keyWord);
        return dataDictionaryPageList;
    }
    @Override
    public List<DataDictionaryVo> queryTreeType(String typeCode, Integer level) {
        return baseMapper.queryTreeType(typeCode, level);
    }
}
ycl-platform/src/main/java/com/ycl/service/unlawful/UnlawfulService.java
@@ -1,5 +1,6 @@
package com.ycl.service.unlawful;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.dto.statistics.UnlawfulDto;
@@ -8,32 +9,19 @@
public interface UnlawfulService {
    /**
     *  按类型
     * 按类型
     */
    public List<UnlawfulDto> getUnlawfulByType(Integer currentPage, Integer pageSize, String startTime, String endTime);
    public List<UnlawfulDto> getUnlawfulByTypeExport();
    public Integer getTotalByType(String startTime, String endTime);
    IPage<UnlawfulDto> getUnlawfulByType(Integer currentPage, Integer pageSize, 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);
    IPage<UnlawfulDto> getUnlawfulByStreet(Integer currentPage, Integer pageSize, String startTime, String endTime);
    /**
     * 按报警时间
     */
    public List<UnlawfulDto> getUnlawfulByTime(Integer currentPage, Integer pageSize, String startTime, String endTime);
    IPage<UnlawfulDto> getUnlawfulByTime(Integer currentPage, Integer pageSize, String startTime, String endTime);
    public List<UnlawfulDto> getUnlawfulByTimeExport();
    public Integer getTotalByTime(String startTime, String endTime);
    IPage<UnlawfulDto> getUnlawfulByPoint(Integer currentPage, Integer pageSize, String startTime, String endTime);
}
ycl-platform/src/main/java/com/ycl/service/unlawful/impl/UnlawfulServiceImpl.java
@@ -1,11 +1,14 @@
package com.ycl.service.unlawful.impl;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.dto.statistics.CategoryDto;
import com.ycl.dto.statistics.StatusDto;
import com.ycl.dto.statistics.TimeDto;
import com.ycl.dto.statistics.UnlawfulDto;
import com.ycl.mapper.unlawful.UnlawfulMapper;
import com.ycl.service.unlawful.UnlawfulService;
import com.ycl.utils.StringUtils;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@@ -26,177 +29,57 @@
     * 按类型
     */
    @Override
    public List<UnlawfulDto> getUnlawfulByType(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<CategoryDto> data = unlawfuldao.getDataByType(currentPage, pageSize, startTime, endTime);
        data.forEach(categoryDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByType(startTime, endTime, categoryDto.getId());
            format(res, total, categoryDto, statusData);
        });
        return res;
    }
    @Override
    public List<UnlawfulDto> getUnlawfulByTypeExport() {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<CategoryDto> data = unlawfuldao.getDataByTypeExp();
        data.forEach(categoryDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByType(null, null, categoryDto.getId());
            format(res, total, categoryDto, statusData);
        });
        return res;
    public IPage<UnlawfulDto> getUnlawfulByType(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        Page<UnlawfulDto> page = new Page<>(currentPage, pageSize);
        Double total = unlawfuldao.getTotal(startTime, endTime, true, false, false).doubleValue();
        IPage<UnlawfulDto> page1 = unlawfuldao.getDataByType(page, startTime, endTime);
        return getUnlawfulDtoIPage(total, page1);
    }
    @Override
    public Integer getTotalByType(String startTime, String endTime) {
        return unlawfuldao.getTotalByType(startTime, endTime);
    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()));
        });
        return page1;
    }
    /**
     * 按区域
     */
    @Override
    public List<UnlawfulDto> getUnlawfulByStreet(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<CategoryDto> data = unlawfuldao.getDataByStreet(currentPage, pageSize, startTime, endTime);
        data.forEach(categoryDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByStreet(startTime, endTime, categoryDto.getId());
            format(res, total, categoryDto, statusData);
        });
        return res;
    }
    @Override
    public List<UnlawfulDto> getUnlawfulByStreetExport() {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<CategoryDto> data = unlawfuldao.getDataByStreetExp();
        data.forEach(categoryDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByStreet(null, null, categoryDto.getId());
            format(res, total, categoryDto, statusData);
        });
        return res;
    }
    public IPage<UnlawfulDto> getUnlawfulByStreet(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        Page<UnlawfulDto> page = new Page<>(currentPage, pageSize);
    @Override
    public Integer getTotalByStreet(String startTime, String endTime) {
        return unlawfuldao.getTotalByStreet(startTime, endTime);
        Double total = unlawfuldao.getTotal(startTime, endTime, false, true, false).doubleValue();
        IPage<UnlawfulDto> page1 = unlawfuldao.getDataByStreet(page, startTime, endTime);
        return getUnlawfulDtoIPage(total, page1);
    }
    /**
     * 按报警点位
     */
    @Override
    public List<UnlawfulDto> getUnlawfulBySite(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<String> data = unlawfuldao.getDataBySite(currentPage, pageSize, startTime, endTime);
        data.forEach(site -> {
            StatusDto statusData = unlawfuldao.getStatusDataBySite(startTime, endTime, site);
            format1(res, total, site, statusData);
        });
        return res;
    }
    @Override
    public List<UnlawfulDto> getUnlawfulBySiteExport() {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<String> data = unlawfuldao.getDataBySiteExp();
        data.forEach(site -> {
            StatusDto statusData = unlawfuldao.getStatusDataBySite(null, null, site);
            format1(res, total, site, statusData);
        });
        return res;
    }
    @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();
        List<TimeDto> data = unlawfuldao.getDataByTime(currentPage, pageSize, startTime, endTime);
        data.forEach(timeDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByTime(startTime, endTime, timeDto.getId());
            format2(res, total, timeDto, statusData);
        });
        return res;
    }
    @Override
    public List<UnlawfulDto> getUnlawfulByTimeExport() {
        List<UnlawfulDto> res = new ArrayList<>();
        Double total = unlawfuldao.getTotal().doubleValue();
        List<TimeDto> data = unlawfuldao.getDataByTimeExp();
        data.forEach(timeDto -> {
            StatusDto statusData = unlawfuldao.getStatusDataByTime(null, null, timeDto.getId());
            format2(res, total, timeDto, statusData);
        });
        return res;
    public IPage<UnlawfulDto> getUnlawfulByTime(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        Page<UnlawfulDto> page = new Page<>(currentPage, pageSize);
        Double total = unlawfuldao.getTotal(startTime, endTime, false, false, false).doubleValue();
        IPage<UnlawfulDto> page1 = unlawfuldao.getDataByTime(page, startTime, endTime);
        return getUnlawfulDtoIPage(total, page1);
    }
    @Override
    public Integer getTotalByTime(String startTime, String endTime) {
        return unlawfuldao.getTotalBySite(startTime, endTime);
    public IPage<UnlawfulDto> getUnlawfulByPoint(Integer currentPage, Integer pageSize, String startTime, String endTime) {
        Page<UnlawfulDto> page = new Page<>(currentPage, pageSize);
        Double total = unlawfuldao.getTotal(startTime, endTime, false, false, true).doubleValue();
        IPage<UnlawfulDto> page1 = unlawfuldao.getDataByPoint(page, startTime, endTime);
        return getUnlawfulDtoIPage(total, page1);
    }
    private Double changeFormat(Double previous){
        NumberFormat numberInstance = NumberFormat.getNumberInstance();
        numberInstance.setMaximumFractionDigits(3);
        numberInstance.setRoundingMode(RoundingMode.HALF_UP);
        String format = numberInstance.format(previous);
        return Double.parseDouble(format);
    }
    private void format(List<UnlawfulDto> res, Double total, CategoryDto categoryDto, StatusDto statusData) {
        UnlawfulDto build = UnlawfulDto.builder().name(categoryDto.getName())     //类型名称
                .count(statusData.getTotal())   //事件总数
                .ratio(changeFormat(statusData.getTotal().doubleValue() / total))     //占比
                .register(statusData.getRegister())     //立案
                .notRegister(statusData.getNotRegister())   //暂不立案
                .closing(statusData.getClosing())   //结案
                .relearn(statusData.getRelearn())   //在学习
                .checked(statusData.getChecked())   //已审核
                .checkedRatio(changeFormat(statusData.getChecked().doubleValue() / statusData.getTotal().doubleValue()))  //审核率
                .registerRatio(changeFormat(statusData.getRegister().doubleValue() / statusData.getTotal().doubleValue()))    //立案率
                .build();
        res.add(build);
    }
    private void format2(List<UnlawfulDto> res, Double total, TimeDto timeDto, StatusDto statusData) {
        DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
        UnlawfulDto build = UnlawfulDto.builder().name(timeDto.getTime().format(fmt))     //类型名称
                .count(statusData.getTotal())   //事件总数
                .ratio(changeFormat(statusData.getTotal().doubleValue() / total))     //占比
                .register(statusData.getRegister())     //立案
                .notRegister(statusData.getNotRegister())   //暂不立案
                .closing(statusData.getClosing())   //结案
                .relearn(statusData.getRelearn())   //在学习
                .checked(statusData.getChecked())   //已审核
                .checkedRatio(changeFormat(statusData.getChecked().doubleValue() / statusData.getTotal().doubleValue()))  //审核率
                .registerRatio(changeFormat(statusData.getRegister().doubleValue() / statusData.getTotal().doubleValue()))    //立案率
                .build();
        res.add(build);
    }
    private void format1(List<UnlawfulDto> res, Double total, String site, StatusDto statusData) {
        UnlawfulDto build = UnlawfulDto.builder().name(site)     //类型名称
                .count(statusData.getTotal())   //事件总数
                .ratio(changeFormat(statusData.getTotal().doubleValue() / total))     //占比
                .register(statusData.getRegister())     //立案
                .notRegister(statusData.getNotRegister())   //暂不立案
                .closing(statusData.getClosing())   //结案
                .relearn(statusData.getRelearn())   //在学习
                .checked(statusData.getChecked())   //已审核
                .checkedRatio(changeFormat(statusData.getChecked().doubleValue() / statusData.getTotal().doubleValue()))  //审核率
                .registerRatio(changeFormat(statusData.getRegister().doubleValue() / statusData.getTotal().doubleValue()))    //立案率
                .build();
        res.add(build);
    }
}
ycl-platform/src/main/java/com/ycl/vo/dict/DataDictionaryVo.java
New file
@@ -0,0 +1,16 @@
package com.ycl.vo.dict;
import com.ycl.entity.dict.DataDictionary;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
@ApiModel(value = "字典VO")
public class DataDictionaryVo extends DataDictionary {
    @ApiModelProperty(value = "子集合")
    private List<DataDictionary> children;
}
ycl-platform/src/main/resources/application-dev.yml
@@ -35,7 +35,7 @@
        timeout: 0
  datasource:
    url: jdbc:mysql://42.193.1.25:3306/sccg?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    url: jdbc:mysql://42.193.1.25:3306/sccg0318?useUnicode=true&characterEncoding=utf8&autoReconnect=true&useSSL=false
    username: root
    password: 321$YcYl@1970!
    type: com.alibaba.druid.pool.DruidDataSource
ycl-platform/src/main/resources/mapper/caseHandler/BaseCaseMapper.xml
@@ -85,13 +85,16 @@
                and t4.name like concat('%', #{categorySmall},'%')
            </if>
            <if test="street != null">
                and ubc.community_id = #{street}
                and ubc.street_id = #{street}
            </if>
            <if test="site">
                and ubc.site like concat('%', #{site},'%')
            </if>
            <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null">
                and ubc.create_time between #{startTime} and #{endTime}
            </if>
            <if test="violationsTypeId !=null">
                and uv.grade_id = #{violationsTypeId}
            </if>
        </where>
@@ -279,7 +282,7 @@
    <select id="selectRegisterCount" resultType="java.lang.Long">
        select count(1)
        from ums_base_case
        where state in (2, 6,7,8,9)
        where state in (2, 6, 7, 8, 9)
          and to_days(create_time) = TO_DAYS(now());
    </select>
@@ -334,7 +337,7 @@
        WHEN t1.state = 7 THEN '处置'
        WHEN t1.state = 8 THEN '核查'
        WHEN t1.state = 9 THEN '结案'
        END) `status`                  ,
        END) `status` ,
        dd.`name` as grade
        FROM
        ums_base_case t1
@@ -413,14 +416,22 @@
    </select>
    <select id="selectOnTimeCaseCount" resultType="java.lang.Long">
        SELECT COUNT(1) FROM ums_dispose_record WHERE end_time &lt; limit_time
        SELECT COUNT(1)
        FROM ums_dispose_record
        WHERE end_time &lt; limit_time
    </select>
    <select id="selectOnTimeCaseLastMonthCount" resultType="java.lang.Long">
        SELECT COUNT(1) FROM ums_dispose_record WHERE end_time &lt; limit_time  AND PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( create_time, '%Y%m' ) ) =1
        SELECT COUNT(1)
        FROM ums_dispose_record
        WHERE end_time &lt; limit_time
          AND PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(create_time, '%Y%m')) = 1
    </select>
    <select id="selectOnTimeCaseRecentlyMonthCount" resultType="java.lang.Long">
        SELECT COUNT(1) FROM ums_dispose_record WHERE end_time &lt; limit_time  AND PERIOD_DIFF( date_format( now( ), '%Y%m' ), date_format( create_time, '%Y%m' ) ) =0
        SELECT COUNT(1)
        FROM ums_dispose_record
        WHERE end_time &lt; limit_time
          AND PERIOD_DIFF(date_format(now(), '%Y%m'), date_format(create_time, '%Y%m')) = 0
    </select>
</mapper>
ycl-platform/src/main/resources/mapper/dict/DataDictionaryMapper.xml
@@ -4,29 +4,39 @@
    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.ycl.entity.dict.DataDictionary">
        <id column="id" property="id" />
        <result column="name" property="name" />
        <result column="code" property="code" />
        <result column="type_name" property="typeName" />
        <result column="type_code" property="typeCode" />
        <result column="parent_id" property="parentId" />
        <result column="level" property="level" />
        <result column="remark" property="remark" />
        <id column="id" property="id"/>
        <result column="name" property="name"/>
        <result column="code" property="code"/>
        <result column="type_name" property="typeName"/>
        <result column="type_code" property="typeCode"/>
        <result column="parent_id" property="parentId"/>
        <result column="level" property="level"/>
        <result column="remark" property="remark"/>
    </resultMap>
    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, name, code, type_name,type_code,parent_id,level,remark
        id
        , name, code, type_name,type_code,parent_id,level,remark
    </sql>
    <resultMap id="settingsResultMap" type="com.ycl.vo.IllegalBuildingSettingVO">
        <id column="number" property="number" />
        <result column="type" property="type" />
        <result column="typeFirst" property="typeFirst" />
        <result column="typeSecond" property="typeSecond" />
        <result column="typeThird" property="typeThird" />
        <id column="number" property="number"/>
        <result column="type" property="type"/>
        <result column="typeFirst" property="typeFirst"/>
        <result column="typeSecond" property="typeSecond"/>
        <result column="typeThird" property="typeThird"/>
    </resultMap>
    <resultMap id="VoMap" type="com.ycl.vo.dict.DataDictionaryVo" extends="BaseResultMap">
        <collection property="children" javaType="ArrayList" ofType="com.ycl.entity.dict.DataDictionary">
            <result column="c_id" property="id"/>
            <result column="c_name" property="name"/>
            <result column="c_code" property="code"/>
            <result column="c_level" property="level"/>
            <result column="c_remark" property="remark"/>
        </collection>
    </resultMap>
    <select id="listDataDictionaryPage" resultType="com.ycl.vo.IllegalBuildingSettingVO">
        SELECT
@@ -40,8 +50,9 @@
            d1.`level` = '2'
            AND d1.type_code = '06'
            <if test="keyWord !=null and keyWord !=''">
                AND (d1.`name` LIKE  '%${keyWord}%'
                or d2.`name` LIKE  '%${keyWord}%')
                AND (d1.`name` LIKE '%${keyWord}%'
                or d2.`name` LIKE '%${keyWord}%')
                or d2.`name` LIKE '%${keyWord}%')
            </if>
        </where>
@@ -56,16 +67,16 @@
        d4.`name` AS typeThird
        FROM `ums_data_dictionary` AS d1
        LEFT JOIN ums_data_dictionary AS d2 ON d1.parent_id = d2.id
        LEFT JOIN ums_data_dictionary AS d3 ON d2.parent_id  = d3.id
        LEFT JOIN ums_data_dictionary AS d4 ON d3.parent_id  = d4.id
        LEFT JOIN ums_data_dictionary AS d3 ON d2.parent_id = d3.id
        LEFT JOIN ums_data_dictionary AS d4 ON d3.parent_id = d4.id
        <where>
            d1.`level` = '4'
            AND d1.type_code = '01'
            <if test="keyWord !=null and keyWord !=''">
                AND (d1.`name` LIKE  '%${keyWord}%'
                or d2.`name` LIKE  '%${keyWord}%'
                or d3.`name` LIKE  '%${keyWord}%'
                or d4.`name` LIKE  '%${keyWord}%'
                AND (d1.`name` LIKE '%${keyWord}%'
                or d2.`name` LIKE '%${keyWord}%'
                or d3.`name` LIKE '%${keyWord}%'
                or d4.`name` LIKE '%${keyWord}%'
                )
            </if>
@@ -74,4 +85,13 @@
        ORDER BY d1.parent_id,d2.parent_id,d3.parent_id,d4.parent_id
    </select>
    <select id="queryTreeType" resultMap="VoMap">
        SELECT p.*, c.id c_id, c.`name` c_name, c.`code` c_code, c.`level` c_level, c.remark c_remark
        FROM ums_data_dictionary p
                 LEFT JOIN ums_data_dictionary c on p.id = c.parent_id
        WHERE p.`type_code` = #{typeCode}
          and p.`level` = #{level}
        ORDER BY p.id, c.id
    </select>
</mapper>
ycl-platform/src/main/resources/mapper/unlawful/UnlawfulMapper.xml
@@ -1,275 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ycl.mapper.unlawful.UnlawfulMapper">
<!--    获取总数-->
    <!--    获取总数-->
    <select id="getTotal" resultType="java.lang.Integer">
        SELECT
            count(*)
        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
    </select>
        SELECT count(*)
        FROM `ums_base_case` AS ubc
        JOIN ums_violations AS uv ON ubc.id = uv.id
        <if test="type==true">
            INNER JOIN ums_data_dictionary AS t4 ON uv.grade_id = t4.id
        </if>
        <if test="street==true">
            INNER JOIN ums_sccg_region r on ubc.street_id = r.id
        </if>
        <if test="video==true">
            INNER JOIN ums_video_point v on uv.video_point_id = v.id
        </if>
        WHERE ubc.category = 1
<!--    按照违规类型统计-->
    <select id="getDataByType" resultType="com.ycl.dto.statistics.CategoryDto">
        SELECT
            t4.id id,
            t4.NAME name
        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
        limit #{currentPage}, #{pageSize}
    </select>
    <select id="getStatusDataByType" resultType="com.ycl.dto.statistics.StatusDto">
        SELECT
            count(1) total,
            sum(case when ubc.state=5 then 1 else 0 end) register,
            sum(case when ubc.state=4 then 1 else 0 end ) notRegister,
            sum(case when ubc.state=9 then 1 else 0 end ) closing,
            sum(case when ubc.state=3 then 1 else 0 end ) relearn,
            sum(case when ubc.state=8 then 1 else 0 end ) checked
        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.`id` = #{dictionaryId}
          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>
    </select>
    <select id="getDataByTypeExp" resultType="com.ycl.dto.statistics.CategoryDto">
    <!--    按照违规类型统计-->
    <select id="getDataByType" resultType="com.ycl.dto.statistics.UnlawfulDto">
        SELECT
            t4.id id,
            t4.NAME name
        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
        group by
        t4.id
    </select>
<!--    按照区域统计-->
    <select id="getDataByStreet" resultType="com.ycl.dto.statistics.CategoryDto">
        SELECT
            ubc.community_id id,
            t5.region_name name
        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
        limit #{currentPage}, #{pageSize}
    </select>
    <select id="getStatusDataByStreet" resultType="com.ycl.dto.statistics.StatusDto">
        SELECT
            count( 1 ) total,
            sum( CASE WHEN ubc.state = 5 THEN 1 ELSE 0 END ) register,
            sum( CASE WHEN ubc.state = 4 THEN 1 ELSE 0 END ) notRegister,
            sum( CASE WHEN ubc.state = 9 THEN 1 ELSE 0 END ) closing,
            sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) relearn,
            sum( CASE WHEN ubc.state = 8 THEN 1 ELSE 0 END ) checked
        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 ubc.`community_id` = #{streetId}
          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>
    </select>
    <select id="getDataByStreetExp" resultType="com.ycl.dto.statistics.CategoryDto">
        SELECT
            ubc.community_id id,
            t5.region_name NAME
        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
        group by
            ubc.community_id
    </select>
<!--    按点位统计-->
    <select id="getDataBySite" resultType="java.lang.String">
        SELECT
            ubc.site
        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
        limit #{currentPage}, #{pageSize}
    </select>
    <select id="getStatusDataBySite" resultType="com.ycl.dto.statistics.StatusDto">
        SELECT
            count( 1 ) total,
            sum( CASE WHEN ubc.state = 5 THEN 1 ELSE 0 END ) register,
            sum( CASE WHEN ubc.state = 4 THEN 1 ELSE 0 END ) notRegister,
            sum( CASE WHEN ubc.state = 9 THEN 1 ELSE 0 END ) closing,
            sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) relearn,
            sum( CASE WHEN ubc.state = 8 THEN 1 ELSE 0 END ) checked
        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
          AND ubc.site = #{site}
    </select>
    <select id="getDataBySiteExp" resultType="java.lang.String">
        SELECT
            ubc.site
        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
        GROUP BY
            ubc.site
    </select>
<!--    按照报警时间-->
    <select id="getDataByTime" resultType="com.ycl.dto.statistics.TimeDto">
        SELECT
            ubc.id id,
            ubc.alarm_time time
        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
        limit #{currentPage}, #{pageSize}
    </select>
    <select id="getStatusDataByTime" resultType="com.ycl.dto.statistics.StatusDto">
        SELECT
            count( 1 ) total,
            sum( CASE WHEN ubc.state = 5 THEN 1 ELSE 0 END ) register,
            sum( CASE WHEN ubc.state = 4 THEN 1 ELSE 0 END ) notRegister,
            sum( CASE WHEN ubc.state = 9 THEN 1 ELSE 0 END ) closing,
            sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) relearn,
            sum( CASE WHEN ubc.state = 8 THEN 1 ELSE 0 END ) checked
        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
          AND ubc.id = #{id}
    </select>
    <select id="getDataByTimeExp" resultType="com.ycl.dto.statistics.TimeDto">
        SELECT
            ubc.id id,
            ubc.alarm_time time,
        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
        group by
            ubc.alarm_time
    </select>
<!--    分页数量-->
    <select id="getTotalByType" resultType="java.lang.Integer">
        SELECT
        count(*) num
        t4.id id,
        t4.NAME name,
        COUNT(DISTINCT ubc.id) count,
        sum(case when ubc.state >4 then 1 ELSE 0 END ) register,
        sum(case when ubc.state =4 then 1 ELSE 0 END ) notRegister,
        sum(case when ubc.state =9 then 1 ELSE 0 END ) closing,
        sum(case when ubc.state =3 then 1 ELSE 0 END ) relearn,
        sum(case when ubc.state =8 then 1 ELSE 0 END ) checked
        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_data_dictionary AS t4 ON uv.grade_id = t4.id
        LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id
        WHERE
        ubc.category =1
@@ -277,26 +44,21 @@
        <if test="startTime !='' and endTime !='' and startTime!=null and endTime !=null">
            and ubc.create_time between #{startTime} and #{endTime}
        </if>
        group by t4.id
        ORDER BY t4.id
    </select>
    <select id="getTotalByStreet" resultType="java.lang.Integer">
    <!--    按照区域统计-->
    <select id="getDataByStreet" resultType="com.ycl.dto.statistics.UnlawfulDto">
        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>
    </select>
    <select id="getTotalBySite" resultType="java.lang.Integer">
        SELECT
        count(*) num
        ubc.street_id id,
        t5.region_name name,
        COUNT( DISTINCT ubc.id ) count,
        sum( CASE WHEN ubc.state > 4 THEN 1 ELSE 0 END ) register,
        sum( CASE WHEN ubc.state = 4 THEN 1 ELSE 0 END ) notRegister,
        sum( CASE WHEN ubc.state = 9 THEN 1 ELSE 0 END ) closing,
        sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) relearn,
        sum( CASE WHEN ubc.state = 8 THEN 1 ELSE 0 END ) checked
        FROM
        `ums_base_case` AS ubc
        JOIN ums_violations AS uv ON ubc.id = uv.id
@@ -305,25 +67,59 @@
        LEFT JOIN ums_sccg_region t5 ON ubc.street_id = t5.id
        WHERE
        ubc.category = 1
        AND t4.`name` IS NOT NULL
        AND t5.region_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.street_id
        ORDER BY ubc.street_id
    </select>
    <select id="getTotalByTime" resultType="java.lang.Integer">
    <!--    按照报警时间-->
    <select id="getDataByTime" resultType="com.ycl.dto.statistics.UnlawfulDto">
        SELECT
        count(*) num
        DATE_FORMAT(ubc.alarm_time,'%Y-%m-%d') NAME,
        COUNT( DISTINCT ubc.id ) count,
        sum( CASE WHEN ubc.state > 4 THEN 1 ELSE 0 END ) register,
        sum( CASE WHEN ubc.state = 4 THEN 1 ELSE 0 END ) notRegister,
        sum( CASE WHEN ubc.state = 9 THEN 1 ELSE 0 END ) closing,
        sum( CASE WHEN ubc.state = 3 THEN 1 ELSE 0 END ) relearn,
        sum( CASE WHEN ubc.state = 8 THEN 1 ELSE 0 END ) checked
        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
        DATE_FORMAT(ubc.alarm_time,'%Y-%m-%d')
        ORDER BY
        DATE_FORMAT(ubc.alarm_time,'%Y-%m-%d')
    </select>
    <select id="getDataByPoint" resultType="com.ycl.dto.statistics.UnlawfulDto">
        SELECT
        vp.id id,
        vp.NAME name,
        COUNT(DISTINCT ubc.id) count,
        sum(case when ubc.state >4 then 1 ELSE 0 END ) register,
        sum(case when ubc.state =4 then 1 ELSE 0 END ) notRegister,
        sum(case when ubc.state =9 then 1 ELSE 0 END ) closing,
        sum(case when ubc.state =3 then 1 ELSE 0 END ) relearn,
        sum(case when ubc.state =8 then 1 ELSE 0 END ) checked
        FROM
        `ums_base_case` AS ubc
        JOIN ums_violations AS uv ON ubc.id = uv.id
        LEFT JOIN ums_video_point vp ON uv.video_point_id = vp.id
        WHERE
        ubc.category =1
        and vp.`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 vp.id
        ORDER BY vp.id
    </select>
</mapper>
ycl-platform/src/test/java/com/ycl/sccgplatform/Test1.java
@@ -26,8 +26,8 @@
    @Test
    void test(){
        List<CategoryDto> data = unlawfuldao.getDataByType(0, 5,"2022-12-14 17:19:01", "2022-12-14 17:19:03");
        System.out.println(data);
//        List<CategoryDto> data = unlawfuldao.getDataByType(0, 5,"2022-12-14 17:19:01", "2022-12-14 17:19:03");
//        System.out.println(data);
    }
//    @Test