Browse Source

监督端-导出接口

dev-V1.10.0
niujiyi 11 hours ago
parent
commit
2baf04471e
  1. 43
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/report/LawEnfOfficerController.java
  2. 72
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/report/ScanDataSituationController.java
  3. 15
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/ScanDataSituationVo.java
  4. 4
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/LawEnfOfficerMapper.java
  5. 4
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/ScanDataSituationMapper.java
  6. 4
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/ILawEnfOfficerService.java
  7. 14
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/IScanDataSituationService.java
  8. 10
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/impl/LawEnfOfficerSericeImpl.java
  9. 10
      zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/impl/ScanDataSituationServiceImpl.java
  10. 42
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/LawEnfOfficerMapper.xml
  11. 330
      zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/ScanDataSituationMapper.xml

43
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/report/LawEnfOfficerController.java

@ -72,6 +72,26 @@ public class LawEnfOfficerController {
} }
/**
* 执法人员-导出Excel
*/
@PostMapping("/exportDetails")
public void exportDetails(EnforcementRegistrationBo bo, HttpServletResponse response) {
try {
List<LawEnfOfficerVo> list = lawEnfOfficerService.selectLawEnfOfficerDetailsList(bo);
ExcelUtil.exportExcel(list, "区域执法人员明细", LawEnfOfficerVo.class, response);
} catch (Exception e) {
log.error("导出区域执法人员明细Excel异常", e);
response.reset();
response.setContentType("application/json; charset=utf-8");
try {
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败: " + e.getMessage() + "\"}");
} catch (Exception ignored) {
log.error("响应重置异常", ignored);
}
}
}
/** /**
* 领域执法人员执法次数 * 领域执法人员执法次数
* @param bo * @param bo
@ -104,9 +124,9 @@ public class LawEnfOfficerController {
public void exportDomain(EnforcementRegistrationBo bo, HttpServletResponse response) { public void exportDomain(EnforcementRegistrationBo bo, HttpServletResponse response) {
try { try {
List<LawEnfOfficerVo> list = lawEnfOfficerService.selectDomainLawEnfOfficerList(bo); List<LawEnfOfficerVo> list = lawEnfOfficerService.selectDomainLawEnfOfficerList(bo);
ExcelUtil.exportExcel(list, "执法人员", LawEnfOfficerVo.class, response); ExcelUtil.exportExcel(list, "领域执法人员", LawEnfOfficerVo.class, response);
} catch (Exception e) { } catch (Exception e) {
log.error("导出执法人员Excel异常", e); log.error("导出领域执法人员Excel异常", e);
response.reset(); response.reset();
response.setContentType("application/json; charset=utf-8"); response.setContentType("application/json; charset=utf-8");
try { try {
@ -117,5 +137,24 @@ public class LawEnfOfficerController {
} }
} }
/**
* 领域执法人员-导出Excel
*/
@PostMapping("/exportDomainDetails")
public void exportDomainDetails(EnforcementRegistrationBo bo, HttpServletResponse response) {
try {
List<LawEnfOfficerVo> list = lawEnfOfficerService.selectDomainLawEnfOfficerDetailsList(bo);
ExcelUtil.exportExcel(list, "领域执法人员明细", LawEnfOfficerVo.class, response);
} catch (Exception e) {
log.error("导出领域执法人员明细Excel异常", e);
response.reset();
response.setContentType("application/json; charset=utf-8");
try {
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败: " + e.getMessage() + "\"}");
} catch (Exception ignored) {
log.error("响应重置异常", ignored);
}
}
}
} }

72
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/controller/web/supervision/report/ScanDataSituationController.java

@ -12,7 +12,9 @@ import com.zdxt.enforcementcode.report.IScanDataSituationService;
import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.dromara.common.core.utils.file.FileUtils;
import org.dromara.common.excel.utils.ExcelUtil; import org.dromara.common.excel.utils.ExcelUtil;
import org.dromara.common.excel.utils.ExcelWriterWrapper;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo; import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
@ -21,6 +23,7 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.util.Arrays;
import java.util.List; import java.util.List;
@ -66,7 +69,13 @@ public class ScanDataSituationController {
public void export(ScanDataSituationBo bo, HttpServletResponse response) { public void export(ScanDataSituationBo bo, HttpServletResponse response) {
try { try {
List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationAreaList(bo); List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationAreaList(bo);
ExcelUtil.exportExcel(list, "各区扫码情", ScanDataSituationVo.class, response); String sheetName = "各区扫码情况";
FileUtils.setAttachmentResponseHeader(response, ExcelUtil.encodingFilename(sheetName));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
ExcelUtil.exportExcel(ScanDataSituationVo.class, response.getOutputStream(), wrapper ->
wrapper.write(list, ExcelWriterWrapper.sheetBuilder(sheetName)
.excludeColumnFieldNames(Arrays.asList("domainName", "streetName", "deptName"))
.build()));
} catch (Exception e) { } catch (Exception e) {
log.error("导出各区扫码情Excel异常", e); log.error("导出各区扫码情Excel异常", e);
response.reset(); response.reset();
@ -79,6 +88,33 @@ public class ScanDataSituationController {
} }
} }
/**
* 各区扫码情明细-导出Excel
*/
@PostMapping("/exportAreaDetails")
public void exportAreaDetails(ScanDataSituationBo bo, HttpServletResponse response) {
try {
List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationAreaDetailsList(bo);
String sheetName = "区街道扫码情况";
FileUtils.setAttachmentResponseHeader(response, ExcelUtil.encodingFilename(sheetName));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
ExcelUtil.exportExcel(ScanDataSituationVo.class, response.getOutputStream(), wrapper ->
wrapper.write(list, ExcelWriterWrapper.sheetBuilder(sheetName)
.excludeColumnFieldNames(Arrays.asList("domainName", "districtName", "deptName"))
.build()));
} catch (Exception e) {
log.error("导出各区街道扫码情Excel异常", e);
response.reset();
response.setContentType("application/json; charset=utf-8");
try {
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败: " + e.getMessage() + "\"}");
} catch (Exception ignored) {
log.error("响应重置异常", ignored);
}
}
}
/** /**
* 各领域扫码情况 * 各领域扫码情况
*/ */
@ -104,7 +140,39 @@ public class ScanDataSituationController {
public void exportDomain(ScanDataSituationBo bo, HttpServletResponse response) { public void exportDomain(ScanDataSituationBo bo, HttpServletResponse response) {
try { try {
List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationDomainList(bo); List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationDomainList(bo);
ExcelUtil.exportExcel(list, "各领域扫码情况", ScanDataSituationVo.class, response); String sheetName = "各领域扫码情况";
FileUtils.setAttachmentResponseHeader(response, ExcelUtil.encodingFilename(sheetName));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
ExcelUtil.exportExcel(ScanDataSituationVo.class, response.getOutputStream(), wrapper ->
wrapper.write(list, ExcelWriterWrapper.sheetBuilder(sheetName)
.excludeColumnFieldNames(Arrays.asList("districtName", "enterpriseCount", "deptName","streetName"))
.build()));
} catch (Exception e) {
log.error("导出各领域扫码情况Excel异常", e);
response.reset();
response.setContentType("application/json; charset=utf-8");
try {
response.getWriter().write("{\"code\":500,\"msg\":\"导出失败: " + e.getMessage() + "\"}");
} catch (Exception ignored) {
log.error("响应重置异常", ignored);
}
}
}
/**
* 各领域扫码情况明细-导出Excel
*/
@PostMapping("/exportDomainDetails")
public void exportDomainDetails(ScanDataSituationBo bo, HttpServletResponse response) {
try {
List<ScanDataSituationVo> list = scanDataSituationService.selectScanDataSituationDomainDetailsList(bo);
String sheetName = "各领域扫码情况";
FileUtils.setAttachmentResponseHeader(response, ExcelUtil.encodingFilename(sheetName));
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8");
ExcelUtil.exportExcel(ScanDataSituationVo.class, response.getOutputStream(), wrapper ->
wrapper.write(list, ExcelWriterWrapper.sheetBuilder(sheetName)
.excludeColumnFieldNames(Arrays.asList("districtName", "enterpriseCount", "domainName","streetName"))
.build()));
} catch (Exception e) { } catch (Exception e) {
log.error("导出各领域扫码情况Excel异常", e); log.error("导出各领域扫码情况Excel异常", e);
response.reset(); response.reset();

15
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/domain/vo/ScanDataSituationVo.java

@ -28,9 +28,15 @@ public class ScanDataSituationVo {
/** /**
* 领域名称 * 领域名称
*/ */
@ExcelProperty(value = "所属领域")
private String domainName; private String domainName;
/**
* 执法部门名称
*/
@ExcelProperty(value = "所属领域")
private String deptName;
/** /**
* 街道编码 * 街道编码
*/ */
@ -39,6 +45,7 @@ public class ScanDataSituationVo {
/** /**
* 街道名称 * 街道名称
*/ */
@ExcelProperty(value = "所属街道")
private String streetName; private String streetName;
/** /**
@ -93,10 +100,6 @@ public class ScanDataSituationVo {
*/ */
private String deptId; private String deptId;
/**
* 执法部门名称
*/
@ExcelProperty(value = "所属领域")
private String deptName;
} }

4
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/LawEnfOfficerMapper.java

@ -20,6 +20,8 @@ public interface LawEnfOfficerMapper {
Page<LawEnfOfficerVo> selectLawEnfOfficerDetailsPageList(@Param("page") Page<EnforcementRegistrationVo> page, Page<LawEnfOfficerVo> selectLawEnfOfficerDetailsPageList(@Param("page") Page<EnforcementRegistrationVo> page,
@Param("bo") EnforcementRegistrationBo bo); @Param("bo") EnforcementRegistrationBo bo);
List<LawEnfOfficerVo> selectLawEnfOfficerDetailsList(@Param("bo") EnforcementRegistrationBo bo);
Page<LawEnfOfficerVo> selectDomainLawEnfOfficerPageList(@Param("page") Page<EnforcementRegistrationVo> page, Page<LawEnfOfficerVo> selectDomainLawEnfOfficerPageList(@Param("page") Page<EnforcementRegistrationVo> page,
@Param("bo") EnforcementRegistrationBo bo); @Param("bo") EnforcementRegistrationBo bo);
@ -28,4 +30,6 @@ public interface LawEnfOfficerMapper {
Page<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsPageList(@Param("page") Page<EnforcementRegistrationVo> page, Page<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsPageList(@Param("page") Page<EnforcementRegistrationVo> page,
@Param("bo") EnforcementRegistrationBo bo); @Param("bo") EnforcementRegistrationBo bo);
List<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsList(@Param("bo") EnforcementRegistrationBo bo);
} }

4
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/mapper/ScanDataSituationMapper.java

@ -19,6 +19,8 @@ public interface ScanDataSituationMapper {
Page<ScanDataSituationVo> selectScanDataSituationAreaDetailsPageList(@Param("page") Page<ScanDataSituationVo> page, Page<ScanDataSituationVo> selectScanDataSituationAreaDetailsPageList(@Param("page") Page<ScanDataSituationVo> page,
@Param("bo") ScanDataSituationBo bo); @Param("bo") ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationAreaDetailsList(@Param("bo") ScanDataSituationBo bo);
Page<ScanDataSituationVo> selectScanDataSituationDomainPageList(@Param("page") Page<ScanDataSituationVo> page, Page<ScanDataSituationVo> selectScanDataSituationDomainPageList(@Param("page") Page<ScanDataSituationVo> page,
@Param("bo") ScanDataSituationBo bo); @Param("bo") ScanDataSituationBo bo);
@ -26,4 +28,6 @@ public interface ScanDataSituationMapper {
Page<ScanDataSituationVo> selectScanDataSituationDomainDetailsPageList(@Param("page") Page<ScanDataSituationVo> page, Page<ScanDataSituationVo> selectScanDataSituationDomainDetailsPageList(@Param("page") Page<ScanDataSituationVo> page,
@Param("bo") ScanDataSituationBo bo); @Param("bo") ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationDomainDetailsList(@Param("bo") ScanDataSituationBo bo);
} }

4
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/ILawEnfOfficerService.java

@ -17,7 +17,7 @@ public interface ILawEnfOfficerService {
TableDataInfo<LawEnfOfficerVo> selectLawEnfOfficerDetailsPageList(PageQuery pageQuery,EnforcementRegistrationBo bo); TableDataInfo<LawEnfOfficerVo> selectLawEnfOfficerDetailsPageList(PageQuery pageQuery,EnforcementRegistrationBo bo);
List<LawEnfOfficerVo> selectLawEnfOfficerDetailsList(EnforcementRegistrationBo bo);
/** /**
* 领域查询执法人员 * 领域查询执法人员
* @param pageQuery * @param pageQuery
@ -29,4 +29,6 @@ public interface ILawEnfOfficerService {
List<LawEnfOfficerVo> selectDomainLawEnfOfficerList(EnforcementRegistrationBo bo); List<LawEnfOfficerVo> selectDomainLawEnfOfficerList(EnforcementRegistrationBo bo);
TableDataInfo<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsPageList(PageQuery pageQuery,EnforcementRegistrationBo bo); TableDataInfo<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsPageList(PageQuery pageQuery,EnforcementRegistrationBo bo);
List<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsList(EnforcementRegistrationBo bo);
} }

14
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/IScanDataSituationService.java

@ -12,15 +12,29 @@ import java.util.List;
public interface IScanDataSituationService { public interface IScanDataSituationService {
/**
* 各区扫码情况
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ScanDataSituationVo> selectScanDataSituationAreaPageList(PageQuery pageQuery,ScanDataSituationBo bo); TableDataInfo<ScanDataSituationVo> selectScanDataSituationAreaPageList(PageQuery pageQuery,ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationAreaList(ScanDataSituationBo bo); List<ScanDataSituationVo> selectScanDataSituationAreaList(ScanDataSituationBo bo);
TableDataInfo<ScanDataSituationVo> selectScanDataSituationAreaDetailsPageList(PageQuery pageQuery,ScanDataSituationBo bo); TableDataInfo<ScanDataSituationVo> selectScanDataSituationAreaDetailsPageList(PageQuery pageQuery,ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationAreaDetailsList(ScanDataSituationBo bo);
/**
* 各领域扫码情况
*/
TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainPageList(PageQuery pageQuery, ScanDataSituationBo bo); TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainPageList(PageQuery pageQuery, ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationDomainList(ScanDataSituationBo bo); List<ScanDataSituationVo> selectScanDataSituationDomainList(ScanDataSituationBo bo);
TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainDetailsPageList(PageQuery pageQuery, ScanDataSituationBo bo); TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainDetailsPageList(PageQuery pageQuery, ScanDataSituationBo bo);
List<ScanDataSituationVo> selectScanDataSituationDomainDetailsList(ScanDataSituationBo bo);
} }

10
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/impl/LawEnfOfficerSericeImpl.java

@ -51,6 +51,11 @@ public class LawEnfOfficerSericeImpl implements ILawEnfOfficerService {
return TableDataInfo.build(list); return TableDataInfo.build(list);
} }
@Override
public List<LawEnfOfficerVo> selectLawEnfOfficerDetailsList(EnforcementRegistrationBo bo) {
return lawEnfOfficerMapper.selectLawEnfOfficerDetailsList(bo);
}
@Override @Override
public TableDataInfo<LawEnfOfficerVo> selectDomainLawEnfOfficerPageList(PageQuery pageQuery, EnforcementRegistrationBo bo) { public TableDataInfo<LawEnfOfficerVo> selectDomainLawEnfOfficerPageList(PageQuery pageQuery, EnforcementRegistrationBo bo) {
Page<LawEnfOfficerVo> list=lawEnfOfficerMapper.selectDomainLawEnfOfficerPageList(buildPage(pageQuery),bo); Page<LawEnfOfficerVo> list=lawEnfOfficerMapper.selectDomainLawEnfOfficerPageList(buildPage(pageQuery),bo);
@ -68,6 +73,11 @@ public class LawEnfOfficerSericeImpl implements ILawEnfOfficerService {
return TableDataInfo.build(list); return TableDataInfo.build(list);
} }
@Override
public List<LawEnfOfficerVo> selectDomainLawEnfOfficerDetailsList(EnforcementRegistrationBo bo) {
return lawEnfOfficerMapper.selectDomainLawEnfOfficerDetailsList(bo);
}
/** /**
* 构建双列数据权限过滤条件:bureau_dept_id(执法单位)或 entrust_dept_id(委托执法部门)。 * 构建双列数据权限过滤条件:bureau_dept_id(执法单位)或 entrust_dept_id(委托执法部门)。

10
zdxt-modules/zdxt-enforcement-code/src/main/java/com/zdxt/enforcementcode/report/impl/ScanDataSituationServiceImpl.java

@ -48,6 +48,11 @@ public class ScanDataSituationServiceImpl implements IScanDataSituationService {
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
@Override
public List<ScanDataSituationVo> selectScanDataSituationAreaDetailsList(ScanDataSituationBo bo) {
return scanDataSituationMapper.selectScanDataSituationAreaDetailsList( bo);
}
@Override @Override
public TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainPageList(PageQuery pageQuery, ScanDataSituationBo bo) { public TableDataInfo<ScanDataSituationVo> selectScanDataSituationDomainPageList(PageQuery pageQuery, ScanDataSituationBo bo) {
@ -65,4 +70,9 @@ public class ScanDataSituationServiceImpl implements IScanDataSituationService {
Page<ScanDataSituationVo> page=scanDataSituationMapper.selectScanDataSituationDomainDetailsPageList(buildPage(pageQuery),bo); Page<ScanDataSituationVo> page=scanDataSituationMapper.selectScanDataSituationDomainDetailsPageList(buildPage(pageQuery),bo);
return TableDataInfo.build(page); return TableDataInfo.build(page);
} }
@Override
public List<ScanDataSituationVo> selectScanDataSituationDomainDetailsList(ScanDataSituationBo bo) {
return scanDataSituationMapper.selectScanDataSituationDomainDetailsList(bo);
}
} }

42
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/LawEnfOfficerMapper.xml

@ -76,7 +76,8 @@
<include refid="selectLawEnfOfficerSql"/> <include refid="selectLawEnfOfficerSql"/>
</select> </select>
<select id="selectLawEnfOfficerDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo"> <!-- 执法人员区域明细 -->
<sql id="selectLawEnfOfficerDetailsSql">
select select
t1.bureau_dept_id as bureauDeptId, t1.bureau_dept_id as bureauDeptId,
t1.bureau_dept_name as bureauDeptName, t1.bureau_dept_name as bureauDeptName,
@ -89,11 +90,11 @@
t1.enterprise_name as enterpriseName, t1.enterprise_name as enterpriseName,
t1.law_enforcement_item_text as lawEnforcementItemText t1.law_enforcement_item_text as lawEnforcementItemText
from enforcement_registration t1 from enforcement_registration t1
left join sys_user t2 on left join sys_user t2 on
t1.law_enforcer_id = t2.user_id t1.law_enforcer_id = t2.user_id
left join sys_dept t3 on left join sys_dept t3 on
t2.dept_id = t3.dept_id t2.dept_id = t3.dept_id
left join dashboard_area_info t4 on left join dashboard_area_info t4 on
t3.area_node = t4.code and t4.level = 3 t3.area_node = t4.code and t4.level = 3
<where> <where>
<if test="bo.lawEnforcerId !=null and bo.lawEnforcerId!=''"> <if test="bo.lawEnforcerId !=null and bo.lawEnforcerId!=''">
@ -112,13 +113,21 @@
and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%Y-%m-%d') and DATE_FORMAT(t1.enforcement_time,'%Y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%Y-%m-%d')
</if> </if>
</where> </where>
and t1.is_submit =1 and t1.is_submit =1
and t1.is_delete = 0 and t1.is_delete = 0
and t1.enterprise_name is not null and t1.enterprise_name is not null
and t1.enterprise_number is not null and t1.enterprise_number is not null
order by t1.enforcement_time desc order by t1.enforcement_time desc
</sql>
<!-- 执法人员区明细 -->
<select id="selectLawEnfOfficerDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo">
<include refid="selectLawEnfOfficerDetailsSql"/>
</select>
<select id="selectLawEnfOfficerDetailsList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo">
<include refid="selectLawEnfOfficerDetailsSql"/>
</select> </select>
<!-- 执法人员领域 -->
<select id="selectDomainLawEnfOfficerPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo"> <select id="selectDomainLawEnfOfficerPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo">
<include refid="selectDomainLawEnfOfficerSql"/> <include refid="selectDomainLawEnfOfficerSql"/>
</select> </select>
@ -130,10 +139,8 @@
select select
t1.lawEnforcerId, t1.lawEnforcerId,
t1.lawEnforcer, t1.lawEnforcer,
t1.bureauDeptId,
t1.bureauDeptName,
t1.zfcs, t1.zfcs,
t4.dept_name as domainName t4.domain_name as domainName
from from
( (
select select
@ -175,7 +182,7 @@
t3.dept_id = t4.dept_id t3.dept_id = t4.dept_id
<where> <where>
<if test="bo.domainName!=null and bo.domainName !=''"> <if test="bo.domainName!=null and bo.domainName !=''">
and t4.dept_name like CONCAT('%', #{bo.domainName}, '%') and t4.domain_name like CONCAT('%', #{bo.domainName}, '%')
</if> </if>
<if test="bo.bureauDeptName!=null and bo.bureauDeptName !=''"> <if test="bo.bureauDeptName!=null and bo.bureauDeptName !=''">
and t1.bureauDeptName like CONCAT('%', #{bo.bureauDeptName}, '%') and t1.bureauDeptName like CONCAT('%', #{bo.bureauDeptName}, '%')
@ -189,7 +196,8 @@
</choose> </choose>
</sql> </sql>
<select id="selectDomainLawEnfOfficerDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo"> <!-- 执法人员领域明细 -->
<sql id="selectDomainLawEnfOfficerDetailsSql">
select select
t1.bureau_dept_id as bureauDeptId, t1.bureau_dept_id as bureauDeptId,
t1.bureau_dept_name as bureauDeptName, t1.bureau_dept_name as bureauDeptName,
@ -230,5 +238,13 @@
and t1.enterprise_name is not null and t1.enterprise_name is not null
and t1.enterprise_number is not null and t1.enterprise_number is not null
order by t1.enforcement_time desc order by t1.enforcement_time desc
</sql>
<select id="selectDomainLawEnfOfficerDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo">
<include refid="selectDomainLawEnfOfficerDetailsSql"/>
</select>
<select id="selectDomainLawEnfOfficerDetailsList" resultType="com.zdxt.enforcementcode.domain.vo.LawEnfOfficerVo">
<include refid="selectDomainLawEnfOfficerDetailsSql"/>
</select> </select>
</mapper> </mapper>

330
zdxt-modules/zdxt-enforcement-code/src/main/resources/mapper/enforcementcode/ScanDataSituationMapper.xml

@ -132,8 +132,8 @@
<include refid="selectScanDataSituationAreaSql"/> <include refid="selectScanDataSituationAreaSql"/>
</select> </select>
<!-- 各区扫码情况明细 -->
<select id="selectScanDataSituationAreaDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo"> <sql id="selectScanDataSituationAreaDetailsSql">
select select
street_code as streetCode, street_code as streetCode,
street_name as streetName, street_name as streetName,
@ -157,90 +157,90 @@
dashboard_area_info t3 dashboard_area_info t3
<!-- 两类执法数据各扫描一次,地址匹配街道名,同时得到执法数量与去重后的执法企业数 --> <!-- 两类执法数据各扫描一次,地址匹配街道名,同时得到执法数量与去重后的执法企业数 -->
left join ( left join (
select select
code, code,
SUM(is_xz) as xz_cnt, SUM(is_xz) as xz_cnt,
SUM(1 - is_xz) as fxz_cnt, SUM(1 - is_xz) as fxz_cnt,
COUNT(DISTINCT enterprise_key) as ent_cnt COUNT(DISTINCT enterprise_key) as ent_cnt
from from
( (
select select
t4.code as code, t4.code as code,
1 as is_xz, 1 as is_xz,
COALESCE(NULLIF(TRIM(t1.enterprise_number),''), NULLIF(TRIM(t1.enterprise_name),'')) as enterprise_key COALESCE(NULLIF(TRIM(t1.enterprise_number),''), NULLIF(TRIM(t1.enterprise_name),'')) as enterprise_key
from from
enforcement_registration t1 enforcement_registration t1
join dashboard_area_info t4 on join dashboard_area_info t4 on
t1.enterprise_address like CONCAT('%',t4.name,'%') t1.enterprise_address like CONCAT('%',t4.name,'%')
where
t1.is_delete = 0
and t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
and t4.level = 4
and t4.is_delete = '0'
<if test = "bo.year != null">
AND t1.enforcement_time &gt;= STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d')
AND t1.enforcement_time &lt; DATE_ADD(STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d'), INTERVAL 1 YEAR)
</if>
<if test = "bo.quarter != null">
AND QUARTER(t1.enforcement_time) = #{bo.quarter}
</if>
<if test = "bo.month != null">
AND MONTH(t1.enforcement_time) = #{bo.month}
</if>
<if test = "bo.startTime != null">
AND t1.enforcement_time &gt;= DATE(#{bo.startTime})
</if>
<if test = "bo.endTime != null">
AND t1.enforcement_time &lt; DATE_ADD(DATE(#{bo.endTime}), INTERVAL 1 DAY)
</if>
<if test="bo.districtCode!=null and bo.districtCode!=''">
and t4.parent_code =#{bo.districtCode}
</if>
union all
select
t4.code as code,
0 as is_xz,
COALESCE(NULLIF(TRIM(t1.enterprise_number),''), NULLIF(TRIM(t1.enterprise_name),'')) as enterprise_key
from
non_enforcement_registration t1
join dashboard_area_info t4 on
t1.enterprise_address like CONCAT('%',t4.name,'%')
where
t1.has_delete = 0
and t4.level = 4
and t4.is_delete = '0'
<if test = "bo.year != null">
AND t1.enforcement_time &gt;= STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d')
AND t1.enforcement_time &lt; DATE_ADD(STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d'), INTERVAL 1 YEAR)
</if>
<if test = "bo.quarter != null">
AND QUARTER(t1.enforcement_time) = #{bo.quarter}
</if>
<if test = "bo.month != null">
AND MONTH(t1.enforcement_time) = #{bo.month}
</if>
<if test = "bo.startTime != null">
AND t1.enforcement_time &gt;= DATE(#{bo.startTime})
</if>
<if test = "bo.endTime != null">
AND t1.enforcement_time &lt; DATE_ADD(DATE(#{bo.endTime}), INTERVAL 1 DAY)
</if>
<if test="bo.districtCode!=null and bo.districtCode!=''">
and t4.parent_code =#{bo.districtCode}
</if>
) u
group by
code
) agg on
t3.code = agg.code
where where
t1.is_delete = 0
and t1.is_submit = 1
and t1.enterprise_name is not null
and t1.enterprise_number is not null
and t4.level = 4
and t4.is_delete = '0'
<if test = "bo.year != null">
AND t1.enforcement_time &gt;= STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d')
AND t1.enforcement_time &lt; DATE_ADD(STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d'), INTERVAL 1 YEAR)
</if>
<if test = "bo.quarter != null">
AND QUARTER(t1.enforcement_time) = #{bo.quarter}
</if>
<if test = "bo.month != null">
AND MONTH(t1.enforcement_time) = #{bo.month}
</if>
<if test = "bo.startTime != null">
AND t1.enforcement_time &gt;= DATE(#{bo.startTime})
</if>
<if test = "bo.endTime != null">
AND t1.enforcement_time &lt; DATE_ADD(DATE(#{bo.endTime}), INTERVAL 1 DAY)
</if>
<if test="bo.districtCode!=null and bo.districtCode!=''">
and t4.parent_code =#{bo.districtCode}
</if>
union all
select
t4.code as code,
0 as is_xz,
COALESCE(NULLIF(TRIM(t1.enterprise_number),''), NULLIF(TRIM(t1.enterprise_name),'')) as enterprise_key
from
non_enforcement_registration t1
join dashboard_area_info t4 on
t1.enterprise_address like CONCAT('%',t4.name,'%')
where
t1.has_delete = 0
and t4.level = 4
and t4.is_delete = '0'
<if test = "bo.year != null">
AND t1.enforcement_time &gt;= STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d')
AND t1.enforcement_time &lt; DATE_ADD(STR_TO_DATE(CONCAT(#{bo.year},'-01-01'),'%Y-%m-%d'), INTERVAL 1 YEAR)
</if>
<if test = "bo.quarter != null">
AND QUARTER(t1.enforcement_time) = #{bo.quarter}
</if>
<if test = "bo.month != null">
AND MONTH(t1.enforcement_time) = #{bo.month}
</if>
<if test = "bo.startTime != null">
AND t1.enforcement_time &gt;= DATE(#{bo.startTime})
</if>
<if test = "bo.endTime != null">
AND t1.enforcement_time &lt; DATE_ADD(DATE(#{bo.endTime}), INTERVAL 1 DAY)
</if>
<if test="bo.districtCode!=null and bo.districtCode!=''">
and t4.parent_code =#{bo.districtCode}
</if>
) u
group by
code
) agg on
t3.code = agg.code
where
t3.level = 4 t3.level = 4
and t3.is_delete = '0' and t3.is_delete = '0'
<if test="bo.districtCode!=null and bo.districtCode!=''"> <if test="bo.districtCode!=null and bo.districtCode!=''">
and t3.parent_code =#{bo.districtCode} and t3.parent_code =#{bo.districtCode}
</if> </if>
) base ) base
<!-- 排序:与区域列表一致,走白名单,避免 MyBatis-Plus 再追加排序字段 --> <!-- 排序:与区域列表一致,走白名单,避免 MyBatis-Plus 再追加排序字段 -->
order by order by
@ -255,9 +255,18 @@
<otherwise>xzzfslpm</otherwise> <otherwise>xzzfslpm</otherwise>
</choose> </choose>
<if test="bo.isAsc == 'desc'">desc</if> <if test="bo.isAsc == 'desc'">desc</if>
</sql>
<select id="selectScanDataSituationAreaDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo">
<include refid="selectScanDataSituationAreaDetailsSql"/>
</select>
<select id="selectScanDataSituationAreaDetailsList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo">
<include refid="selectScanDataSituationAreaDetailsSql"/>
</select> </select>
<!-- 各领域扫码情况 -->
<sql id="selectScanDataSituationDomainSql"> <sql id="selectScanDataSituationDomainSql">
select select
domain_id as domainId, domain_id as domainId,
@ -388,8 +397,8 @@
<include refid="selectScanDataSituationDomainSql"/> <include refid="selectScanDataSituationDomainSql"/>
</select> </select>
<!-- 各领域扫码情况明细 -->
<select id="selectScanDataSituationDomainDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo"> <sql id="selectScanDataSituationDomainDetailsSql">
select select
domain_id as domainId, domain_id as domainId,
domain_name as domainName, domain_name as domainName,
@ -402,82 +411,82 @@
rank() over (order by fxzzf_count desc ) as fxzzfslpm, rank() over (order by fxzzf_count desc ) as fxzzfslpm,
ROUND(fxzzf_count * 100.0 / nullif(SUM(fxzzf_count)over(), 0), 2) as fxzzfslzb, ROUND(fxzzf_count * 100.0 / nullif(SUM(fxzzf_count)over(), 0), 2) as fxzzfslzb,
(xzzf_count + fxzzf_count) as totalCount (xzzf_count + fxzzf_count) as totalCount
from
(
select
t1.domain_id,
t1.domain_name,
t1.dept_id,
t1.dept_name,
coalesce(xz.xz_cnt, 0) as xzzf_count,
coalesce(fxz.fxz_cnt, 0) as fxzzf_count
from from
( dashboard_domain_dept t1
select
t1.domain_id,
t1.domain_name,
t1.dept_id,
t1.dept_name,
coalesce(xz.xz_cnt, 0) as xzzf_count,
coalesce(fxz.fxz_cnt, 0) as fxzzf_count
from
dashboard_domain_dept t1
<!-- 1) 行政执法数量:按子领域(bureau_dept_id)聚合--> <!-- 1) 行政执法数量:按子领域(bureau_dept_id)聚合-->
left join ( left join (
select select
t2.bureau_dept_id as dept_id, t2.bureau_dept_id as dept_id,
COUNT(1) as xz_cnt COUNT(1) as xz_cnt
from from
enforcement_registration t2 enforcement_registration t2
<where> <where>
t2.is_delete = 0 t2.is_delete = 0
and t2.is_submit = 1 and t2.is_submit = 1
and t2.enterprise_name is not null and t2.enterprise_name is not null
and t2.enterprise_number is not null and t2.enterprise_number is not null
<if test = "bo.year != null"> <if test = "bo.year != null">
AND YEAR(t2.enforcement_time) = #{bo.year} AND YEAR(t2.enforcement_time) = #{bo.year}
</if> </if>
<if test = "bo.quarter != null"> <if test = "bo.quarter != null">
AND QUARTER(t2.enforcement_time) = #{bo.quarter} AND QUARTER(t2.enforcement_time) = #{bo.quarter}
</if> </if>
<if test = "bo.month != null"> <if test = "bo.month != null">
AND MONTH(t2.enforcement_time) = #{bo.month} AND MONTH(t2.enforcement_time) = #{bo.month}
</if> </if>
<if test = "bo.startTime != null"> <if test = "bo.startTime != null">
AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &gt;= DATE_FORMAT(#{bo.startTime},'%y-%m-%d') AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &gt;= DATE_FORMAT(#{bo.startTime},'%y-%m-%d')
</if> </if>
<if test = "bo.endTime != null"> <if test = "bo.endTime != null">
AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%y-%m-%d') AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%y-%m-%d')
</if> </if>
</where> </where>
group by group by
t2.bureau_dept_id t2.bureau_dept_id
) xz on t1.dept_id = xz.dept_id ) xz on t1.dept_id = xz.dept_id
<!-- 2) 非行政执法数量:按子领域(bureau_dept_id)聚合--> <!-- 2) 非行政执法数量:按子领域(bureau_dept_id)聚合-->
left join ( left join (
select select
t2.bureau_dept_id as dept_id, t2.bureau_dept_id as dept_id,
COUNT(1) as fxz_cnt COUNT(1) as fxz_cnt
from from
non_enforcement_registration t2 non_enforcement_registration t2
<where> <where>
t2.has_delete = 0 t2.has_delete = 0
<if test = "bo.year != null"> <if test = "bo.year != null">
AND YEAR(t2.enforcement_time) = #{bo.year} AND YEAR(t2.enforcement_time) = #{bo.year}
</if> </if>
<if test = "bo.quarter != null"> <if test = "bo.quarter != null">
AND QUARTER(t2.enforcement_time) = #{bo.quarter} AND QUARTER(t2.enforcement_time) = #{bo.quarter}
</if> </if>
<if test = "bo.month != null"> <if test = "bo.month != null">
AND MONTH(t2.enforcement_time) = #{bo.month} AND MONTH(t2.enforcement_time) = #{bo.month}
</if> </if>
<if test = "bo.startTime != null"> <if test = "bo.startTime != null">
AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &gt;= DATE_FORMAT(#{bo.startTime},'%y-%m-%d') AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &gt;= DATE_FORMAT(#{bo.startTime},'%y-%m-%d')
</if> </if>
<if test = "bo.endTime != null"> <if test = "bo.endTime != null">
AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%y-%m-%d') AND DATE_FORMAT(t2.enforcement_time,'%y-%m-%d') &lt;= DATE_FORMAT(#{bo.endTime},'%y-%m-%d')
</if> </if>
</where> </where>
group by group by
t2.bureau_dept_id t2.bureau_dept_id
) fxz on t1.dept_id = fxz.dept_id ) fxz on t1.dept_id = fxz.dept_id
<where> <where>
<if test="bo.domainId !=null and bo.domainId!=''"> <if test="bo.domainId !=null and bo.domainId!=''">
and t1.domain_id = #{bo.domainId} and t1.domain_id = #{bo.domainId}
</if> </if>
</where> </where>
) base ) base
order by order by
<choose> <choose>
<when test="bo.orderByColumn == 'xzzfCount'">xzzfCount</when> <when test="bo.orderByColumn == 'xzzfCount'">xzzfCount</when>
@ -489,5 +498,12 @@
<otherwise>xzzfslpm</otherwise> <otherwise>xzzfslpm</otherwise>
</choose> </choose>
<if test="bo.isAsc == 'desc'">desc</if> <if test="bo.isAsc == 'desc'">desc</if>
</sql>
<select id="selectScanDataSituationDomainDetailsPageList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo">
<include refid="selectScanDataSituationDomainDetailsSql"/>
</select>
<select id="selectScanDataSituationDomainDetailsList" resultType="com.zdxt.enforcementcode.domain.vo.ScanDataSituationVo">
<include refid="selectScanDataSituationDomainDetailsSql"/>
</select> </select>
</mapper> </mapper>

Loading…
Cancel
Save