9 changed files with 1929 additions and 1 deletions
@ -0,0 +1,50 @@ |
|||
package com.zdxt.enforcementcode.controller.app.enforcement; |
|||
|
|||
|
|||
import com.zdxt.enforcementcode.common.util.StringUtils; |
|||
import com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo; |
|||
import com.zdxt.enforcementcode.service.ComprehensiveAnalysisService; |
|||
import org.dromara.common.satoken.utils.LoginHelper; |
|||
import org.dromara.common.web.core.BaseController; |
|||
import org.dromara.system.domain.vo.SysDeptVo; |
|||
import org.dromara.system.domain.vo.SysUserVo; |
|||
import org.dromara.system.mapper.SysDeptMapper; |
|||
import org.dromara.system.mapper.SysUserMapper; |
|||
import org.dromara.system.service.ISysDeptService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Controller; |
|||
import org.springframework.web.bind.annotation.GetMapping; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.ResponseBody; |
|||
|
|||
@Controller |
|||
@RequestMapping("/app/appComprehensiveAnalysis") |
|||
public class AppComprehensiveAnalysisController extends BaseController { |
|||
@Autowired |
|||
private ComprehensiveAnalysisService comprehensiveAnalysisService; |
|||
@Autowired |
|||
private SysDeptMapper deptMapper; |
|||
@Autowired |
|||
private SysUserMapper sysUserMapper; |
|||
@Autowired |
|||
private ISysDeptService sysDeptService; |
|||
|
|||
|
|||
@GetMapping("/whole") |
|||
@ResponseBody |
|||
public ComprehensiveAnalysisBo whole(ComprehensiveAnalysisBo comprehensiveAnalysis){ |
|||
if("user".equals(comprehensiveAnalysis.getSearchType())){ |
|||
return comprehensiveAnalysisService.whole(comprehensiveAnalysis); |
|||
} else if ("bureauDept".equals(comprehensiveAnalysis.getSearchType())) { |
|||
String deptId = LoginHelper.getDeptId(); |
|||
SysDeptVo sysDeptVo = sysDeptService.iterationDeptParentToBureau(deptId); |
|||
String bureauDeptId = sysDeptVo.getDeptId(); |
|||
if(StringUtils.isNotBlank(bureauDeptId)){ |
|||
comprehensiveAnalysis.setUserId(null); |
|||
comprehensiveAnalysis.setBureauDeptId(bureauDeptId); |
|||
return comprehensiveAnalysisService.whole(comprehensiveAnalysis); |
|||
} |
|||
} |
|||
return new ComprehensiveAnalysisBo(); |
|||
} |
|||
} |
|||
@ -0,0 +1,529 @@ |
|||
package com.zdxt.enforcementcode.domain.bo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public class ComprehensiveAnalysisBo { |
|||
/** |
|||
* 企业社会统一信用代码 |
|||
*/ |
|||
private String enterpriseNumber; |
|||
private String enterpriseName; |
|||
private String enterpriseAddress; |
|||
/** |
|||
* 任务来源 |
|||
*/ |
|||
private String checkCategory; |
|||
private Integer checkCategoryNumber; |
|||
|
|||
/** |
|||
* 执法类别 |
|||
*/ |
|||
private String lawEnforceCategory; |
|||
private Integer lawEnforceCategoryNumber; |
|||
/** |
|||
* 企业类型 |
|||
*/ |
|||
private String companyOrgType; |
|||
private Integer companyOrgTypeNumber; |
|||
/** |
|||
* 投诉类型enforce_type |
|||
*/ |
|||
private String complaintType; |
|||
private Integer complaintTypeNumber; |
|||
/** |
|||
* 投诉数量 |
|||
*/ |
|||
private Integer complaintTotal; |
|||
/** |
|||
* 评论数量 |
|||
*/ |
|||
private Integer evaluateTotal; |
|||
/** |
|||
* 计划数量 |
|||
*/ |
|||
private Integer plantTotal; |
|||
/** |
|||
* 指标value或名称 |
|||
*/ |
|||
private String name; |
|||
/** |
|||
* name指标数量 |
|||
*/ |
|||
private Integer total; |
|||
/** |
|||
* name指标占比 |
|||
*/ |
|||
private Double percentage; |
|||
/** |
|||
* 环比 |
|||
*/ |
|||
private Double huanPercentage; |
|||
/** |
|||
* 同比 |
|||
*/ |
|||
private Double tongPercentage; |
|||
private List<ComprehensiveAnalysisBo> comprehensiveAnalysisList; |
|||
private List<ComprehensiveAnalysisBo> checkCategoryList; |
|||
private List<ComprehensiveAnalysisBo> companyOrgTypeList; |
|||
private List<ComprehensiveAnalysisBo> complaintTypeList; |
|||
|
|||
|
|||
// 执法类别list
|
|||
private List<ComprehensiveAnalysisBo> lawEnforceCategoryList; |
|||
|
|||
private Long userId; |
|||
private String bureauDeptId; |
|||
private String bureauDeptName; |
|||
/** |
|||
* user or bureauDept |
|||
*/ |
|||
private String searchType; |
|||
/** |
|||
* 时间类型:year,quarter,month,day |
|||
*/ |
|||
private String entrustDeptId; |
|||
private Integer hasAuth; |
|||
private String dateType; |
|||
private Integer year; |
|||
private Integer quarter; |
|||
private Integer month; |
|||
private Integer day; |
|||
private String beginTime; |
|||
private String endTime; |
|||
private String qy; |
|||
private String jd; |
|||
private Integer limit; |
|||
/** |
|||
* 涉企检查数量 |
|||
*/ |
|||
private Integer registrationTotal; |
|||
/** |
|||
* 联合检查数量 |
|||
*/ |
|||
private Integer uniteTotal; |
|||
/** |
|||
* 委托检查数量 |
|||
*/ |
|||
private Integer authTotal; |
|||
/** |
|||
* 执法检查预告数量 |
|||
*/ |
|||
private Integer noticeTotal; |
|||
/** |
|||
* 执法预警数量 |
|||
*/ |
|||
private Integer warningTotal; |
|||
/** |
|||
* 企业数量 |
|||
*/ |
|||
private Integer enterpriseTotal; |
|||
|
|||
public Integer getHasAuth() { |
|||
return hasAuth; |
|||
} |
|||
|
|||
public void setHasAuth(Integer hasAuth) { |
|||
this.hasAuth = hasAuth; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getLawEnforceCategoryList() { |
|||
return lawEnforceCategoryList; |
|||
} |
|||
|
|||
public void setLawEnforceCategoryList(List<ComprehensiveAnalysisBo> lawEnforceCategoryList) { |
|||
this.lawEnforceCategoryList = lawEnforceCategoryList; |
|||
} |
|||
|
|||
public String getCheckCategory() { |
|||
return checkCategory; |
|||
} |
|||
|
|||
public void setCheckCategory(String checkCategory) { |
|||
this.checkCategory = checkCategory; |
|||
} |
|||
|
|||
public String getLawEnforceCategory() { |
|||
return lawEnforceCategory; |
|||
} |
|||
|
|||
public void setLawEnforceCategory(String lawEnforceCategory) { |
|||
this.lawEnforceCategory = lawEnforceCategory; |
|||
} |
|||
|
|||
public Integer getLawEnforceCategoryNumber() { |
|||
return lawEnforceCategoryNumber; |
|||
} |
|||
|
|||
public void setLawEnforceCategoryNumber(Integer lawEnforceCategoryNumber) { |
|||
this.lawEnforceCategoryNumber = lawEnforceCategoryNumber; |
|||
} |
|||
|
|||
public String getEntrustDeptId() { |
|||
return entrustDeptId; |
|||
} |
|||
|
|||
public void setEntrustDeptId(String entrustDeptId) { |
|||
this.entrustDeptId = entrustDeptId; |
|||
} |
|||
|
|||
public String getCompanyOrgType() { |
|||
return companyOrgType; |
|||
} |
|||
|
|||
public void setCompanyOrgType(String companyOrgType) { |
|||
this.companyOrgType = companyOrgType; |
|||
} |
|||
|
|||
|
|||
public String getComplaintType() { |
|||
return complaintType; |
|||
} |
|||
|
|||
public void setComplaintType(String complaintType) { |
|||
this.complaintType = complaintType; |
|||
} |
|||
|
|||
|
|||
public Integer getEvaluateTotal() { |
|||
return evaluateTotal; |
|||
} |
|||
|
|||
public void setEvaluateTotal(Integer evaluateTotal) { |
|||
this.evaluateTotal = evaluateTotal; |
|||
} |
|||
|
|||
public Integer getPlantTotal() { |
|||
return plantTotal; |
|||
} |
|||
|
|||
public void setPlantTotal(Integer plantTotal) { |
|||
this.plantTotal = plantTotal; |
|||
} |
|||
|
|||
public String getName() { |
|||
return name; |
|||
} |
|||
|
|||
public void setName(String name) { |
|||
this.name = name; |
|||
} |
|||
|
|||
public Integer getTotal() { |
|||
return total; |
|||
} |
|||
|
|||
public void setTotal(Integer total) { |
|||
this.total = total; |
|||
} |
|||
|
|||
public Double getPercentage() { |
|||
return percentage; |
|||
} |
|||
|
|||
public void setPercentage(Double percentage) { |
|||
if (percentage == 0 || percentage.isNaN() || percentage.isInfinite()) { |
|||
this.percentage = (double) 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); |
|||
} |
|||
this.percentage = Double.valueOf(String.format("%.2f", percentage)); |
|||
} |
|||
} |
|||
|
|||
public Double getHuanPercentage() { |
|||
return huanPercentage; |
|||
} |
|||
|
|||
/** |
|||
* double value = 123.456; |
|||
* BigDecimal bd = new BigDecimal(value); |
|||
* bd = bd.setScale(2, BigDecimal.ROUND_HALF_UP); // 四舍五入
|
|||
* double result = bd.doubleValue(); |
|||
* |
|||
* @param huanPercentage |
|||
*/ |
|||
public void setHuanPercentage(Double huanPercentage) { |
|||
if (huanPercentage == 0 || huanPercentage.isNaN() || huanPercentage.isInfinite()) { |
|||
this.huanPercentage = (double) 0; |
|||
} else { |
|||
String s = huanPercentage * 100 + ""; |
|||
if (s.length() > s.indexOf(".") + 4) { |
|||
huanPercentage = Double.valueOf(s.substring(0, s.indexOf(".") + 4)); |
|||
} else { |
|||
huanPercentage = Double.valueOf(s); |
|||
} |
|||
this.huanPercentage = Double.valueOf(String.format("%.2f", huanPercentage)); |
|||
} |
|||
} |
|||
|
|||
public Double getTongPercentage() { |
|||
return tongPercentage; |
|||
} |
|||
|
|||
public void setTongPercentage(Double tongPercentage) { |
|||
System.out.println(tongPercentage); |
|||
if (tongPercentage == 0 || tongPercentage.isNaN() || tongPercentage.isInfinite()) { |
|||
this.tongPercentage = (double) 0; |
|||
} else { |
|||
String s = tongPercentage * 100 + ""; |
|||
if (s.length() > s.indexOf(".") + 3) { |
|||
tongPercentage = Double.valueOf(s.substring(0, s.indexOf(".") + 3)); |
|||
} else { |
|||
tongPercentage = Double.valueOf(s); |
|||
} |
|||
this.tongPercentage = Double.valueOf(String.format("%.2f", tongPercentage)); |
|||
} |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getComprehensiveAnalysisList() { |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
public void setComprehensiveAnalysisList(List<ComprehensiveAnalysisBo> comprehensiveAnalysisList) { |
|||
this.comprehensiveAnalysisList = comprehensiveAnalysisList; |
|||
} |
|||
|
|||
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 getSearchType() { |
|||
return searchType; |
|||
} |
|||
|
|||
public void setSearchType(String searchType) { |
|||
this.searchType = searchType; |
|||
} |
|||
|
|||
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; |
|||
} |
|||
|
|||
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 List<ComprehensiveAnalysisBo> getCheckCategoryList() { |
|||
return checkCategoryList; |
|||
} |
|||
|
|||
public void setCheckCategoryList(List<ComprehensiveAnalysisBo> checkCategoryList) { |
|||
this.checkCategoryList = checkCategoryList; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getCompanyOrgTypeList() { |
|||
return companyOrgTypeList; |
|||
} |
|||
|
|||
public void setCompanyOrgTypeList(List<ComprehensiveAnalysisBo> companyOrgTypeList) { |
|||
this.companyOrgTypeList = companyOrgTypeList; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getComplaintTypeList() { |
|||
return complaintTypeList; |
|||
} |
|||
|
|||
public void setComplaintTypeList(List<ComprehensiveAnalysisBo> complaintTypeList) { |
|||
this.complaintTypeList = complaintTypeList; |
|||
} |
|||
|
|||
public Integer getComplaintTotal() { |
|||
return complaintTotal; |
|||
} |
|||
|
|||
public void setComplaintTotal(Integer complaintTotal) { |
|||
this.complaintTotal = complaintTotal; |
|||
} |
|||
|
|||
public Integer getCheckCategoryNumber() { |
|||
return checkCategoryNumber; |
|||
} |
|||
|
|||
public void setCheckCategoryNumber(Integer checkCategoryNumber) { |
|||
this.checkCategoryNumber = checkCategoryNumber; |
|||
} |
|||
|
|||
public Integer getCompanyOrgTypeNumber() { |
|||
return companyOrgTypeNumber; |
|||
} |
|||
|
|||
public void setCompanyOrgTypeNumber(Integer companyOrgTypeNumber) { |
|||
this.companyOrgTypeNumber = companyOrgTypeNumber; |
|||
} |
|||
|
|||
public Integer getComplaintTypeNumber() { |
|||
return complaintTypeNumber; |
|||
} |
|||
|
|||
public void setComplaintTypeNumber(Integer complaintTypeNumber) { |
|||
this.complaintTypeNumber = complaintTypeNumber; |
|||
} |
|||
|
|||
public String getEnterpriseNumber() { |
|||
return enterpriseNumber; |
|||
} |
|||
|
|||
public void setEnterpriseNumber(String enterpriseNumber) { |
|||
this.enterpriseNumber = enterpriseNumber; |
|||
} |
|||
|
|||
public Integer getLimit() { |
|||
return limit; |
|||
} |
|||
|
|||
public void setLimit(Integer limit) { |
|||
this.limit = limit; |
|||
} |
|||
|
|||
public String getEnterpriseName() { |
|||
return enterpriseName; |
|||
} |
|||
|
|||
public void setEnterpriseName(String enterpriseName) { |
|||
this.enterpriseName = enterpriseName; |
|||
} |
|||
|
|||
public String getEnterpriseAddress() { |
|||
return enterpriseAddress; |
|||
} |
|||
|
|||
public void setEnterpriseAddress(String enterpriseAddress) { |
|||
this.enterpriseAddress = enterpriseAddress; |
|||
} |
|||
|
|||
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 Integer getRegistrationTotal() { |
|||
return registrationTotal; |
|||
} |
|||
|
|||
public void setRegistrationTotal(Integer registrationTotal) { |
|||
this.registrationTotal = registrationTotal; |
|||
} |
|||
|
|||
public Integer getUniteTotal() { |
|||
return uniteTotal; |
|||
} |
|||
|
|||
public void setUniteTotal(Integer uniteTotal) { |
|||
this.uniteTotal = uniteTotal; |
|||
} |
|||
|
|||
public Integer getNoticeTotal() { |
|||
return noticeTotal; |
|||
} |
|||
|
|||
public void setNoticeTotal(Integer noticeTotal) { |
|||
this.noticeTotal = noticeTotal; |
|||
} |
|||
|
|||
public Integer getWarningTotal() { |
|||
return warningTotal; |
|||
} |
|||
|
|||
public void setWarningTotal(Integer warningTotal) { |
|||
this.warningTotal = warningTotal; |
|||
} |
|||
|
|||
public Integer getEnterpriseTotal() { |
|||
return enterpriseTotal; |
|||
} |
|||
|
|||
public void setEnterpriseTotal(Integer enterpriseTotal) { |
|||
this.enterpriseTotal = enterpriseTotal; |
|||
} |
|||
|
|||
public String getBureauDeptName() { |
|||
return bureauDeptName; |
|||
} |
|||
|
|||
public void setBureauDeptName(String bureauDeptName) { |
|||
this.bureauDeptName = bureauDeptName; |
|||
} |
|||
|
|||
public Integer getAuthTotal() { |
|||
return authTotal; |
|||
} |
|||
|
|||
public void setAuthTotal(Integer authTotal) { |
|||
this.authTotal = authTotal; |
|||
} |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
package com.zdxt.enforcementcode.mapper; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ComprehensiveAnalysisMapper { |
|||
/** |
|||
* 获取执法记录,关联企业信息(本时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
* 注:企业名称使用的执法表内非企业表 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> primarySectionA(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
Integer countCurrentEntrust(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 获取执法记录,关联企业信息(环比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> huanSectionA(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* 获取执法记录,关联企业信息(同比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> tongSectionA(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 评价数量 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
Integer evaluateCount(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 检查计划数量 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
Integer plantCount(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 执法预告数量 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
Integer noticeCount(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 投诉数量 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> complaintTypeList(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* 获取执法预告,关联企业信息(本时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> primaryNotice(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 获取执法预告,关联企业信息(环比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> huanNotice(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* 获取执法预告,关联企业信息(同比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> tongNotice(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* 获取执法投诉统计表,关联企业信息(本时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
* 字段:企业信息、投诉类型 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> primaryComplaint(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 获取执法投诉统计表,关联企业信息(环比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> huanComplaint(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* 获取执法投诉统计表,关联企业信息(同比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> tongComplaint(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* 获取执法预警本企业,关联企业信息(本时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> primaryWarning(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 获取执法预警本企业,关联企业信息(环比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> huanWarning(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* 获取执法预警本企业,关联企业信息(同比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> tongWarning(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* 获取企业信息(本时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> primaryEnterprise(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* 获取企业信息(环比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> huanEnterprise(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* 获取企业信息(同比时段) |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> tongEnterprise(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
List<ComprehensiveAnalysisBo> complaintGetBureauDept(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
} |
|||
@ -0,0 +1,52 @@ |
|||
package com.zdxt.enforcementcode.service; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface ComprehensiveAnalysisService { |
|||
ComprehensiveAnalysisBo whole(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
|
|||
/** |
|||
* web:获取六项指标同环比 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> sixIndicators(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* web:获取各区域六项指标(本时段) |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> sixIndicatorsGroupByQY(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* web:获取各街道六项指标(本时段) |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> sixIndicatorsGroupByJD(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* web:检查类型图 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> checkCategoryList(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* web:企业类型图 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> companyOrgTypeList(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
|
|||
/** |
|||
* web:投诉类型图 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> complaintTypeList(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* web:被检查企业次数排名 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> registrationNumberRankingByEnterprise(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* web:被投诉主体排名 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> complaintNumberRankingByBureauDept(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
/** |
|||
* web:主体检查次数排名 |
|||
*/ |
|||
List<ComprehensiveAnalysisBo> registrationNumberRankingByBureauDept(ComprehensiveAnalysisBo comprehensiveAnalysis); |
|||
} |
|||
@ -0,0 +1,437 @@ |
|||
package com.zdxt.enforcementcode.service.impl; |
|||
|
|||
import com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo; |
|||
import com.zdxt.enforcementcode.mapper.ComprehensiveAnalysisMapper; |
|||
import com.zdxt.enforcementcode.service.ComprehensiveAnalysisService; |
|||
import org.dromara.system.domain.SysDept; |
|||
import org.dromara.system.domain.bo.SysDictDataBo; |
|||
import org.dromara.system.domain.vo.SysDictDataVo; |
|||
import org.dromara.system.domain.vo.SysUserVo; |
|||
import org.dromara.system.mapper.SysDeptMapper; |
|||
import org.dromara.system.mapper.SysDictDataMapper; |
|||
import org.dromara.system.mapper.SysUserMapper; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.*; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Service |
|||
public class ComprehensiveAnalysisServiceImpl implements ComprehensiveAnalysisService { |
|||
@Autowired |
|||
private ComprehensiveAnalysisMapper comprehensiveAnalysisMapper; |
|||
@Autowired |
|||
private SysUserMapper userMapper; |
|||
@Autowired |
|||
private SysDeptMapper deptMapper; |
|||
@Autowired |
|||
private SysDictDataMapper dictDataMapper; |
|||
|
|||
@Override |
|||
public ComprehensiveAnalysisBo whole(ComprehensiveAnalysisBo c) { |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
//当前时段执法记录
|
|||
List<ComprehensiveAnalysisBo> primaryRegistrationList = comprehensiveAnalysisMapper.primarySectionA(c); |
|||
List<ComprehensiveAnalysisBo> tongRegistrationList = comprehensiveAnalysisMapper.tongSectionA(c); |
|||
List<ComprehensiveAnalysisBo> huanRegistrationList = comprehensiveAnalysisMapper.huanSectionA(c); |
|||
//执法总数
|
|||
comprehensiveAnalysis.setTotal(primaryRegistrationList.size()); |
|||
//执法总数同比
|
|||
System.out.println(primaryRegistrationList.size()); |
|||
System.out.println(tongRegistrationList.size()); |
|||
System.out.println(huanRegistrationList.size()); |
|||
comprehensiveAnalysis.setTongPercentage((double) (primaryRegistrationList.size() - tongRegistrationList.size()) / tongRegistrationList.size()); |
|||
//执法总数环比
|
|||
comprehensiveAnalysis.setHuanPercentage((double) (primaryRegistrationList.size() - huanRegistrationList.size()) / huanRegistrationList.size()); |
|||
//评价数量
|
|||
comprehensiveAnalysis.setEvaluateTotal(comprehensiveAnalysisMapper.evaluateCount(c)); |
|||
/* //检查计划数量
|
|||
comprehensiveAnalysis.setPlantTotal((comprehensiveAnalysisMapper.plantCount(c)));*/ |
|||
//检查预告数量
|
|||
comprehensiveAnalysis.setNoticeTotal(comprehensiveAnalysisMapper.noticeCount(c)); |
|||
List<ComprehensiveAnalysisBo> complaintList = comprehensiveAnalysisMapper.complaintTypeList(c); |
|||
System.out.println(complaintList.toString()); |
|||
//投诉总数
|
|||
comprehensiveAnalysis.setComplaintTotal(complaintList.size()); |
|||
//投诉类型列表(类型value+数量+占比)
|
|||
comprehensiveAnalysis.setComplaintTypeList(getComplaintTypeList(complaintList)); |
|||
//执法类别(类型value+数量+占比)
|
|||
comprehensiveAnalysis.setLawEnforceCategoryList(getLawEnforceCategoryList(primaryRegistrationList)); |
|||
//企业类型列表(文字+数量+占比)
|
|||
comprehensiveAnalysis.setCompanyOrgTypeList(getCompanyOrgTypeList(primaryRegistrationList)); |
|||
// 受委托执法
|
|||
c.setHasAuth(1); |
|||
c.setEntrustDeptId(c.getBureauDeptId()); |
|||
Integer authNum = comprehensiveAnalysisMapper.countCurrentEntrust(c); |
|||
comprehensiveAnalysis.setAuthTotal(authNum); |
|||
return comprehensiveAnalysis; |
|||
|
|||
} |
|||
|
|||
/** |
|||
* |
|||
* @param comprehensiveAnalysis(区域需做前置处理转成字符串) |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> sixIndicators(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=new ArrayList<>(); |
|||
//涉企检查数量
|
|||
ComprehensiveAnalysisBo registrationCA=new ComprehensiveAnalysisBo(); |
|||
//涉企检查数量本时段
|
|||
List<ComprehensiveAnalysisBo> registrationNowList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis); |
|||
//涉企检查数量环比时段
|
|||
List<ComprehensiveAnalysisBo> registrationHuanList=comprehensiveAnalysisMapper.huanSectionA(comprehensiveAnalysis); |
|||
//涉企检查数量同比时段
|
|||
List<ComprehensiveAnalysisBo> registrationTongList=comprehensiveAnalysisMapper.tongSectionA(comprehensiveAnalysis); |
|||
registrationCA.setName("registration"); |
|||
registrationCA.setTotal(registrationNowList.size()); |
|||
registrationCA.setHuanPercentage((double)(registrationHuanList.size()- registrationNowList.size())/registrationHuanList.size()); |
|||
registrationCA.setTongPercentage((double)(registrationTongList.size()- registrationNowList.size())/registrationTongList.size()); |
|||
comprehensiveAnalysisList.add(registrationCA); |
|||
//联合检查数量
|
|||
ComprehensiveAnalysisBo unitCA=new ComprehensiveAnalysisBo(); |
|||
unitCA.setName("unitCheck"); |
|||
comprehensiveAnalysisList.add(unitCA); |
|||
//行政检查预告
|
|||
ComprehensiveAnalysisBo noticeCA=new ComprehensiveAnalysisBo(); |
|||
//行政检查预告本时段
|
|||
List<ComprehensiveAnalysisBo> noticeNowList=comprehensiveAnalysisMapper.primaryNotice(comprehensiveAnalysis); |
|||
//行政检查预告环比时段
|
|||
List<ComprehensiveAnalysisBo> noticeHuanList=comprehensiveAnalysisMapper.huanNotice(comprehensiveAnalysis); |
|||
//行政检查预告同比时段
|
|||
List<ComprehensiveAnalysisBo> noticeTongList=comprehensiveAnalysisMapper.tongNotice(comprehensiveAnalysis); |
|||
noticeCA.setName("notice"); |
|||
noticeCA.setTotal(noticeNowList.size()); |
|||
noticeCA.setHuanPercentage((double)(noticeHuanList.size()- noticeNowList.size())/ noticeHuanList.size()); |
|||
noticeCA.setTongPercentage((double)(noticeTongList.size()- noticeNowList.size())/ noticeTongList.size()); |
|||
comprehensiveAnalysisList.add(noticeCA); |
|||
//涉企投诉数量
|
|||
ComprehensiveAnalysisBo complaintCA=new ComprehensiveAnalysisBo(); |
|||
//涉企投诉数量本时段
|
|||
List<ComprehensiveAnalysisBo> complaintNowList=comprehensiveAnalysisMapper.primaryComplaint(comprehensiveAnalysis); |
|||
//涉企投诉数量环比时段
|
|||
List<ComprehensiveAnalysisBo> complaintHuanList=comprehensiveAnalysisMapper.huanComplaint(comprehensiveAnalysis); |
|||
//涉企投诉数量同比时段
|
|||
List<ComprehensiveAnalysisBo> complaintTongList=comprehensiveAnalysisMapper.tongComplaint(comprehensiveAnalysis); |
|||
complaintCA.setName("complaint"); |
|||
complaintCA.setTotal(complaintNowList.size()); |
|||
complaintCA.setHuanPercentage((double)(complaintHuanList.size()-complaintNowList.size())/complaintHuanList.size()); |
|||
complaintCA.setTongPercentage((double)(complaintTongList.size()-complaintNowList.size())/complaintTongList.size()); |
|||
comprehensiveAnalysisList.add(complaintCA); |
|||
//执法预警
|
|||
ComprehensiveAnalysisBo warningCA=new ComprehensiveAnalysisBo(); |
|||
//执法预警本时段
|
|||
List<ComprehensiveAnalysisBo> warningNowList=comprehensiveAnalysisMapper.primaryWarning(comprehensiveAnalysis); |
|||
//执法预警环比时段
|
|||
List<ComprehensiveAnalysisBo> warningHuanList=comprehensiveAnalysisMapper.huanWarning(comprehensiveAnalysis); |
|||
//执法预警同比时段
|
|||
List<ComprehensiveAnalysisBo> warningTongList=comprehensiveAnalysisMapper.tongWarning(comprehensiveAnalysis); |
|||
warningCA.setName("warning"); |
|||
warningCA.setTotal(warningNowList.size()); |
|||
warningCA.setHuanPercentage((double)(warningHuanList.size()- warningNowList.size())/warningHuanList.size()); |
|||
warningCA.setTongPercentage((double)(warningTongList.size()-warningNowList.size())/ warningTongList.size()); |
|||
comprehensiveAnalysisList.add(warningCA); |
|||
//企业数量
|
|||
ComprehensiveAnalysisBo enterpriseCA=new ComprehensiveAnalysisBo(); |
|||
//企业数量本时段
|
|||
List<ComprehensiveAnalysisBo> enterpriseNowList=comprehensiveAnalysisMapper.primaryEnterprise(comprehensiveAnalysis); |
|||
//企业数量环比时段
|
|||
List<ComprehensiveAnalysisBo> enterpriseHuanList=comprehensiveAnalysisMapper.huanEnterprise(comprehensiveAnalysis); |
|||
//企业数量同比时段
|
|||
List<ComprehensiveAnalysisBo> enterpriseTongList=comprehensiveAnalysisMapper.tongEnterprise(comprehensiveAnalysis); |
|||
enterpriseCA.setName("complaint"); |
|||
enterpriseCA.setTotal(enterpriseNowList.size()); |
|||
enterpriseCA.setHuanPercentage((double)(enterpriseHuanList.size()-enterpriseNowList.size())/enterpriseHuanList.size()); |
|||
enterpriseCA.setTongPercentage((double)(enterpriseTongList.size()-enterpriseNowList.size())/enterpriseTongList.size()); |
|||
comprehensiveAnalysisList.add(enterpriseCA); |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> sixIndicatorsGroupByQY(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
//区域数组,一个区域为一个对象
|
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=new ArrayList<>(); |
|||
//涉企检查数量本时段
|
|||
List<ComprehensiveAnalysisBo> registrationList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//联合检查数量
|
|||
//行政检查预告本时段
|
|||
List<ComprehensiveAnalysisBo> noticeList=comprehensiveAnalysisMapper.primaryNotice(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//涉企投诉数量本时段
|
|||
List<ComprehensiveAnalysisBo> complaintList=comprehensiveAnalysisMapper.primaryComplaint(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//执法预警本时段
|
|||
List<ComprehensiveAnalysisBo> warningList=comprehensiveAnalysisMapper.primaryWarning(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//企业数量本时段
|
|||
List<ComprehensiveAnalysisBo> enterpriseList=comprehensiveAnalysisMapper.primaryEnterprise(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
List<String> qyStrList=new ArrayList<>(); |
|||
if(comprehensiveAnalysis.getQy()==null|| comprehensiveAnalysis.getQy().isEmpty()){ |
|||
qyStrList=dictDataMapper.selectDictDataByType("address_type").stream().map(SysDictDataVo::getDictLabel).collect(Collectors.toList()); |
|||
}else{ |
|||
qyStrList.add(comprehensiveAnalysis.getQy()); |
|||
} |
|||
for(String string:qyStrList){ |
|||
ComprehensiveAnalysisBo qyCA=new ComprehensiveAnalysisBo(); |
|||
qyCA.setName(string); |
|||
qyCA.setRegistrationTotal(registrationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()).size()); |
|||
qyCA.setNoticeTotal(noticeList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()).size()); |
|||
qyCA.setComplaintTotal(complaintList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()).size()); |
|||
qyCA.setWarningTotal(warningList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()).size()); |
|||
qyCA.setEnterpriseTotal(enterpriseList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()).size()); |
|||
comprehensiveAnalysisList.add(qyCA); |
|||
/* |
|||
registrationList=registrationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()); |
|||
noticeList=noticeList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()); |
|||
complaintList=complaintList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()); |
|||
warningList=warningList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()); |
|||
enterpriseList=enterpriseList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区") && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区")).collect(Collectors.toList()); |
|||
*/ |
|||
} |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> sixIndicatorsGroupByJD(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
//区域数组,一个区域为一个对象
|
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=new ArrayList<>(); |
|||
//涉企检查数量本时段
|
|||
List<ComprehensiveAnalysisBo> registrationList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//联合检查数量
|
|||
//行政检查预告本时段
|
|||
List<ComprehensiveAnalysisBo> noticeList=comprehensiveAnalysisMapper.primaryNotice(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//涉企投诉数量本时段
|
|||
List<ComprehensiveAnalysisBo> complaintList=comprehensiveAnalysisMapper.primaryComplaint(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//执法预警本时段
|
|||
List<ComprehensiveAnalysisBo> warningList=comprehensiveAnalysisMapper.primaryWarning(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
//企业数量本时段
|
|||
List<ComprehensiveAnalysisBo> enterpriseList=comprehensiveAnalysisMapper.primaryEnterprise(comprehensiveAnalysis).stream().filter(item->!Objects.isNull(item)&&item.getEnterpriseAddress()!=null&&!item.getEnterpriseAddress().isEmpty()).collect(Collectors.toList()); |
|||
List<String> addressStrList=new ArrayList<>(); |
|||
if(comprehensiveAnalysis.getQy()==null|| comprehensiveAnalysis.getQy().isEmpty()){ |
|||
List<SysDictDataVo> qyList=dictDataMapper.selectDictDataByType("address_type"); |
|||
for(SysDictDataVo qy:qyList){ |
|||
List<SysDictDataVo>jdList=dictDataMapper.selectDictDataByType(qy.getDictValue()); |
|||
for(SysDictDataVo jd:jdList){ |
|||
addressStrList.add(qy.getDictLabel()+jd.getDictLabel()); |
|||
} |
|||
} |
|||
}else{ |
|||
if(comprehensiveAnalysis.getJd()==null|| comprehensiveAnalysis.getJd().isEmpty()){ |
|||
SysDictDataBo dictDatBo=new SysDictDataBo(); |
|||
dictDatBo.setDictType("address_type"); |
|||
dictDatBo.setDictLabel(comprehensiveAnalysis.getQy()); |
|||
SysDictDataVo qy=dictDataMapper.selectDictData(dictDatBo); |
|||
List<SysDictDataVo> jdList=dictDataMapper.selectDictDataByType(qy.getDictValue()); |
|||
for(SysDictDataVo jd:jdList){ |
|||
addressStrList.add(comprehensiveAnalysis.getQy()+jd.getDictLabel()); |
|||
} |
|||
}else{ |
|||
addressStrList.add(comprehensiveAnalysis.getQy()+comprehensiveAnalysis.getJd()); |
|||
} |
|||
} |
|||
for(String string:addressStrList){ |
|||
/* |
|||
System.out.println(string); |
|||
System.out.println("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)); |
|||
System.out.println("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1)); |
|||
*/ |
|||
ComprehensiveAnalysisBo qyCA=new ComprehensiveAnalysisBo(); |
|||
qyCA.setName(string); |
|||
qyCA.setRegistrationTotal(registrationList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)) || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()).size()); |
|||
qyCA.setNoticeTotal(noticeList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)) || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()).size()); |
|||
qyCA.setComplaintTotal(complaintList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)) || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()).size()); |
|||
qyCA.setWarningTotal(warningList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)) || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()).size()); |
|||
qyCA.setEnterpriseTotal(enterpriseList.stream().filter(item -> item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1)) || item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()).size()); |
|||
comprehensiveAnalysisList.add(qyCA); |
|||
/* |
|||
registrationList=registrationList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1) && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()); |
|||
noticeList=noticeList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1) && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()); |
|||
complaintList=complaintList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1) && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()); |
|||
warningList=warningList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1) && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()); |
|||
enterpriseList=enterpriseList.stream().filter(item -> !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "区"+ string.substring(string.indexOf("区")+1) && !item.getEnterpriseAddress().startsWith("深圳市" + string.substring(0, string.indexOf("区")) + "新区"+ string.substring(string.indexOf("区")+1))).collect(Collectors.toList()); |
|||
*/ |
|||
} |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> checkCategoryList(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis); |
|||
comprehensiveAnalysisList=getCheckCategoryList(comprehensiveAnalysisList); |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> companyOrgTypeList(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=comprehensiveAnalysisMapper.primaryEnterprise(comprehensiveAnalysis); |
|||
comprehensiveAnalysisList=getCompanyOrgTypeList(comprehensiveAnalysisList); |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> complaintTypeList(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=comprehensiveAnalysisMapper.primaryComplaint(comprehensiveAnalysis); |
|||
comprehensiveAnalysisList=getCompanyOrgTypeList(comprehensiveAnalysisList); |
|||
return comprehensiveAnalysisList; |
|||
} |
|||
|
|||
/** |
|||
* 被检查企业受检次数排名 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> registrationNumberRankingByEnterprise(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis); |
|||
Map<String, List<ComprehensiveAnalysisBo>> enterpriseMap=comprehensiveAnalysisList.stream().collect(Collectors.groupingBy(ComprehensiveAnalysisBo::getEnterpriseNumber)); |
|||
Map<String, Long> registrationNumberMap=comprehensiveAnalysisList.stream().collect(Collectors.groupingBy(ComprehensiveAnalysisBo::getEnterpriseNumber,Collectors.counting())); |
|||
Map<String, Long> sortMap=registrationNumberMap.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) |
|||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, |
|||
(oldValue, newValue) -> oldValue, LinkedHashMap::new)); |
|||
List<ComprehensiveAnalysisBo> list=new ArrayList<>(); |
|||
for(String string:sortMap.keySet()){ |
|||
ComprehensiveAnalysisBo ca=new ComprehensiveAnalysisBo(); |
|||
ca.setName(enterpriseMap.get(string).get(0).getEnterpriseName()); |
|||
ca.setTotal(Integer.parseInt(sortMap.get(string)+"")); |
|||
list.add(ca); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
/** |
|||
* 被投诉部门排名 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> complaintNumberRankingByBureauDept(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
return comprehensiveAnalysisMapper.complaintGetBureauDept(comprehensiveAnalysis); |
|||
} |
|||
|
|||
/** |
|||
* 主体检查数量排名 |
|||
* @param comprehensiveAnalysis |
|||
* @return |
|||
*/ |
|||
@Override |
|||
public List<ComprehensiveAnalysisBo> registrationNumberRankingByBureauDept(ComprehensiveAnalysisBo comprehensiveAnalysis) { |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList=comprehensiveAnalysisMapper.primarySectionA(comprehensiveAnalysis); |
|||
Map<String, List<ComprehensiveAnalysisBo>> bureauDeptMap=comprehensiveAnalysisList.stream().collect(Collectors.groupingBy(ComprehensiveAnalysisBo::getBureauDeptId)); |
|||
Map<String, Long> registrationNumberMap=comprehensiveAnalysisList.stream().collect(Collectors.groupingBy(ComprehensiveAnalysisBo::getBureauDeptId,Collectors.counting())); |
|||
Map<String, Long> sortMap=registrationNumberMap.entrySet().stream().sorted(Map.Entry.comparingByValue(Comparator.reverseOrder())) |
|||
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, |
|||
(oldValue, newValue) -> oldValue, LinkedHashMap::new)); |
|||
List<ComprehensiveAnalysisBo> list=new ArrayList<>(); |
|||
for(String string:sortMap.keySet()){ |
|||
ComprehensiveAnalysisBo ca=new ComprehensiveAnalysisBo(); |
|||
ca.setName(bureauDeptMap.get(string).get(0).getBureauDeptName()); |
|||
ca.setTotal(Integer.parseInt(sortMap.get(string)+"")); |
|||
list.add(ca); |
|||
} |
|||
return list; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getCheckCategoryList(List<ComprehensiveAnalysisBo> registrationList) { |
|||
int num = registrationList.size(); |
|||
List<ComprehensiveAnalysisBo> checkCategoryList = new ArrayList<>(); |
|||
/*Map<String, Long> checkCategoryMap = registrationList.stream().collect(Collectors.groupingBy(ComprehensiveAnalysis::getCheckCategory, Collectors.counting())); |
|||
for (String s : checkCategoryMap.keySet()) { |
|||
ComprehensiveAnalysis comprehensiveAnalysis = new ComprehensiveAnalysis(); |
|||
comprehensiveAnalysis.setCheckCategory(s); |
|||
comprehensiveAnalysis.setCheckCategoryNumber(Integer.parseInt(checkCategoryMap.get(s) + "")); |
|||
comprehensiveAnalysis.setPercentage((double)checkCategoryMap.get(s)/num); |
|||
checkCategoryList.add(comprehensiveAnalysis); |
|||
}*/ |
|||
List<SysDictDataVo> dictDataList = dictDataMapper.selectDictDataByType("check_category"); |
|||
for (SysDictDataVo dictData : dictDataList) { |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList = registrationList.stream().filter(item -> item.getCheckCategory().equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
comprehensiveAnalysis.setCheckCategory(dictData.getDictLabel()); |
|||
comprehensiveAnalysis.setCheckCategoryNumber(comprehensiveAnalysisList.size()); |
|||
comprehensiveAnalysis.setPercentage((double) comprehensiveAnalysisList.size() / num); |
|||
checkCategoryList.add(comprehensiveAnalysis); |
|||
registrationList = registrationList.stream().filter(item -> !item.equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
} |
|||
return checkCategoryList; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getLawEnforceCategoryList(List<ComprehensiveAnalysisBo> registrationList) { |
|||
int num = registrationList.size(); |
|||
List<ComprehensiveAnalysisBo> lawList = new ArrayList<>(); |
|||
List<SysDictDataVo> dictDataList = dictDataMapper.selectDictDataByType("law_enforce_category"); |
|||
for (SysDictDataVo dictData : dictDataList) { |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList = registrationList.stream().filter(item -> item.getLawEnforceCategory().equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
comprehensiveAnalysis.setLawEnforceCategory(dictData.getDictLabel()); |
|||
comprehensiveAnalysis.setLawEnforceCategoryNumber(comprehensiveAnalysisList.size()); |
|||
comprehensiveAnalysis.setPercentage((double) comprehensiveAnalysisList.size() / num); |
|||
lawList.add(comprehensiveAnalysis); |
|||
registrationList = registrationList.stream().filter(item -> !item.equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
} |
|||
return lawList; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getCompanyOrgTypeList(List<ComprehensiveAnalysisBo> registrationList) { |
|||
//企业类型数组
|
|||
List<ComprehensiveAnalysisBo> companyOrgTypeList = new ArrayList<>(); |
|||
//企业类型字典
|
|||
List<SysDictDataVo> dictDataList = dictDataMapper.selectDictDataByType("enterpriseType"); |
|||
//筛出企业类型为空
|
|||
List<ComprehensiveAnalysisBo> companyOrgTypeIsNullList = registrationList.stream().filter(item -> Objects.isNull(item)||item.getCompanyOrgType() == null || item.getCompanyOrgType().isEmpty()).collect(Collectors.toList()); |
|||
registrationList = registrationList.stream().filter(item -> !Objects.isNull(item)&&item.getCompanyOrgType() != null && !item.getCompanyOrgType().equals("")).collect(Collectors.toList()); |
|||
//企业去重
|
|||
Map<String, List<ComprehensiveAnalysisBo>> enterpriseMap = registrationList.stream().collect(Collectors.groupingBy(item -> item.getEnterpriseNumber())); |
|||
List<ComprehensiveAnalysisBo> enterpriseList = new ArrayList<>(); |
|||
for (String s : enterpriseMap.keySet()) { |
|||
enterpriseList.add(enterpriseMap.get(s).get(0)); |
|||
} |
|||
int num = 0; |
|||
if (companyOrgTypeIsNullList.size() > 0) { |
|||
num = enterpriseList.size() + 1; |
|||
} else { |
|||
num = enterpriseList.size(); |
|||
} |
|||
for (SysDictDataVo dictData : dictDataList) { |
|||
if (!dictData.getDictLabel().equals("其他")) { |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
List<ComprehensiveAnalysisBo> r = enterpriseList.stream().filter(item -> dictData.getDictLabel().contains(item.getCompanyOrgType()) || item.getCompanyOrgType().contains(dictData.getDictLabel())).collect(Collectors.toList()); |
|||
comprehensiveAnalysis.setCompanyOrgType(dictData.getDictLabel()); |
|||
comprehensiveAnalysis.setCompanyOrgTypeNumber(r.size()); |
|||
comprehensiveAnalysis.setPercentage((double) r.size() / num); |
|||
companyOrgTypeList.add(comprehensiveAnalysis); |
|||
enterpriseList = enterpriseList.stream().filter(item -> !dictData.getDictLabel().contains(item.getCompanyOrgType()) && !item.getCompanyOrgType().contains(dictData.getDictLabel())).collect(Collectors.toList()); |
|||
} |
|||
} |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
comprehensiveAnalysis.setCompanyOrgType("其他"); |
|||
if (companyOrgTypeIsNullList.size() > 0) { |
|||
comprehensiveAnalysis.setCompanyOrgTypeNumber(enterpriseList.size() + 1); |
|||
} else { |
|||
comprehensiveAnalysis.setCompanyOrgTypeNumber(enterpriseList.size()); |
|||
} |
|||
companyOrgTypeList.add(comprehensiveAnalysis); |
|||
return companyOrgTypeList; |
|||
} |
|||
|
|||
public List<ComprehensiveAnalysisBo> getComplaintTypeList(List<ComprehensiveAnalysisBo> complaintList) { |
|||
int num = complaintList.size(); |
|||
List<SysDictDataVo> dictDataList = dictDataMapper.selectDictDataByType("caseType"); |
|||
List<ComprehensiveAnalysisBo> complaintTypeList = new ArrayList<>(); |
|||
for (SysDictDataVo dictData : dictDataList) { |
|||
if (!dictData.getDictLabel().equals("其他")) { |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
List<ComprehensiveAnalysisBo> comprehensiveAnalysisList = complaintList.stream().filter(item -> item.getComplaintType().equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
comprehensiveAnalysis.setComplaintType(dictData.getDictLabel()); |
|||
comprehensiveAnalysis.setComplaintTotal(comprehensiveAnalysisList.size()); |
|||
comprehensiveAnalysis.setPercentage((double) comprehensiveAnalysisList.size() / num); |
|||
complaintTypeList.add(comprehensiveAnalysis); |
|||
complaintList = complaintList.stream().filter(item -> !item.getComplaintType().equals(dictData.getDictValue())).collect(Collectors.toList()); |
|||
} |
|||
} |
|||
ComprehensiveAnalysisBo comprehensiveAnalysis = new ComprehensiveAnalysisBo(); |
|||
comprehensiveAnalysis.setComplaintType("其他"); |
|||
comprehensiveAnalysis.setComplaintTotal(complaintList.size()); |
|||
comprehensiveAnalysis.setPercentage((double) complaintList.size() / num); |
|||
complaintTypeList.add(comprehensiveAnalysis); |
|||
return complaintTypeList; |
|||
} |
|||
|
|||
} |
|||
@ -0,0 +1,690 @@ |
|||
<?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.ComprehensiveAnalysisMapper"> |
|||
|
|||
<resultMap type="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" id="ComprehensiveAnalysisResult"> |
|||
<result property="enterpriseNumber" column="enterprise_number" /> |
|||
<result property="enterpriseName" column="enterprise_name" /> |
|||
<result property="enterpriseAddress" column="enterprise_address" /> |
|||
<result property="checkCategory" column="check_category" /> |
|||
<result property="companyOrgType" column="company_org_type" /> |
|||
<result property="complaintType" column="complaint_type" /> |
|||
<result property="bureauDeptId" column="bureau_dept_id" /> |
|||
<result property="bureauDeptName" column="bureau_dept_name" /> |
|||
</resultMap> |
|||
<select id="countCurrentEntrust" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultType="int"> |
|||
select count(1) from enforcement_registration r |
|||
<where> |
|||
<if test="hasAuth != null and hasAuth != ''"> |
|||
and r.has_auto=#{hasAuth} |
|||
</if> |
|||
<if test="entrustDeptId != null and entrustDeptId != ''"> |
|||
and r.entrust_dept_id=#{entrustDeptId} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
and QUARTER(r.create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
and MONTH(r.create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="primarySectionA" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select r.check_category,r.law_enforce_category, e.company_org_type,r.enterprise_number,r.enterprise_name,e.enterprise_address,r.bureau_dept_id,r.bureau_dept_name |
|||
from enforcement_registration r |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on r.enterprise_number = e.enterprise_number |
|||
<where> |
|||
and r.enterprise_number is not null |
|||
and r.check_category is not null |
|||
and r.law_enforce_category is not null |
|||
and r.is_submit=1 |
|||
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or |
|||
r.law_enforcer_id_two like concat('%',#{userId}, '%')) |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="qy != null and qy != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
and QUARTER(r.create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(r.create_time)=#{year} |
|||
and MONTH(r.create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(r.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="huanSectionA" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select r.check_category, e.company_org_type,r.enterprise_address |
|||
from enforcement_registration r |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on r.enterprise_number = e.enterprise_number |
|||
<where> |
|||
and r.enterprise_number is not null |
|||
and r.check_category is not null |
|||
and r.is_submit=1 |
|||
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or |
|||
r.law_enforcer_id_two like concat('%',#{userId}, '%')) |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="qy != null and qy != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(r.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 quarter))=#{year} |
|||
and QUARTER(DATE_SUB(r.create_time,INTERVAL -1 quarter))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 month))=#{year} |
|||
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 month))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(r.create_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) |
|||
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.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="tongSectionA" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select r.check_category, e.company_org_type,r.enterprise_address |
|||
from enforcement_registration r |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on r.enterprise_number = e.enterprise_number |
|||
<where> |
|||
and r.enterprise_number is not null |
|||
and r.check_category is not null |
|||
and r.is_submit=1 |
|||
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or |
|||
r.law_enforcer_id_two like concat('%',#{userId}, '%')) |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="qy != null and qy != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
r.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(r.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(r.create_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(r.create_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(r.create_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.create_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="evaluateCount" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultType = "java.lang.Integer"> |
|||
select count(*) from enforcement_registration r |
|||
left join enterprise_evaluate e |
|||
on r.id=e.enforcement_id |
|||
<where> |
|||
and r.enterprise_number is not null |
|||
and r.check_category is not null |
|||
and e.id is not null |
|||
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or |
|||
r.law_enforcer_id_two like concat('%',#{userId}, '%')) |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and r.bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(e.create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(e.create_time)=#{year} |
|||
and QUARTER(e.create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(e.create_time)=#{year} |
|||
and MONTH(e.create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(e.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(e.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="plantCount" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultType = "java.lang.Integer"> |
|||
select count(*) from enforcement_inspection_program |
|||
<where> |
|||
<if test="userId != null and userId != '' ">and user_id=#{userId} |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(create_time)=#{year} |
|||
and QUARTER(create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(create_time)=#{year} |
|||
and MONTH(create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="noticeCount" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultType = "java.lang.Integer"> |
|||
select count(*) from enterprise_law_enforcement |
|||
<where> |
|||
and enterprise_number is not null |
|||
<if test="userId != null and userId != '' ">and user_id=#{userId} |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and bureau_dept_id=#{bureauDeptId}</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(create_time)=#{year} |
|||
and QUARTER(create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(create_time)=#{year} |
|||
and MONTH(create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="complaintTypeList" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select c.enforce_type as complaint_type from complaint_statistics c |
|||
left join (select id,bureau_dept_id,law_enforcer_id,law_enforcer_id_two from enforcement_registration where |
|||
enterprise_number is not null and check_category is not null) r |
|||
on c.rid=r.id COLLATE utf8mb4_general_ci |
|||
<where> |
|||
and (c.rid is not null or c.complaint_department_id is not null) |
|||
and c.enforce_type is not null |
|||
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or |
|||
r.law_enforcer_id_two like concat('%',#{userId}, '%')) |
|||
</if> |
|||
<if test="bureauDeptId != null and bureauDeptId != '' ">and( r.bureau_dept_id=#{bureauDeptId} or |
|||
c.complaint_department_id=#{bureauDeptId}) |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
and QUARTER(c.complaint_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
and MONTH(c.complaint_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(c.complaint_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="primaryNotice" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from enterprise_law_enforcement n |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on n.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and n.enterprise_number is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(n.create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(n.create_time)=#{year} |
|||
and QUARTER(n.create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(n.create_time)=#{year} |
|||
and MONTH(n.create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(n.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(n.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="huanNotice" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from enterprise_law_enforcement n |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on n.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and n.enterprise_number is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(n.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 quarter))=#{year} |
|||
and QUARTER(DATE_SUB(n.create_time,INTERVAL -1 quarter))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 month))=#{year} |
|||
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 month))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(n.create_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) |
|||
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.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="tongNotice" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from enterprise_law_enforcement n |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on n.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and n.enterprise_number is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(n.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(n.create_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(n.create_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(n.create_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(n.create_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="primaryComplaint" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address,c.enforce_type from complaint_statistics c |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on c.enterprise_number=e.enterprise_number |
|||
<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="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
and QUARTER(c.complaint_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(c.complaint_time)=#{year} |
|||
and MONTH(c.complaint_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(c.complaint_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime} ,'%Y-%m-%d')>= DATE_FORMAT(c.complaint_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="huanComplaint" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address,c.enforce_type from complaint_statistics c |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on c.enterprise_number=e.enterprise_number |
|||
<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="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(c.complaint_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 quarter))=#{year} |
|||
and QUARTER(DATE_SUB(c.complaint_time,INTERVAL -1 quarter))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 month))=#{year} |
|||
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 month))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(c.complaint_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) |
|||
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.complaint_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="tongComplaint" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address,c.enforce_type from complaint_statistics c |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on c.enterprise_number=e.enterprise_number |
|||
<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="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(c.complaint_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="primaryWarning" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from law_enforcement_warning_list w |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on w.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and w.enterprise_number is not null |
|||
and warn_type = 1 |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(w.create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(w.create_time)=#{year} |
|||
and QUARTER(w.create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(w.create_time)=#{year} |
|||
and MONTH(w.create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(w.create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(w.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="huanWarning" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from law_enforcement_warning_list w |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on w.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and w.enterprise_number is not null |
|||
and warn_type = 1 |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(w.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 quarter))=#{year} |
|||
and QUARTER(DATE_SUB(w.create_time,INTERVAL -1 quarter))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 month))=#{year} |
|||
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 month))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(w.create_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) |
|||
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(w.create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="tongWarning" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select e.enterprise_address from law_enforcement_warning_list w |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on w.enterprise_number=e.enterprise_number |
|||
<where> |
|||
and w.enterprise_number is not null |
|||
and warn_type = 1 |
|||
<if test="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(w.create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(w.create_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(w.create_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(w.create_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(w.create_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
</select> |
|||
<select id="primaryEnterprise" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select enterprise_address,company_org_type from enterprise_information |
|||
<where> |
|||
and is_unsubscribe is not null |
|||
and company_org_type is not null |
|||
and enterprise_address is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(create_time)=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(create_time)=#{year} |
|||
and QUARTER(create_time)=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(create_time)=#{year} |
|||
and MONTH(create_time)=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
group by enterprise_number |
|||
</select> |
|||
<select id="huanEnterprise" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select enterprise_address,company_org_type from enterprise_information |
|||
<where> |
|||
and is_unsubscribe is not null |
|||
and company_org_type is not null |
|||
and enterprise_address is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(create_time,INTERVAL -1 quarter))=#{year} |
|||
and QUARTER(DATE_SUB(create_time,INTERVAL -1 quarter))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(create_time,INTERVAL -1 month))=#{year} |
|||
and MONTH(DATE_SUB(create_time,INTERVAL -1 month))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(create_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) |
|||
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(create_time,'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
group by enterprise_number |
|||
</select> |
|||
<select id="tongEnterprise" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select enterprise_address,company_org_type from enterprise_information |
|||
<where> |
|||
and is_unsubscribe is not null |
|||
and company_org_type is not null |
|||
and enterprise_address is not null |
|||
<if test="qy != null and qy != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(create_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(create_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(create_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(create_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(create_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(create_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
group by enterprise_number |
|||
</select> |
|||
<select id="complaintGetBureauDept" parameterType="com.zdxt.enforcementcode.domain.bo.ComprehensiveAnalysisBo" resultMap="ComprehensiveAnalysisResult"> |
|||
select bureau_dept_id,bureau_dept_name,count(*) as total from( |
|||
select ( CASE WHEN c.rid IS NULL THEN c.complaint_department_id ELSE r.bureau_dept_id END ) AS bureau_dept_id, |
|||
( CASE WHEN c.rid IS NULL THEN c.complaint_department ELSE r.bureau_dept_name END ) AS bureau_dept_name |
|||
from complaint_statistics c |
|||
left join (select id,bureau_dept_id,bureau_dept_name from enforcement_registration where |
|||
enterprise_number is not null and check_category is not null) r |
|||
on c.rid=r.id |
|||
left join (select * from enterprise_information group by enterprise_number) e |
|||
on c.enterprise_number=e.enterprise_number |
|||
<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="qy != null and qy != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区%')) |
|||
<if test="jd != null and jd != ''"> |
|||
and (e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '区',#{jd},'%')or |
|||
e.enterprise_address like concat('深圳市',substring_index(#{qy}, "区",1), '新区',#{jd},'%')) |
|||
</if> |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'year' "> |
|||
and YEAR(c.complaint_time)+1=#{year} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'quarter' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year} |
|||
and QUARTER(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{quarter} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'month' "> |
|||
and YEAR(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{year} |
|||
and MONTH(DATE_SUB(c.complaint_time,INTERVAL -1 year))=#{month} |
|||
</if> |
|||
<if test="dateType != null and dateType != '' and dateType == 'day' "> |
|||
and DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') |
|||
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(c.complaint_time,INTERVAL -1 year),'%Y-%m-%d') |
|||
</if> |
|||
</where> |
|||
)x |
|||
group by bureau_dept_id order by total desc |
|||
</select> |
|||
</mapper> |
|||
Loading…
Reference in new issue