Browse Source

CIM-大屏指标查询

dev-V1.0.8
niujiyi 20 hours ago
parent
commit
766a80c65b
  1. 169
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java
  2. 38
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/CimDashboardOverviewQueryBo.java
  3. 114
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java
  4. 108
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/CimDashboardOverviewMapper.java
  5. 3
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/StatisticalPanelDistrictMapper.java
  6. 114
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/ICimDashboardOverviewService.java
  7. 3
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IStatisticalPaneDistrictService.java
  8. 172
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/CimDashboardOverviewServiceImpl.java
  9. 5
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/StatisticalPaneServiceDistrictImpl.java
  10. 456
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml
  11. 49
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/StatisticalPanelDistrictMapper.xml

169
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/cim/CimDashboardOverviewController.java

@ -0,0 +1,169 @@
package com.zdxt.enforcementcode.controller.cim;
import cn.dev33.satoken.annotation.SaIgnore;
import com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo;
import com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo;
import com.zdxt.enforcementcode.service.ICimDashboardOverviewService;
import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
* cim大屏-大屏总览Controller
*
* @author niujiyi
* @date 2023-08-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/cim/dashboardOverview")
public class CimDashboardOverviewController {
private final ICimDashboardOverviewService cimDashboardOverviewService;
/**
* Cim大屏-大屏总览查询 涉企登记总数-行政执法数-非行政执法数-企业总数同比环比
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getEnfRegistrationCount")
public R<CimDashboardOverviewVo> getEnfRegistrationCount(CimDashboardOverviewQueryBo bo){
CimDashboardOverviewVo vo = new CimDashboardOverviewVo();
//行政执法
Long xzzfCount = cimDashboardOverviewService.getEnfRegistrationCount(bo);
vo.setXzzfs(xzzfCount);
//非行政执法
Long fxzzfCount = cimDashboardOverviewService.getNonEnfRegistrationCount(bo);
vo.setFxzzfs(fxzzfCount);
//涉企登记总数
vo.setSqdjzs(xzzfCount + fxzzfCount);
//企业总数
//同比
//环比
return R.ok(vo);
}
/**
* Cim大屏-大屏总览查询 计划总数-预告总数-涉企执法总数-价差评价总数-检查投诉总数-平均检查频次
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getLawRegulationCount")
public R<CimDashboardOverviewVo> getLawRegulationCount(CimDashboardOverviewQueryBo bo){
CimDashboardOverviewVo vo = new CimDashboardOverviewVo();
//计划总数
Long jszsCount= cimDashboardOverviewService.getPlanCount(bo);
vo.setJhzs(jszsCount);
//预告总数
Long ygzsCount= cimDashboardOverviewService.getNoticeCount(bo);
vo.setYgzs(ygzsCount);
//涉企执法总数
Long sqzfzsCount= cimDashboardOverviewService.getEnfLawCount(bo);
vo.setSqzfzs(sqzfzsCount);
//检查评价总数
Long jcpjzsCount= cimDashboardOverviewService.getLawEvaluateCount(bo);
vo.setJcpjzs(jcpjzsCount);
//检查投诉总数
Long jctszsCount= cimDashboardOverviewService.getComplaintCount(bo);
vo.setJctszs(jctszsCount);
//平均检查频次
Long bzfqyCount= cimDashboardOverviewService.getSubLawEntCount(bo);
Long xzzfCount= cimDashboardOverviewService.getEnfRegistrationCount(bo);
vo.setPjjcpc(xzzfCount/bzfqyCount);
return R.ok(vo);
}
/**
* Cim大屏-大屏总览 查询 单独部门执法-联合执法-被执法企业-入企压减率-执法人员数-执法单位数
* @param bo
* @return
*/
@SaIgnore
@GetMapping("getAdminLawCount")
public R<CimDashboardOverviewVo> getAdminLawCount(CimDashboardOverviewQueryBo bo){
CimDashboardOverviewVo vo = new CimDashboardOverviewVo();
//单独部门执法
Long ddbmzfCount=cimDashboardOverviewService.getSepDeptLawCount(bo);
vo.setDdbmzf(ddbmzfCount);
//联合执法
Long lhzfCount= cimDashboardOverviewService.getUnionLawCount(bo);
vo.setLhzf(lhzfCount);
//被执法企业
Long bzfqyCount= cimDashboardOverviewService.getSubLawEntCount(bo);
vo.setBzfqy(bzfqyCount);
//入企压减率
Long xzzfCount= cimDashboardOverviewService.getEnfRegistrationCount(bo);
vo.setRqyjl(xzzfCount-(lhzfCount+ddbmzfCount));
//执法人员数
//执法单位数
return R.ok(vo);
}
/**
* Cim大屏-大屏总览 查询区域检查趋势分析
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getQuarterlyRegionList")
public R<List<CimDashboardOverviewVo>> getQuarterlyRegionList(CimDashboardOverviewQueryBo bo){
List<CimDashboardOverviewVo> vo= cimDashboardOverviewService.getQuarterlyRegionList(bo);
return R.ok(vo);
}
/**
* Cim大屏-大屏总览 查询领域检查趋势分析
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getDomainQuarterList")
public R<List<CimDashboardOverviewVo>> getDomainQuarterList(CimDashboardOverviewQueryBo bo){
List<CimDashboardOverviewVo> vo= cimDashboardOverviewService.getDomainQuarterList(bo);
return R.ok(vo);
}
/**
* Cim大屏-大屏总览 查询 涉企执法登记类别
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getEnfRegistrationType")
public R<List<CimDashboardOverviewVo>> getEnfRegistrationType(CimDashboardOverviewQueryBo bo){
List<CimDashboardOverviewVo> vo= cimDashboardOverviewService.getEnfRegistrationType(bo);
return R.ok(vo);
}
/**
* Cim大屏-大屏总览 查询非行政涉企执法登记
* @param bo
* @return
*/
@SaIgnore
@GetMapping("/getNonEnfRegistraion")
public R<List<CimDashboardOverviewVo>> getNonEnfRegistraion(CimDashboardOverviewQueryBo bo){
List<CimDashboardOverviewVo> vo= cimDashboardOverviewService.getNonEnfRegistraion(bo);
return R.ok(vo);
}
}

38
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/bo/CimDashboardOverviewQueryBo.java

@ -0,0 +1,38 @@
package com.zdxt.enforcementcode.domain.bo;
import lombok.Data;
import java.util.Date;
@Data
public class CimDashboardOverviewQueryBo {
/**
* 通用时间
*/
private Date dateTime;
/**
* 区域编码
*/
private String code;
/**
* -开始时间
*/
private Date beginTime;
/**
* -结束时间
*/
private Date endTime;
/**
* 年份
*/
private String year;
}

114
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/CimDashboardOverviewVo.java

@ -0,0 +1,114 @@
package com.zdxt.enforcementcode.domain.vo;
import lombok.Data;
@Data
public class CimDashboardOverviewVo {
/**
* 涉企登记总数
*/
private Long sqdjzs;
/**
* 行政执法数
*/
private Long xzzfs;
/**
* 非行政执法数
*/
private Long fxzzfs;
/**
* 计划总数
*/
private Long jhzs;
/**
* 预告总数
*/
private Long ygzs;
/**
* 涉企执法总数
*/
private Long sqzfzs;
/**
* 检查评价总数
*/
private Long jcpjzs;
/**
* 检查投诉总数
*/
private Long jctszs;
/**
* 平均检查频次
*/
private Long pjjcpc;
/**
* 单独部门执法
*/
private Long ddbmzf;
/**
* 联合执法
*/
private Long lhzf;
/**
* 被执法企业
*/
private Long bzfqy;
/**
* 入企压减率
*/
private Long rqyjl;
/**
* 编码
*/
private String code;
/**
* 名称
*/
private String name;
/**
* 数量
*/
private Long number;
/**
* 占比
*/
private Double proportion;
/**
* 一季度
*/
private Long firstQuarter;
/**
* 二季度
*/
private Long secondQuarter;
/**
* 三季度
*/
private Long thirdQuarter;
/**
* 四季度
*/
private Long fourthQuarter;
}

108
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/CimDashboardOverviewMapper.java

@ -0,0 +1,108 @@
package com.zdxt.enforcementcode.mapper;
import com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo;
import com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo;
import java.util.List;
public interface CimDashboardOverviewMapper {
/**
* 获取行政执法数
*
* @return 获取行政执法数
*/
Long getEnfRegistrationCount(CimDashboardOverviewQueryBo bo);
/**
* 获取非行政执法数
*
* @return 非行政执法数
*/
Long getNonEnfRegistrationCount(CimDashboardOverviewQueryBo bo);
/**
* 获取计划总数
* @param bo
* @return
*/
Long getPlanCount(CimDashboardOverviewQueryBo bo);
/**
* 获取预告总数
* @param bo
* @return
*/
Long getNoticeCount(CimDashboardOverviewQueryBo bo);
/**
* 获取涉企执法总数
* @param bo
* @return
*/
Long getEnfLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取检查评价总数
* @param bo
* @return
*/
Long getLawEvaluateCount(CimDashboardOverviewQueryBo bo);
/**
* 获取检查投诉总数
* @param bo
* @return
*/
Long getComplaintCount(CimDashboardOverviewQueryBo bo);
/**
* 获取被执法企业
* @param bo
* @return
*/
Long getSubLawEntCount(CimDashboardOverviewQueryBo bo);
/**
* 获取单独部门执法
* @param bo
* @return
*/
Long getSepDeptLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取联合执法
* @param bo
* @return
*/
Long getUnionLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取区域检查趋势分析(季度)
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getQuarterlyRegionList(CimDashboardOverviewQueryBo bo);
/**
* 获取领域检查趋势分析(季度)
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getDomainQuarterList(CimDashboardOverviewQueryBo bo);
/**
* 获取涉企登记执法类别
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getEnfRegistrationType(CimDashboardOverviewQueryBo bo);
/**
* 获取非行政执法
*/
List<CimDashboardOverviewVo> getNonEnfRegistraion(CimDashboardOverviewQueryBo bo);
}

3
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/StatisticalPanelDistrictMapper.java

@ -28,4 +28,7 @@ public interface StatisticalPanelDistrictMapper {
List<String> queryDeptAllByBureauDeptId(String bureauDeptId);
List<String> queryDuplicateUnionNosByUnion(SixAnalysisParamsBo params);
List<Map<String, String>> queryBureauDeptByUnion(List<String> unionNos);
/** 每个区域每个季度的执法检查数量 */
List<Map<String, Object>> queryDistrictQuarterInspectionCount(SixAnalysisParamsBo params);
}

114
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/ICimDashboardOverviewService.java

@ -0,0 +1,114 @@
package com.zdxt.enforcementcode.service;
import com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo;
import com.zdxt.enforcementcode.domain.bo.SixAnalysisParamsBo;
import com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo;
import java.util.List;
/**
* cim大屏-大屏总览
*/
public interface ICimDashboardOverviewService {
/**
* 获取行政执法数
*
* @return 获取行政执法数
*/
Long getEnfRegistrationCount(CimDashboardOverviewQueryBo bo);
/**
* 获取非行政执法数
*
* @return 非行政执法数
*/
Long getNonEnfRegistrationCount(CimDashboardOverviewQueryBo bo);
/**
* 获取计划总数
* @param bo
* @return
*/
Long getPlanCount(CimDashboardOverviewQueryBo bo);
/**
* 获取预告总数
* @param bo
* @return
*/
Long getNoticeCount(CimDashboardOverviewQueryBo bo);
/**
* 获取涉企执法总数
* @param bo
* @return
*/
Long getEnfLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取检查评价总数
* @param bo
* @return
*/
Long getLawEvaluateCount(CimDashboardOverviewQueryBo bo);
/**
* 获取检查投诉总数
* @param bo
* @return
*/
Long getComplaintCount(CimDashboardOverviewQueryBo bo);
/**
* 获取被执法企业
* @param bo
* @return
*/
Long getSubLawEntCount(CimDashboardOverviewQueryBo bo);
/**
* 获取单独部门执法
* @param bo
* @return
*/
Long getSepDeptLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取联合执法
* @param bo
* @return
*/
Long getUnionLawCount(CimDashboardOverviewQueryBo bo);
/**
* 获取区域检查趋势分析(季度)
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getQuarterlyRegionList(CimDashboardOverviewQueryBo bo);
/**
* 获取领域检查趋势分析(季度)
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getDomainQuarterList(CimDashboardOverviewQueryBo bo);
/**
* 获取涉企登记执法类别
* @param bo
* @return
*/
List<CimDashboardOverviewVo> getEnfRegistrationType(CimDashboardOverviewQueryBo bo);
/**
* 获取非行政执法
*/
List<CimDashboardOverviewVo> getNonEnfRegistraion(CimDashboardOverviewQueryBo bo);
}

3
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/IStatisticalPaneDistrictService.java

@ -30,4 +30,7 @@ public interface IStatisticalPaneDistrictService {
List<Map<String, String>> queryLawFieldCount(SixAnalysisParamsBo params);
List<Map<String, String>> queryEnforceTypeCount(SixAnalysisParamsBo params);
List<EnterpriseEvaluateVo> queryEvaluateAll(SixAnalysisParamsBo params);
/** 每个区域每个季度的执法检查数量 */
List<Map<String, Object>> queryDistrictQuarterInspectionCount(SixAnalysisParamsBo params);
}

172
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/CimDashboardOverviewServiceImpl.java

@ -0,0 +1,172 @@
package com.zdxt.enforcementcode.service.impl;
import com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo;
import com.zdxt.enforcementcode.domain.bo.SixAnalysisParamsBo;
import com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo;
import com.zdxt.enforcementcode.mapper.CimDashboardOverviewMapper;
import com.zdxt.enforcementcode.mapper.StatisticalPanelMapper;
import com.zdxt.enforcementcode.service.ICimDashboardOverviewService;
import io.swagger.v3.oas.models.security.SecurityScheme;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* cim大屏总览实现
*/
@Slf4j
@RequiredArgsConstructor
@Service
public class CimDashboardOverviewServiceImpl implements ICimDashboardOverviewService {
private final CimDashboardOverviewMapper cimDashboardOverviewMapper;
private final StatisticalPanelMapper statisticalPanelMapper;
/**
* 查询行政执法数
* @param bo
* @return
*/
@Override
public Long getEnfRegistrationCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getEnfRegistrationCount(bo);
}
/**
* 查询非行政执法数
* @param bo
* @return
*/
@Override
public Long getNonEnfRegistrationCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getNonEnfRegistrationCount(bo);
}
/**
* 查询计划总数
* @param bo
* @return
*/
@Override
public Long getPlanCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getPlanCount(bo);
}
/**
* 查询预告总数
* @param bo
* @return
*/
@Override
public Long getNoticeCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getNoticeCount(bo);
}
/**
* 查询涉企执法总数
* @param bo
* @return
*/
@Override
public Long getEnfLawCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getEnfLawCount(bo);
}
/**
* 查询检查评价总数
* @param bo
* @return
*/
@Override
public Long getLawEvaluateCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getLawEvaluateCount(bo);
}
/**
* 查询检查投诉总数
* @param bo
* @return
*/
@Override
public Long getComplaintCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getComplaintCount(bo);
}
/**
* 查询被执法企业
* @param bo
* @return
*/
@Override
public Long getSubLawEntCount(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getSubLawEntCount(bo);
}
/**
* 查询单独部门执法
*/
@Override
public Long getSepDeptLawCount(CimDashboardOverviewQueryBo bo){
return cimDashboardOverviewMapper.getSepDeptLawCount(bo);
}
/**
* 查询联合执法
* @param bo
* @return
*/
@Override
public Long getUnionLawCount(CimDashboardOverviewQueryBo bo){
return cimDashboardOverviewMapper.getUnionLawCount(bo);
}
/**
* 查询区域检查趋势分析
* @param bo
* @return
*/
@Override
public List<CimDashboardOverviewVo> getQuarterlyRegionList(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getQuarterlyRegionList(bo);
}
/**
* 查询领域检查趋势分析
* @param bo
* @return
*/
@Override
public List<CimDashboardOverviewVo> getDomainQuarterList(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getDomainQuarterList(bo);
}
/**
* 查询涉企执法登记类别
* @param bo
* @return
*/
@Override
public List<CimDashboardOverviewVo> getEnfRegistrationType(CimDashboardOverviewQueryBo bo){
return cimDashboardOverviewMapper.getEnfRegistrationType(bo);
}
/**
* 查询非行政涉企执法登记
* @param bo
* @return
*/
@Override
public List<CimDashboardOverviewVo> getNonEnfRegistraion(CimDashboardOverviewQueryBo bo) {
return cimDashboardOverviewMapper.getNonEnfRegistraion(bo);
}
}

5
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/service/impl/StatisticalPaneServiceDistrictImpl.java

@ -550,4 +550,9 @@ public class StatisticalPaneServiceDistrictImpl implements IStatisticalPaneDistr
public List<EnterpriseEvaluateVo> queryEvaluateAll(SixAnalysisParamsBo params) {
return statisticalPanelDistrictMapper.query_evaluate_all(params);
}
@Override
public List<Map<String, Object>> queryDistrictQuarterInspectionCount(SixAnalysisParamsBo params) {
return null;
}
}

456
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/CimDashboardOverviewMapper.xml

@ -0,0 +1,456 @@
<?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.zdxt.enforcementcode.mapper.CimDashboardOverviewMapper">
<!-- 获取行政执法数 -->
<select id="getEnfRegistrationCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) as xzzfs
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_submit = 1
and t1.is_delete = 0
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="dateTime !=null">
and t1.enforcement_time = #{dateTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取非行政执法数 -->
<select id="getNonEnfRegistrationCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) as fxzzfs
from
non_enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.has_delete = 0
<if test="dateTime !=null">
and T1.enforcement_time = #{dateTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取计划总数 -->
<select id="getPlanCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) as jhzs
from
efcode_cp_plan t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
<if test="beginTime !=null">
and t1.plan_date &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.plan_date &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取预告总数 -->
<select id="getNoticeCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) ygzs
from
efcode_cp_notice t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
and t1.status=1
<if test="beginTime !=null">
and t1.publish_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.publish_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取涉企执法总数 -->
<select id="getEnfLawCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) sqzfzs
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
and t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取检查评价总数 -->
<select id="getLawEvaluateCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) jcpjzs
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
and t1.is_submit = 1
and t1.is_evaluate = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取检查投诉总数 -->
<select id="getComplaintCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(1) jctszs
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
and t1.is_submit = 1
and t1.is_complaint = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 获取被执法企业 -->
<select id="getSubLawEntCount" resultType="java.lang.Long" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
count(distinct t1.enterprise_number) as bzfqy
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_delete = 0
and t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
</select>
<!-- 单条检查数量统计 -->
<select id="getSepDeptLawCount" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo" resultType="java.lang.Long">
select
(
select
count(1)
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
)+(
select
count(1) as _count
from
(
select
1
from
enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
and t1.union_no is not null
and t1.union_no != ''
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
GROUP BY t1.union_no HAVING COUNT(1) &lt; 2) as t
)
</select>
<!-- 联合检查数量统计 -->
<select id="getUnionLawCount" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo" resultType="java.lang.Long">
SELECT
COUNT(1) AS _count
FROM (
SELECT
1
FROM enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
and t1.union_no IS NOT NULL
and t1.union_no != ''
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
GROUP BY t1.union_no
HAVING COUNT(1) &gt; 1
) AS t
</select>
<!-- 获取区域检查趋势分析(季度) -->
<select id="getQuarterlyRegionList" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
t3.code,
t3.name,
sum(case when QUARTER(t1.enforcement_time)= 1 then 1 else 0 end) as firstQuarter,
sum(case when QUARTER(t1.enforcement_time)= 2 then 1 else 0 end) as secondQuarter,
sum(case when QUARTER(t1.enforcement_time)= 3 then 1 else 0 end) as thirdQuarter,
sum(case when QUARTER(t1.enforcement_time)= 4 then 1 else 0 end) as fourthQuarter
from
enforcement_registration t1
left join sys_dept t2
on t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3
on t2.area_node = t3.code and t3.`level` = 3
<where>
t3.code is not null
and t1.is_delete = 0
and t1.is_submit = 1
<if test="year !=null and year !=''">
and year(t1.enforcement_time)= #{year}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>
group by
t3.code,
t3.name
</select>
<!-- 获取领域检查趋势分析(季度) -->
<select id="getDomainQuarterList" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
t3.domain_id as code,
t3.domain_name as name,
sum(case when QUARTER(t1.enforcement_time)= 1 then 1 else 0 end) as firstQuarter,
sum(case when QUARTER(t1.enforcement_time)= 2 then 1 else 0 end) as secondQuarter,
sum(case when QUARTER(t1.enforcement_time)= 3 then 1 else 0 end) as thirdQuarter,
sum(case when QUARTER(t1.enforcement_time)= 4 then 1 else 0 end) as fourthQuarter
from enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_domain_dept t3 on
t2.dept_id = t3.dept_id
<where>
t3.domain_id is not null
and t1.is_delete = 0
and t1.is_submit = 1
<if test="year !=null and year !=''">
and year(t1.enforcement_time)= #{year}
</if>
<if test="code !=null and code!=''">
and t3.domain_id = #{code}
</if>
</where>
group by
t3.domain_id ,
t3.domain_name
</select>
<!-- 获取涉企登记执法类别 -->
<select id="getEnfRegistrationType" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
t1.dict_label as name,
count(t2.check_category) as number
from
sys_dict_data t1
left join enforcement_registration t2 on
t2.law_enforce_category = t1.dict_value
left join sys_dept t3 on
t2.bureau_dept_id = t3.dept_id
left join dashboard_area_info t4 on
t3.area_node = t4.code
<where>
t1.dict_type = 'law_enforce_category'
and t2.is_submit = 1
and t2.enterprise_name is not null
and t2.enterprise_number is not null
<if test="beginTime !=null">
and t2.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t2.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t4.code = #{code}
</if>
</where>
group by
t1.dict_label,
t2.law_enforce_category
</select>
<!-- 获取非行政执法类别 -->
<select id="getNonEnfRegistraion" resultType="com.zdxt.enforcementcode.domain.vo.CimDashboardOverviewVo" parameterType="com.zdxt.enforcementcode.domain.bo.CimDashboardOverviewQueryBo">
select
t1.dict_label as name,
t1.num as number,
ROUND(t1.num / t1.zs,2) as proportion
from
(
select
t1.dict_label,
count(t2.law_enforcement_type) as num,
(select
count(1) as num
from
non_enforcement_registration t1
left join sys_dept t2 on
t1.bureau_dept_id = t2.dept_id
left join dashboard_area_info t3 on
t2.area_node = t3.code
<where>
t1.enterprise_name is not null
and t1.enterprise_number is not null
<if test="beginTime !=null">
and t1.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t1.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t3.code = #{code}
</if>
</where>) as zs
from
sys_dict_data t1
left join non_enforcement_registration t2 on
t2.law_enforcement_type = t1.dict_value
left join sys_dept t3 on
t2.bureau_dept_id = t3.dept_id
left join dashboard_area_info t4 on
t3.area_node = t4.code
<where>
t1.dict_type = 'no_check_category'
and t2.enterprise_name is not null
and t2.enterprise_number is not null
<if test="beginTime !=null">
and t2.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime !=null">
and t2.enforcement_time &lt;= #{endTime}
</if>
<if test="code !=null and code!=''">
and t4.code = #{code}
</if>
</where>
group by
t1.dict_label, t2.law_enforcement_type) t1
</select>
</mapper>

49
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/StatisticalPanelDistrictMapper.xml

@ -281,4 +281,53 @@
and er.union_no in <foreach collection="unionNos" item="unionNo" open="(" separator="," close=")"> #{unionNo} </foreach>
</if>
</select>
<!-- 每个区域每个季度的执法检查数量
分组:区(district) + 年份(YEAR) + 季度(QUARTER)
统计口径:已提交(is_submit=1)且已过滤常规校验条件 -->
<select id="queryDistrictQuarterInspectionCount" parameterType="com.zdxt.enforcementcode.domain.bo.SixAnalysisParamsBo" resultType="map">
SELECT
IFNULL(r.district, '未分配区域') AS district,
YEAR(r.enforcement_time) AS year,
QUARTER(r.enforcement_time) AS quarter,
CAST(COUNT(1) AS SIGNED) AS inspectionCount
FROM enforcement_registration r
WHERE r.enforcement_time IS NOT NULL
AND r.district IS NOT NULL
AND r.district != ''
AND r.is_submit = 1
AND r.is_delete = 0
AND r.law_enforcement_id IS NOT NULL
AND r.enterprise_name IS NOT NULL
<if test="year != null">
AND YEAR(r.enforcement_time) = #{year}
</if>
<if test="quarter != null">
AND QUARTER(r.enforcement_time) = #{quarter}
</if>
<if test="beginTime != null and beginTime != ''">
AND r.enforcement_time &gt;= #{beginTime}
</if>
<if test="endTime != null and endTime != ''">
AND r.enforcement_time &lt; #{endTime}
</if>
<if test="qy != null and qy != ''">
AND r.district = #{qy}
</if>
<if test="area != null and area != ''">
AND r.district = #{area}
</if>
<if test="zone == 1">AND r.zone = 1</if>
<if test="zone == 2">AND r.zone IS NULL</if>
<if test="filterDepts != null and filterDepts.size() > 0">
AND r.bureau_dept_id IN
<foreach collection="filterDepts" item="bureau_dept_id" open="(" separator="," close=")">#{bureau_dept_id}</foreach>
</if>
<if test="bureauDeptId != null and bureauDeptId != ''">
AND r.bureau_dept_id = #{bureauDeptId}
</if>
<if test="params.dataScope != null and params.dataScope != ''">${params.dataScope}</if>
GROUP BY r.district, YEAR(r.enforcement_time), QUARTER(r.enforcement_time)
ORDER BY r.district ASC, year ASC, quarter ASC
</select>
</mapper>

Loading…
Cancel
Save