Browse Source

提交下首页

v6
蟑螂恶霸 1 year ago
parent
commit
29a264992f
  1. 2198
      lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/home.html
  2. 78
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/StatisticalPanelController.java
  3. 18
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalPanelMapper.java
  4. 18
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/StatisticalPaneService.java
  5. 33
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/StatisticalPaneServiceImpl.java
  6. 237
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalPanelMapper.xml

2198
lib/EmergencyService/zdxtEmergencyBootStart/src/main/resources/templates/project/code/statistical/home.html

File diff suppressed because it is too large

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

@ -218,20 +218,76 @@ public class StatisticalPanelController extends BaseController {
return ZDResponse.success("部门列表-街道和区直", deptBeans);
}
/** 全市新增检查数量 + 联合检查统计 + 单条检查统计 */
@PostMapping("/analysisEnterprisesCoordination")
@ResponseBody
public ZDResponse analysisEnterprisesCoordination(@RequestBody SixAnalysisParams params){
Map<String, Object> resMap = new HashMap<String, Object>();
// 全市行政检查数量
Integer all_num = statisticalPaneService.analysisEnterprisesAll(params);
resMap.put("allNum", all_num);
// 全市行政联合检查数量
Integer union_num = statisticalPaneService.analysisEnterprisesUnion(params);
double union_rr_num = statisticalPaneService.analysisEnterprisesUnionRr(params);
double union_yoy_num = statisticalPaneService.analysisEnterprisesUnionYoy(params);
String union_rr = this.setPercentage((union_num - union_rr_num) / union_rr_num);
String union_yoy = this.setPercentage((union_num - union_yoy_num) / union_yoy_num);
String union_per = this.setPercentage((double)union_num / all_num);
resMap.put("unionNum", union_num);
resMap.put("unionRr", union_rr);
resMap.put("unionYoy", union_yoy);
resMap.put("unionPer", union_per);
// 全市行政单条检查数量
Integer single_num = statisticalPaneService.analysisEnterprisesSingle(params);
double single_rr_num = statisticalPaneService.analysisEnterprisesSingleRr(params);
double single_yoy_num = statisticalPaneService.analysisEnterprisesSingleYoy(params);
String single_rr = this.setPercentage((single_num - single_rr_num) / single_rr_num);
String single_yoy = this.setPercentage((single_num - single_yoy_num) / single_yoy_num);
String single_per = this.setPercentage((double)single_num / all_num);
resMap.put("singleNum", single_num);
resMap.put("singleRr", single_rr);
resMap.put("singleYoy", single_yoy);
resMap.put("singlePer", single_per);
// 执法压减数据
Integer cut_num = all_num - (union_num + single_num);
String cut_per = this.setPercentage((double)cut_num / all_num);
resMap.put("cutNum", cut_num);
resMap.put("cutPer", cut_per);
return ZDResponse.success("联合检查", resMap);
}
/** 所有行政检查数量 */
@PostMapping("/analysisEnterprisesAll")
@ResponseBody
public ZDResponse analysisEnterprisesAll(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprisesAll(params);
return ZDResponse.success("新增检查", num);
}
/** 所有非行政检查数量 */
@PostMapping("/analysisEnterprisesNonAll")
@ResponseBody
public ZDResponse analysisEnterprisesNonAll(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprisesNonAll(params);
return ZDResponse.success("非新增检查", num);
}
/** 涉企检查 - 统计 */
@PostMapping("/analysisEnterprisesIns")
@PostMapping("/analysisEnterprisesUnion")
@ResponseBody
public ZDResponse analysisEnterprisesIns(@RequestBody SixAnalysisParams params){
Integer num = statisticalPaneService.analysisEnterprisesIns(params);
double ent_rr_num = statisticalPaneService.analysisEnterprisesInsRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesInsYoy(params);
params.setUniteCheck(null);
Integer allnum = statisticalPaneService.analysisEnterprisesIns(params);
public ZDResponse analysisEnterprisesUnion(@RequestBody SixAnalysisParams params){
Integer all_num = statisticalPaneService.analysisEnterprisesAll(params);
Integer num = statisticalPaneService.analysisEnterprisesUnion(params);
double ent_rr_num = statisticalPaneService.analysisEnterprisesUnionRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesUnionYoy(params);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
String per = this.setPercentage((double)num / allnum);
String per = this.setPercentage((double)num / all_num);
Map<String, Object> resMap = new HashMap<String, Object>();
resMap.put("allNum", all_num);
resMap.put("num", num);
resMap.put("rr", rr);
resMap.put("yoy", yoy);
@ -276,7 +332,7 @@ public class StatisticalPanelController extends BaseController {
double ent_rr_num = statisticalPaneService.analysisEnterprisesComplaintRr(params);
double ent_yoy_num = statisticalPaneService.analysisEnterprisesComplaintYoy(params);
params.setUniteCheck(null);
Integer regnum = statisticalPaneService.analysisEnterprisesIns(params);
Integer regnum = statisticalPaneService.analysisEnterprisesAll(params);
String rr = this.setPercentage((num - ent_rr_num) / ent_rr_num);
String yoy = this.setPercentage((num - ent_yoy_num) / ent_yoy_num);
String per = this.setPercentage((double)num / regnum);
@ -337,7 +393,7 @@ public class StatisticalPanelController extends BaseController {
deptParams.setDeptName(params.getDeptId());
List<DeptBean> depts = deptApi.selectDepts(deptParams);
params.setDeptId(depts.get(0).getDeptId());
Integer jc_num = statisticalPaneService.analysisEnterprisesIns(params);
Integer jc_num = statisticalPaneService.analysisEnterprisesAll(params);
Integer qy_num = statisticalPaneService.analysisEnterprises(params);
Integer njc_num = statisticalPaneService.analysis_non_enterprisesIns(params);
Integer nqy_num = statisticalPaneService.analysis_non_enterprises(params);
@ -345,7 +401,7 @@ public class StatisticalPanelController extends BaseController {
// 下转弹出层需要的数据(联合检查, 涉企检查频次压缩率, 行政检查预告次数, 涉企投诉次数)
params.setUniteCheck("1");
Integer nuite_jc_num_all = statisticalPaneService.analysis_enterprisesIns_all(params);
Integer nuite_jc_num = statisticalPaneService.analysisEnterprisesIns(params);
Integer nuite_jc_num = statisticalPaneService.analysisEnterprisesAll(params);
params.setUniteCheck(null);
Integer law_jc_num = statisticalPaneService.analysisInsNotice(params);
Integer com_jc_num = statisticalPaneService.analysisEnterprisesComplaint(params);

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

@ -120,10 +120,20 @@ public interface StatisticalPanelMapper {
List<Map<String, Object>> staisticalEnforce_type(SixAnalysisParams params);
/** 涉企检查 */
Integer analysis_enterprisesIns(SixAnalysisParams params);
Double analysis_enterprisesIns_rr(SixAnalysisParams params);
Double analysis_enterprisesIns_yoy(SixAnalysisParams params);
/** 行政检查数量 */
Integer analysis_enterprises_all(SixAnalysisParams params);
/** 非行政检查数量 */
Integer analysis_enterprises_non_all(SixAnalysisParams params);
/** 联合检查 */
Integer analysis_enterprises_union(SixAnalysisParams params);
Double analysis_enterprises_union_rr(SixAnalysisParams params);
Double analysis_enterprises_union_yoy(SixAnalysisParams params);
/** 单条检查 */
Integer analysis_enterprises_single(SixAnalysisParams params);
Double analysis_enterprises_single_rr(SixAnalysisParams params);
Double analysis_enterprises_single_yoy(SixAnalysisParams params);
Integer analysis_non_enterprisesIns(SixAnalysisParams params);
Integer analysis_enterprisesIns_all(SixAnalysisParams params);
/** 检查预告 */

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

@ -76,10 +76,20 @@ public interface StatisticalPaneService {
/** 涉企检查 */
Integer analysisEnterprisesIns(SixAnalysisParams params);
Double analysisEnterprisesInsRr(SixAnalysisParams params);
Double analysisEnterprisesInsYoy(SixAnalysisParams params);
/** 所有行政检查数量 */
Integer analysisEnterprisesAll(SixAnalysisParams params);
/** 所有非行政检查数量 */
Integer analysisEnterprisesNonAll(SixAnalysisParams params);
/** 联合检查统计 */
Integer analysisEnterprisesUnion(SixAnalysisParams params);
Double analysisEnterprisesUnionRr(SixAnalysisParams params);
Double analysisEnterprisesUnionYoy(SixAnalysisParams params);
/** 单条检查统计 */
Integer analysisEnterprisesSingle(SixAnalysisParams params);
Double analysisEnterprisesSingleRr(SixAnalysisParams params);
Double analysisEnterprisesSingleYoy(SixAnalysisParams params);
Integer analysis_non_enterprisesIns(SixAnalysisParams params);
Integer analysis_enterprisesIns_all(SixAnalysisParams params);
/** 检查预告 */

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

@ -1500,19 +1500,40 @@ public class StatisticalPaneServiceImpl implements StatisticalPaneService {
// return all_area;
// }
@Override
public Integer analysisEnterprisesAll(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_all(params);
}
@Override
public Integer analysisEnterprisesNonAll(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_non_all(params);
}
@Override
public Integer analysisEnterprisesUnion(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union(params);
}
@Override
public Double analysisEnterprisesUnionRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union_rr(params);
}
@Override
public Double analysisEnterprisesUnionYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union_yoy(params);
}
@Override
public Integer analysisEnterprisesIns(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns(params);
public Integer analysisEnterprisesSingle(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union(params);
}
@Override
public Double analysisEnterprisesInsRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_rr(params);
public Double analysisEnterprisesSingleRr(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union_rr(params);
}
@Override
public Double analysisEnterprisesInsYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprisesIns_yoy(params);
public Double analysisEnterprisesSingleYoy(SixAnalysisParams params) {
return statisticalPanelMapper.analysis_enterprises_union_yoy(params);
}
@Override

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

@ -1138,20 +1138,10 @@
group by t.satisfaction_level
</select>
<!-- 执法检查数量排行 -->
<select id="analysis_enterprisesIns" parameterType="SixAnalysisParams" resultType="integer">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
<!-- 所有行政检查数量 -->
<select id="analysis_enterprises_all" parameterType="SixAnalysisParams" resultType="integer">
SELECT count(1) FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
@ -1161,26 +1151,43 @@
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<select id="analysis_enterprisesIns_rr" parameterType="SixAnalysisParams" resultType="double">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
<select id="analysis_enterprises_all_rr" parameterType="SixAnalysisParams" resultType="integer">
SELECT count(1) FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
</select>
<select id="analysis_enterprises_all_yoy" parameterType="SixAnalysisParams" resultType="integer">
SELECT count(1) FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
@ -1190,12 +1197,85 @@
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
</select>
<!-- 所有非行政检查数量 -->
<select id="analysis_enterprises_non_all" parameterType="SixAnalysisParams" resultType="integer">
SELECT count(1) FROM non_enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.bureau_dept_id is not null
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<!-- 联合检查数量统计 -->
<select id="analysis_enterprises_union" parameterType="SixAnalysisParams" resultType="integer">
SELECT COUNT(1) AS _count
FROM (
SELECT 1
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
GROUP BY union_no
HAVING COUNT(1) > 1
) AS t
</select>
<select id="analysis_enterprises_union_rr" parameterType="SixAnalysisParams" resultType="double">
SELECT COUNT(1) AS _count
FROM (
SELECT 1
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
@ -1203,17 +1283,47 @@
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
GROUP BY union_no
HAVING COUNT(1) > 1
) AS t
</select>
<select id="analysis_enterprisesIns_yoy" parameterType="SixAnalysisParams" resultType="double">
select
<if test="uniteCheck == '1'.toString()">
count(distinct union_no) as num
<select id="analysis_enterprises_union_yoy" parameterType="SixAnalysisParams" resultType="double">
SELECT COUNT(1) AS _count
FROM (
SELECT 1
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and (r.union_no IS NOT NULL and r.union_no != '')
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == null or uniteCheck == '' or uniteCheck != '1'.toString()">
count(1) as num
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
from enforcement_registration r
where r.bureau_dept_name is not null
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
GROUP BY union_no
HAVING COUNT(1) > 1
) AS t
</select>
<!-- 单条检查数量统计 -->
<select id="analysis_enterprises_single" parameterType="SixAnalysisParams" resultType="integer">
SELECT count(1)
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
@ -1223,19 +1333,72 @@
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.has_union = 1
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="uniteCheck == '1'.toString()"> and (r.union_no is not null and r.union_no != '')</if>
<if test="uniteCheck == '0'.toString()"> and (r.union_no is null or r.union_no = '')</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%'))</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''"> and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d') </if>
<if test="endTime != null and endTime != ''"> and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(r.enforcement_time,'%Y-%m-%d') </if>
</select>
<select id="analysis_enterprises_single_rr" parameterType="SixAnalysisParams" resultType="double">
SELECT count(1)
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.has_union = 1
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')>=DATE_SUB(STR_TO_DATE(#{beginTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)
</if>
<if test="endTime != null and endTime != ''">
and DATE_SUB(STR_TO_DATE(#{endTime},"%Y-%m-%d"),INTERVAL TO_DAYS(STR_TO_DATE(#{endTime},"%Y-%m-%d"))-TO_DAYS(STR_TO_DATE(#{beginTime},"%Y-%m-%d"))+1 day)>=DATE_FORMAT(r.enforcement_time,'%Y-%m-%d')
</if>
GROUP BY union_no
HAVING COUNT(1) > 1
) AS t;
</select>
<select id="analysis_enterprises_single_yoy" parameterType="SixAnalysisParams" resultType="double">
SELECT count(1)
FROM enforcement_registration r
WHERE r.bureau_dept_name is not null
and r.is_submit = 1
and r.law_enforcement_id is not null
and r.enterprise_name is not null
and r.enterprise_number is not null
and r.law_enforcer is not null
and r.law_enforcer_two is not null
and r.is_complaint is not null
and r.check_category is not null
and r.bureau_dept_id is not null
and r.has_union = 1
<if test="params.zone != null and params.zone != ''"> and r.bureau_dept_id in (select dept_id from sys_dept where zone = #{params.zone}) </if>
<if test="deptId != null and deptId != ''">
and r.dept_id in (select sd.dept_id from sys_dept sd where find_in_set(#{deptId}, sd.ancestors) or sd.dept_id = #{deptId})
</if>
<if test="userId != null and userId != '' ">and( r.law_enforcer_id=#{userId} or r.law_enforcer_id_two like concat('%',#{userId}, '%')) </if>
<if test="beginTime != null and beginTime != ''">
and DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d') >= DATE_FORMAT(#{beginTime},'%Y-%m-%d')
</if>
<if test="endTime != null and endTime != ''">
and DATE_FORMAT(#{endTime},'%Y-%m-%d') >= DATE_FORMAT(DATE_SUB(r.enforcement_time,INTERVAL -1 year),'%Y-%m-%d')
</if>
GROUP BY union_no
HAVING COUNT(1) > 1
) AS t;
</select>
<select id="analysis_non_enterprisesIns" parameterType="SixAnalysisParams" resultType="integer">

Loading…
Cancel
Save