Browse Source

同步下修改的代码

v6
蟑螂恶霸 1 year ago
parent
commit
95e8b2da2a
  1. 6
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java
  2. 10
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java
  3. 7
      lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppSystemController.java
  4. 3
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/feign/DeptApiImpl.java
  5. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/user/service/UserServiceImpl.java
  6. 2
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml
  7. 16
      lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml
  8. 12
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html
  9. 188
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java
  10. 293
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysisParams.java
  11. 27
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
  12. 1
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseInformationService.java
  13. 27
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java
  14. 5
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  15. 76
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
  16. 28
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml
  17. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml
  18. 2
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/NonEnforcementRegistrationMapper.xml
  19. 433
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

6
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnforcementRegistrationController.java

@ -601,8 +601,10 @@ public class AppEnforcementRegistrationController extends BaseController
//查询行政检查评价
EnterpriseEvaluate enterpriseEvaluate = new EnterpriseEvaluate();
if (StringUtils.isNotEmpty(regResults.get(0).getUniteCheck())) {
enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUniteCheck());
// if (StringUtils.isNotEmpty(regResults.get(0).getUniteCheck())) {
// enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUniteCheck());
if (StringUtils.isNotEmpty(regResults.get(0).getUnionNo())) {
enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByUniteCheck(regResults.get(0).getUnionNo());
} else {
enterpriseEvaluate = enterpriseEvaluateService.selectEnterpriseEvaluateByRelId(regResults.get(0).getId());
}

10
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppEnterpriseInformationController.java

@ -76,9 +76,15 @@ public class AppEnterpriseInformationController extends BaseController
@ResponseBody
public TableDataInfo queryListAndQrInfo(@RequestBody EnterpriseInformation enterpriseInformation)
{
startPage();
// startPage();
List<EnterpriseInformation> list = enterpriseInformationService.selectEnterpriseInformationAndQrInfo(enterpriseInformation);
return getDataTable(list);
// return getDataTable(list);
TableDataInfo rspData = getDataTable(list);
rspData.setCode(0);
rspData.setRows(list);
rspData.setTotal(60);
return rspData;
}
/**

7
lib/EmergencyService/zdxtEmergencyAppService/src/main/java/com/zdxt/app/controller/AppSystemController.java

@ -1,6 +1,7 @@
package com.zdxt.app.controller;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.util.StrUtil;
import com.zdxt.auth.dto.DeptBean;
import com.zdxt.auth.dto.PostBean;
@ -28,6 +29,7 @@ import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* @Author: kylin
@ -104,6 +106,11 @@ public class AppSystemController extends BaseController {
@ResponseBody
public TableDataInfo listApp(User user) {
startPage();
if (null != user.getNotUserId()) {
Map<String, Object> params = user.getParams();
params.put("notUserIds", Convert.toStrArray(user.getNotUserId()));
}
user.setDataScopeId(null);
List<User> list = userService.selectUserListByHave(user);
//解密
// if(list.size() > 0){

3
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/feign/DeptApiImpl.java

@ -81,6 +81,7 @@ public class DeptApiImpl implements DeptApi {
Dept dept2 = new Dept();
dept2.setDeptName(deptBean2.getDeptName());
dept2.setDeptType(deptBean2.getDeptType());
dept2.setZone(deptBean2.getZone());
List<Dept> depts = iDeptService.selectDeptListNoPermission(dept2);
List<DeptBean> deptBeans = new ArrayList<>();
DeptBean deptBean;
@ -297,7 +298,7 @@ public class DeptApiImpl implements DeptApi {
DeptBean dept = deptApi.getDeptById(deptId);
Optional op =Optional.ofNullable(dept);
if(!op.isPresent() || deptId == null)return null; // 防止admin这种没有部门的进来后造成死循环
if (null != dept.getZone() && (5 == dept.getZone() || 1 == dept.getZone())) {
if (null != dept.getZone() && (5 == dept.getZone() || 15 == dept.getZone())) {
return dept;
}
return iterationDeptParentToBureauGA(dept.getParentId());

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/java/com/zdxt/auth/project/system/user/service/UserServiceImpl.java

@ -133,7 +133,7 @@ public class UserServiceImpl implements IUserService {
}
@Override
@DataScope(deptAlias = "d", userAlias = "u")
// @DataScope(deptAlias = "d", userAlias = "u")
public List<User> selectUserListByHave(User user) {
return userMapper.selectUserListByHave(user);
}

2
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/DeptMapper.xml

@ -172,7 +172,7 @@
#{item}
</foreach>
</if>
<if test="zone != null and zone != ''">
<if test="zone != null">
AND zone = #{zone}
</if>
<if test="zzDisplayPath != null and zzDisplayPath != ''">

16
lib/EmergencyService/zdxtEmergencyAuthService/src/main/resources/mapper/system/UserMapper.xml

@ -192,18 +192,21 @@
AND date_format(u.create_time,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
<if test="deptId != null and deptId != ''">
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET
(#{deptId},ancestors) ))
and u.dept_id = #{deptId}
</if>
<!-- 租户数据过滤 -->
<if test="tenantCode != @com.zdxt.auth.common.constant.Constants@DEFAULT_TENANT_CODE and tenantCode != null and tenantCode != ''">
AND u.tenant_code = #{tenantCode}
</if>
<if test="notUserId != null and notUserId != ''">
and u.user_id not in (#{notUserId})
and u.user_id not in
<foreach item="uid" collection="params.notUserIds" open="(" separator="," close=")">
#{uid}
</foreach>
</if>
AND u.law_certificate_num is not null
AND u.law_certificate_num !=""
-- AND u.law_certificate_num is not null
-- AND u.law_certificate_num !=""
and u.dept_id != 405
<if test="params.dataScope != null and params.dataScope != ''">
<!-- 数据范围过滤 -->
${params.dataScope}
@ -218,7 +221,8 @@
left join sys_tenant t on t.tenant_code = u.tenant_code
where u.del_flag = '0'
<if test="deptId != null and deptId != ''">
AND (u.dept_id = #{deptId})
AND (u.dept_id = #{deptId} OR u.dept_id IN ( SELECT t.dept_id FROM sys_dept t WHERE FIND_IN_SET
(#{deptId},ancestors) <![CDATA[ <> ]]> 0 ))
</if>
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')

12
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/single-analysis.html

@ -275,6 +275,16 @@
var deptName = null;
var beginTime = null;
var endTime = null;
$.ajax({
url: ctx + "code/statisticalPanel/queryDeptLength",
type: "post",
data: JSON.stringify({"zoneList": [1, 15, 16]}),
dataType: 'json',
contentType: "application/json",
success: function (result) {
totalSize = result.data;
}
});
layui.use('laydate',function(){
var laydate = layui.laydate;
@ -324,7 +334,7 @@
$.ajax({
url: ctx + "code/statisticalPanel/queryDept",
type: "post",
data: JSON.stringify({"zone": 1}),
data: JSON.stringify({"zoneList": [1, 15, 16]}),
dataType: 'json',
contentType: "application/json",
success: function(res) {

188
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java

@ -14,7 +14,10 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 综合统计
@ -107,6 +110,11 @@ public class StatisticalPanelController extends BaseController {
{
return "project/code/statistical/single-analysis";
}
@GetMapping("/home-analysis")
public String homeAnalysis(Model model)
{
return "project/code/statistical/home";
}
/**
@ -197,9 +205,9 @@ public class StatisticalPanelController extends BaseController {
return ZDResponse.success("部门列表", deptBeans);
}
@GetMapping("/queryDeptLength")
@PostMapping("/queryDeptLength")
@ResponseBody
public ZDResponse queryDeptLength(DeptBean deptParams){
public ZDResponse queryDeptLength(@RequestBody DeptBean deptParams){
return ZDResponse.success("部门列表长度", deptApi.queryDeptLength(deptParams));
}
@ -210,5 +218,181 @@ public class StatisticalPanelController extends BaseController {
return ZDResponse.success("部门列表-街道和区直", deptBeans);
}
/** 涉企检查 - 统计 */
@PostMapping("/analysisEnterprisesIns")
@ResponseBody
public ZDResponse analysisEnterprisesIns(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprisesIns(params);
double ent_rr_num = statisticalPaneService.analysisEnterprisesInsRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesInsYoy(params);
params.setUniteCheck(null);
Integer allnum = statisticalPaneService.analysisEnterprisesIns(params);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
String per = this.setPercentage((double)num / allnum);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("num", num);
resMap.put("rr", rr);
resMap.put("yoy", yoy);
resMap.put("per", per);
return ZDResponse.success("联合检查", resMap);
}
/** 非行政涉企检查 - 统计 */
@PostMapping("/analysisEnterprisesNonIns")
@ResponseBody
public ZDResponse analysisEnterprisesNonIns(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysis_non_enterprisesIns(params);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("num", num);
return ZDResponse.success("联合检查", resMap);
}
/** 检查预告 - 统计 */
@PostMapping("/analysisInsNotice")
@ResponseBody
public ZDResponse analysisInsNotice(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisInsNotice(params);
double ent_rr_num = statisticalPaneService.analysisInsNoticeRr(params);
double ent_yoy_num = statisticalPaneService.analysisInsNoticeYoy(params);
params.setIsReg(1);
Integer isnum = statisticalPaneService.analysisInsNotice(params);
String per = this.setPercentage((double)isnum / num);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("num", num);
resMap.put("rr", rr);
resMap.put("yoy", yoy);
resMap.put("per", per);
return ZDResponse.success("检查预告", resMap);
}
/** 涉企投诉 - 统计 */
@PostMapping("/analysisEnterprisesComplaint")
@ResponseBody
public ZDResponse analysisEnterprisesComplaint(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprisesComplaint(params);
double ent_rr_num = statisticalPaneService.analysisEnterprisesComplaintRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesComplaintYoy(params);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("num", num);
resMap.put("rr", rr);
resMap.put("yoy", yoy);
return ZDResponse.success("涉企投诉", resMap);
}
/** 被查企业 - 统计 */
@PostMapping("/analysisEnterprises")
@ResponseBody
public ZDResponse analysisEnterprises(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprises(params);
double ent_rr_num = statisticalPaneService.analysisEnterprisesRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesYoy(params);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("num", num);
resMap.put("rr", rr);
resMap.put("yoy", yoy);
return ZDResponse.success("被查企业", resMap);
}
/** 非行政检查类型 - 统计 */
@PostMapping("/analysisNonRegistration")
@ResponseBody
public ZDResponse analysisNonRegistration(@RequestBody SixAnalysisParams params){
List<Map<String, Object>> resMaps = statisticalPaneService.analysisNonRegistration(params);
return ZDResponse.success("被查企业", resMaps);
}
/** 按区的行政/非行政 - 统计 */
@PostMapping("/areaRegistration")
@ResponseBody
public ZDResponse areaRegistration(@RequestBody SixAnalysisParams params){
DeptBean deptParams = new DeptBean();
deptParams.setZone(2);
deptParams.setDeptName(params.getDeptId());
List<DeptBean> depts = deptApi.selectDepts(deptParams);
params.setDeptId(depts.get(0).getDeptId());
Integer jc_num = statisticalPaneService.analysisEnterprisesIns(params);
Integer qy_num = statisticalPaneService.analysisEnterprises(params);
Integer njc_num = statisticalPaneService.analysis_non_enterprisesIns(params);
Integer nqy_num = statisticalPaneService.analysis_non_enterprises(params);
// 下转弹出层需要的数据(联合检查, 涉企检查频次压缩率, 行政检查预告次数, 涉企投诉次数)
params.setUniteCheck("1");
Integer nuite_jc_num_all = statisticalPaneService.analysis_enterprisesIns_all(params);
Integer nuite_jc_num = statisticalPaneService.analysisEnterprisesIns(params);
params.setUniteCheck(null);
Integer law_jc_num = statisticalPaneService.analysisInsNotice(params);
Integer com_jc_num = statisticalPaneService.analysisEnterprisesComplaint(params);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("area", deptParams.getDeptName());
resMap.put("jc_num", jc_num);
resMap.put("qy_num", qy_num);
resMap.put("njc_num", njc_num);
resMap.put("nqy_num", nqy_num);
resMap.put("nuite_jc_num", nuite_jc_num);
if(null == nuite_jc_num || 0 == nuite_jc_num) {
resMap.put("per_jc_num", 0+"%");
} else {
resMap.put("per_jc_num", ((double)nuite_jc_num/nuite_jc_num_all)*100+"%");
}
resMap.put("law_jc_num", law_jc_num);
resMap.put("com_jc_num", com_jc_num);
return ZDResponse.success(deptParams.getDeptName()+"的行政/非行政", resMap);
}
/** 时间维度 */
@PostMapping("/analysisTime")
@ResponseBody
public ZDResponse analysisEnterprisesInsTime(@RequestBody SixAnalysisParams params){
List<Map<String, Object>> insMaps = statisticalPaneService.analysisEnterprisesInsTime(params);
List<Map<String, Object>> entMaps = statisticalPaneService.analysisEnterprisesTime(params);
List<String> times = new ArrayList<>();
List<String> ins = new ArrayList<>();
List<String> ent = new ArrayList<>();
if (insMaps.size()<=entMaps.size()) {
for(int i=0 ; i<insMaps.size() ; i++) {
times.add(insMaps.get(i).get("time").toString());
ins.add(insMaps.get(i).get("num").toString());
ent.add(entMaps.get(i).get("num").toString());
}
} else {
for(int i=0 ; i<entMaps.size() ; i++) {
times.add(insMaps.get(i).get("time").toString());
ins.add(insMaps.get(i).get("num").toString());
ent.add(entMaps.get(i).get("num").toString());
}
}
Map<String, Object> resMap = new HashMap<>();
resMap.put("times", times);
resMap.put("ins", ins);
resMap.put("ent", ent);
return ZDResponse.success("被查企业", resMap);
}
private String setPercentage(Double percentage) {
if (percentage == 0 || percentage.isNaN() || percentage.isInfinite()) {
return "0.0";
} else {
String s = percentage * 100 + "";
if (s.length() > s.indexOf(".") + 3) {
percentage = Double.valueOf(s.substring(0, s.indexOf(".") + 3));
} else {
percentage = Double.valueOf(s);
}
return Double.valueOf(String.format("%.2f", percentage)).toString();
}
}
}

293
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/SixAnalysisParams.java

@ -1,142 +1,151 @@
package com.zdxt.code.domain;
import com.zdxt.common.BaseDomain;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SixAnalysisParams extends BaseDomain {
private Long userId;
private String bureauDeptId;
private String bureauDeptName;
/** 0:联合检查, 1:单独检查, null:所有检查 */
private String uniteCheck;
/** 区域传入 字典类型 */
private String qy;
private String jd;
/** 开始时间 */
private String beginTime;
/** 接受时间 */
private String endTime;
/** 时间类型:year,quarter,month,day */
private String dateType;
private Integer year;
private Integer quarter;
private Integer month;
private Integer day;
// Map<String, Object> params = new HashMap<String, Object>();
//
// public Map<String, Object> getParams() {
// return params;
// }
//
// public void setParams(Map<String, Object> params) {
// this.params = params;
// }
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getBureauDeptId() {
return bureauDeptId;
}
public void setBureauDeptId(String bureauDeptId) {
this.bureauDeptId = bureauDeptId;
}
public String getBureauDeptName() {
return bureauDeptName;
}
public void setBureauDeptName(String bureauDeptName) {
this.bureauDeptName = bureauDeptName;
}
public String getUniteCheck() {
return uniteCheck;
}
public void setUniteCheck(String uniteCheck) {
this.uniteCheck = uniteCheck;
}
public String getQy() {
return qy;
}
public void setQy(String qy) {
this.qy = qy;
}
public String getJd() {
return jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getDateType() {
return dateType;
}
public void setDateType(String dateType) {
this.dateType = dateType;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public Integer getQuarter() {
return quarter;
}
public void setQuarter(Integer quarter) {
this.quarter = quarter;
}
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getDay() {
return day;
}
public void setDay(Integer day) {
this.day = day;
}
}
package com.zdxt.code.domain;
import com.zdxt.common.BaseDomain;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class SixAnalysisParams extends BaseDomain {
private Long userId;
private String bureauDeptId;
private String bureauDeptName;
/** 0:联合检查, 1:单独检查, null:所有检查 */
private String uniteCheck;
/** 区域传入 字典类型 */
private String qy;
private String jd;
/** 开始时间 */
private String beginTime;
/** 接受时间 */
private String endTime;
/** 时间类型:year,quarter,month,day */
private String dateType;
private Integer year;
private Integer quarter;
private Integer month;
private Integer day;
private Integer isReg;
// Map<String, Object> params = new HashMap<String, Object>();
//
// public Map<String, Object> getParams() {
// return params;
// }
//
// public void setParams(Map<String, Object> params) {
// this.params = params;
// }
public Integer getIsReg() {
return isReg;
}
public void setIsReg(Integer isReg) {
this.isReg = isReg;
}
public Long getUserId() {
return userId;
}
public void setUserId(Long userId) {
this.userId = userId;
}
public String getBureauDeptId() {
return bureauDeptId;
}
public void setBureauDeptId(String bureauDeptId) {
this.bureauDeptId = bureauDeptId;
}
public String getBureauDeptName() {
return bureauDeptName;
}
public void setBureauDeptName(String bureauDeptName) {
this.bureauDeptName = bureauDeptName;
}
public String getUniteCheck() {
return uniteCheck;
}
public void setUniteCheck(String uniteCheck) {
this.uniteCheck = uniteCheck;
}
public String getQy() {
return qy;
}
public void setQy(String qy) {
this.qy = qy;
}
public String getJd() {
return jd;
}
public void setJd(String jd) {
this.jd = jd;
}
public String getBeginTime() {
return beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getDateType() {
return dateType;
}
public void setDateType(String dateType) {
this.dateType = dateType;
}
public Integer getYear() {
return year;
}
public void setYear(Integer year) {
this.year = year;
}
public Integer getQuarter() {
return quarter;
}
public void setQuarter(Integer quarter) {
this.quarter = quarter;
}
public Integer getMonth() {
return month;
}
public void setMonth(Integer month) {
this.month = month;
}
public Integer getDay() {
return day;
}
public void setDay(Integer day) {
this.day = day;
}
}

27
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java

@ -119,4 +119,31 @@ public interface StatisticalPanelMapper {
/** 投诉类型 */
List<Map<String, Object>> staisticalEnforce_type(SixAnalysisParams params);
/** 涉企检查 */
Integer analysis_enterprisesIns(SixAnalysisParams params);
Double analysis_enterprisesIns_rr(SixAnalysisParams params);
Double analysis_enterprisesIns_yoy(SixAnalysisParams params);
Integer analysis_non_enterprisesIns(SixAnalysisParams params);
Integer analysis_enterprisesIns_all(SixAnalysisParams params);
/** 检查预告 */
Integer analysis_insNotice(SixAnalysisParams params);
Double analysis_insNotice_rr(SixAnalysisParams params);
Double analysis_insNotice_yoy(SixAnalysisParams params);
/** 涉企投诉 */
Integer analysis_enterprisesComplaint(SixAnalysisParams params);
Double analysis_enterprisesComplaint_rr(SixAnalysisParams params);
Double analysis_enterprisesComplaint_yoy(SixAnalysisParams params);
/** 被查企业 */
Integer analysis_enterprises(SixAnalysisParams params);
Double analysis_enterprises_rr(SixAnalysisParams params);
Double analysis_enterprises_yoy(SixAnalysisParams params);
Integer analysis_non_enterprises(SixAnalysisParams params);
/** 时间维度 */
List<Map<String, Object>> analysis_enterprisesIns_time(SixAnalysisParams params);
List<Map<String, Object>> analysis_enterprises_time(SixAnalysisParams params);
/** 非行政检查类型 */
List<Map<String, Object>> analysis_non_registration(SixAnalysisParams params);
}

1
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/IEnterpriseInformationService.java

@ -25,6 +25,7 @@ public interface IEnterpriseInformationService
*/
EnterpriseInformation selectEnterpriseInformationById(String id);
EnterpriseInformation selectEnterpriseInformationByNum(String num);
EnterpriseInformation selectEnterpriseInformationByNumOne(String num);
/**
* 查询企业信息

27
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java

@ -74,4 +74,31 @@ public interface StatisticalPaneService {
/** 投诉类型 */
List<Map<String, Object>> staisticalEnforce_type(SixAnalysisParams params);
/** 涉企检查 */
Integer analysisEnterprisesIns(SixAnalysisParams params);
Double analysisEnterprisesInsRr(SixAnalysisParams params);
Double analysisEnterprisesInsYoy(SixAnalysisParams params);
Integer analysis_non_enterprisesIns(SixAnalysisParams params);
Integer analysis_enterprisesIns_all(SixAnalysisParams params);
/** 检查预告 */
Integer analysisInsNotice(SixAnalysisParams params);
Double analysisInsNoticeRr(SixAnalysisParams params);
Double analysisInsNoticeYoy(SixAnalysisParams params);
/** 涉企投诉 */
Integer analysisEnterprisesComplaint(SixAnalysisParams params);
Double analysisEnterprisesComplaintRr(SixAnalysisParams params);
Double analysisEnterprisesComplaintYoy(SixAnalysisParams params);
/** 被查企业 */
Integer analysisEnterprises(SixAnalysisParams params);
Double analysisEnterprisesRr(SixAnalysisParams params);
Double analysisEnterprisesYoy(SixAnalysisParams params);
Integer analysis_non_enterprises(SixAnalysisParams params);
/** 非行政检查类型 */
List<Map<String, Object>> analysisNonRegistration(SixAnalysisParams params);
/** 时间维度 */
List<Map<String, Object>> analysisEnterprisesInsTime(SixAnalysisParams params);
List<Map<String, Object>> analysisEnterprisesTime(SixAnalysisParams params);
}

5
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -115,6 +115,11 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
return enterpriseInformation;
}
@Override
public EnterpriseInformation selectEnterpriseInformationByNumOne(String num) {
return enterpriseInformationMapper.selectEnterpriseInformationByNum(num);
}
@Override
public EnterpriseInformation selectEnterpriseInformationBySalt(String salt) {
return enterpriseInformationMapper.selectEnterpriseInformationBySalt(salt);

76
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java

@ -1500,4 +1500,80 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
// return all_area;
// }
@Override
public Integer analysisEnterprisesIns(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns(params);
}
@Override
public Double analysisEnterprisesInsRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_rr(params);
}
@Override
public Double analysisEnterprisesInsYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_yoy(params);
}
@Override
public Integer analysis_non_enterprisesIns(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_non_enterprisesIns(params);
}
@Override
public Integer analysis_enterprisesIns_all(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_all(params);
}
@Override
public Integer analysisInsNotice(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_insNotice(params);
}
@Override
public Double analysisInsNoticeRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_insNotice_rr(params);
}
@Override
public Double analysisInsNoticeYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_insNotice_yoy(params);
}
@Override
public Integer analysisEnterprisesComplaint(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesComplaint(params);
}
@Override
public Double analysisEnterprisesComplaintRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesComplaint_rr(params);
}
@Override
public Double analysisEnterprisesComplaintYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesComplaint_yoy(params);
}
@Override
public Integer analysisEnterprises(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises(params);
}
@Override
public Double analysisEnterprisesRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_rr(params);
}
@Override
public Double analysisEnterprisesYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_yoy(params);
}
@Override
public Integer analysis_non_enterprises(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_non_enterprises(params);
}
@Override
public List<Map<String, Object>> analysisNonRegistration(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_non_registration(params);
}
@Override
public List<Map<String, Object>> analysisEnterprisesInsTime(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_time(params);
}
@Override
public List<Map<String, Object>> analysisEnterprisesTime(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_time(params);
}
}

28
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementRegistrationMapper.xml

@ -84,7 +84,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<if test="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if>
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer like concat('%',#{lawEnforcer} ,'%') or law_enforcer_two like concat('%',#{lawEnforcer} ,'%')</if>
<if test="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if>
<if test="lawEnforcerId != null and lawEnforcerId != ''">
<if test="dataScopeId == null or dataScopeId == ''">
and law_enforcer_id = #{lawEnforcerId}
</if>
</if>
<if test="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<if test="lawEnforcerIdTwo != null and lawEnforcerIdTwo != ''"> and law_enforcer_id_two = #{lawEnforcerIdTwo}</if>
<if test="lawEnforcerTelTwo != null and lawEnforcerTelTwo != ''"> and law_enforcer_tel_two = #{lawEnforcerTelTwo}</if>
@ -97,7 +101,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if>
<if test="reslut != null "> and reslut = #{reslut}</if>
<if test="isSubmit != null "> and is_submit = #{isSubmit}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userId != null">
<if test="dataScopeId == null or dataScopeId == ''">
and user_id = #{userId}
</if>
</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="isComplaint != null "> and is_complaint = #{isComplaint}</if>
@ -155,7 +163,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and enforcement_time &lt;= #{params.endTime}
</if>
<if test="dataScopeId != null and dataScopeId != ''">
and (law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
and (law_enforcer_id = #{dataScopeId} or user_id = #{dataScopeId} or law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
</if>
</where>
order by enforcement_time desc
@ -175,7 +183,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="enterpriseNumber != null and enterpriseNumber != ''"> and enterprise_number = #{enterpriseNumber}</if>
<if test="enforcementTime != null "> and enforcement_time = #{enforcementTime}</if>
<if test="lawEnforcer != null and lawEnforcer != ''"> and law_enforcer like concat('%',#{lawEnforcer} ,'%') or law_enforcer_two like concat('%',#{lawEnforcer} ,'%')</if>
<if test="lawEnforcerId != null and lawEnforcerId != ''"> and law_enforcer_id = #{lawEnforcerId}</if>
<if test="lawEnforcerId != null and lawEnforcerId != ''">
<if test="dataScopeId == null or dataScopeId == ''">
and law_enforcer_id = #{lawEnforcerId}
</if>
</if>
<if test="lawEnforcerTel != null and lawEnforcerTel != ''"> and law_enforcer_tel = #{lawEnforcerTel}</if>
<if test="lawEnforcerIdTwo != null and lawEnforcerIdTwo != ''"> and law_enforcer_id_two = #{lawEnforcerIdTwo}</if>
<if test="lawEnforcerTelTwo != null and lawEnforcerTelTwo != ''"> and law_enforcer_tel_two = #{lawEnforcerTelTwo}</if>
@ -188,7 +200,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="lawEnforcementBasisText != null and lawEnforcementBasisText != ''"> and law_enforcement_basis_text = #{lawEnforcementBasisText}</if>
<if test="reslut != null "> and reslut = #{reslut}</if>
<if test="isSubmit != null "> and is_submit = #{isSubmit}</if>
<if test="userId != null "> and user_id = #{userId}</if>
<if test="userId != null ">
<if test="dataScopeId == null or dataScopeId == ''">
and user_id = #{userId}
</if>
</if>
<if test="deptId != null "> and dept_id = #{deptId}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="isComplaint != null "> and is_complaint = #{isComplaint}</if>
@ -246,7 +262,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and enforcement_time &lt;= #{params.endTime}
</if>
<if test="dataScopeId != null and dataScopeId != ''">
and (law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
and (law_enforcer_id = #{dataScopeId} or user_id = #{dataScopeId} or law_enforcer_id = #{dataScopeId} or FIND_IN_SET(#{dataScopeId}, law_enforcer_id_two))
</if>
</where>
order by enforcement_time desc

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml

@ -112,9 +112,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
enterprise_information ei
LEFT JOIN (
SELECT
*
enterprise_number, qr_code_url
FROM
( SELECT * FROM qr_code_generate_history WHERE `status` = 0 ORDER BY generate_time DESC LIMIT 1000000000 ) t
( SELECT enterprise_number, qr_code_url, generate_time FROM qr_code_generate_history WHERE `status` = 0 ORDER BY generate_time DESC LIMIT 1000000000 ) t
GROUP BY
t.enterprise_number
ORDER BY
@ -130,6 +130,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
ORDER BY ei.create_time DESC
<if test="params.pageNum != null and params.pageSize != null"><!-- 开始时间检索 -->
LIMIT #{params.pageNum}, #{params.pageSize}
</if>
</select>
<select id="selectEnterpriseInformationById" parameterType="String" resultMap="EnterpriseInformationResult">

2
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/NonEnforcementRegistrationMapper.xml

@ -73,7 +73,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
</where>
order by create_time desc
order by enforcement_time desc
</select>
<select id="selectNonEnforcementRegistrationById" parameterType="String" resultMap="NonEnforcementRegistrationResult">

433
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

@ -1121,4 +1121,437 @@
group by t.satisfaction_level
</select>
<!-- 执法检查数量排行 -->
<select id="analysis_enterprisesIns" parameterType="SixAnalysisParams" resultType="integer">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<select id="analysis_enterprisesIns_rr" parameterType="SixAnalysisParams" resultType="double">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</select>
<select id="analysis_enterprisesIns_yoy" parameterType="SixAnalysisParams" resultType="double">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</select>
<select id="analysis_non_enterprisesIns" parameterType="SixAnalysisParams" resultType="integer">
select
count(1) as num
from non_enforcement_registration r
where r.bureau_dept_name is not null
and r.dept_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer_id is not null
and r.law_enforcer_id_other is not null
and r.law_enforcement_type is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<select id="analysis_enterprisesIns_all" parameterType="SixAnalysisParams" resultType="integer">
select
count(1) as num
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<!-- 检查预告 -->
<select id="analysis_insNotice" parameterType="SixAnalysisParams" resultType="integer">
select count(1) as num from enterprise_law_enforcement n
<where>
and n.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="isReg != null">and is_reg=#{isReg}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.enforcement_time,'%Y-%m-%d') </if>
</where>
</select>
<select id="analysis_insNotice_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) as num from enterprise_law_enforcement n
<where>
and n.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(n.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(n.enforcement_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="analysis_insNotice_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) as num from enterprise_law_enforcement n
<where>
and n.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and n.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and n.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( n.law_enforcer_id=#{userId} or n.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(n.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 涉企投诉 -->
<select id="analysis_enterprisesComplaint" parameterType="SixAnalysisParams" resultType="integer">
select count(1) as num from complaint_statistics c
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(c.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.enforcement_time,'%Y-%m-%d') </if>
</where>
</select>
<select id="analysis_enterprisesComplaint_rr" parameterType="SixAnalysisParams" resultType="double">
select count(1) as num from complaint_statistics c
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(c.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(c.enforcement_time,'%Y-%m-%d')
</if>
</where>
</select>
<select id="analysis_enterprisesComplaint_yoy" parameterType="SixAnalysisParams" resultType="double">
select count(1) as num from complaint_statistics c
<where>
and (c.rid is not null or c.complaint_department_id is not null)
and c.enforce_type is not null
and c.enterprise_number is not null
<if test="params.zone != null and params.zone != ''">
and c.complaint_department_id in (select dept_id from sys_dept where zone = #{params.zone})
</if>
<if test="deptId != null and deptId != ''">
and c.complaint_department_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or c.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(c.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</where>
</select>
<!-- 被查企业 -->
<select id="analysis_enterprises" parameterType="SixAnalysisParams" resultType="integer">
select
count(distinct enterprise_number) as num
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<select id="analysis_enterprises_rr" parameterType="SixAnalysisParams" resultType="double">
select
count(distinct enterprise_number) as num
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</select>
<select id="analysis_enterprises_yoy" parameterType="SixAnalysisParams" resultType="double">
select
count(distinct enterprise_number) as num
from enforcement_registration r
where r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</select>
<select id="analysis_non_enterprises" parameterType="SixAnalysisParams" resultType="integer">
select
count(distinct enterprise_number) as num
from non_enforcement_registration r
where r.bureau_dept_name is not null
and r.dept_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer_id is not null
and r.law_enforcer_id_other is not null
and r.law_enforcement_type is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<!-- 时间维度统计 -->
<!-- 检查 -->
<select id="analysis_enterprisesIns_time" parameterType="SixAnalysisParams" resultType="map">
select
DATE_FORMAT(enforcement_time, '%Y-%m') as time, count(1) as num
from enforcement_registration r
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</where>
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
</select>
<!-- 企业 -->
<select id="analysis_enterprises_time" parameterType="SixAnalysisParams" resultType="map">
select
DATE_FORMAT(enforcement_time, '%Y-%m') as time, count(distinct enterprise_number) as num
from enforcement_registration r
<where>
and r.bureau_dept_name is not null
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</where>
group by DATE_FORMAT(enforcement_time, '%Y-%m') order by enforcement_time
</select>
<!-- 非行政检查类型统计 -->
<select id="analysis_non_registration" parameterType="SixAnalysisParams" resultType="map">
select sdd.dict_label, count(nr.law_enforcement_type) as num from sys_dict_data sdd
left join non_enforcement_registration nr on nr.law_enforcement_type = sdd.dict_value
<where>
<if test="params.check_category == 'non'">
and sdd.dict_type = 'no_check_category'
</if>
<if test="params.check_category != 'non'">
and sdd.dict_type = 'check_category'
</if>
<if test="params.zone != null and params.zone != ''"> and nr.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and nr.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '0'.toString()"> and (nr.union_no is not null and nr.union_no != '')</if>
<if test="uniteCheck == '1'.toString()"> and (nr.union_no is null or nr.union_no = '')</if>
<if test="userId != null and userId != '' ">and( nr.law_enforcer_id=#{userId} or nr.law_enforcer_id_two=#{userId}) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(nr.enforcement_time,'%Y-%m-%d') </if>
</where>
group by sdd.dict_value
</select>
</mapper>
Loading…
Cancel
Save