Selaa lähdekoodia

Merge remote-tracking branch 'origin/master'

Memory_LG 8 kuukautta sitten
vanhempi
commit
9e55d8e3bc

+ 31 - 18
lawenforcement-ui/src/views/lawenforcement/case/index.vue

@@ -157,29 +157,36 @@
           <el-col :span="24">
             <el-col :span="8">
               <el-card style="height: 350px;">
-                <el-form-item prop="dataOne">
-                  <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+                <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+                <br>
+                <el-form-item label="附件" label-width="50px" prop="dataOne">
                   <fileUpload v-model="dataOne"></fileUpload>
                 </el-form-item>
-                <el-form-item label="说明" prop="describe">
-                  <el-input type="textarea" v-model="form.describe" placeholder="请输入案件描述" disabled/>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe1" disabled/>
                 </el-form-item>
               </el-card>
             </el-col>
             <el-col :span="8">
               <el-card style="height: 350px;">
-                <el-form-item prop="dataTwo">
-                  <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <el-form-item label="附件" label-width="50px" prop="dataTwo">
                   <fileUpload v-model="dataTwo"></fileUpload>
                 </el-form-item>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe2" disabled/>
+                </el-form-item>
               </el-card>
             </el-col>
             <el-col :span="8">
               <el-card style="height: 350px;">
-                <el-form-item prop="dataTwo">
-                  <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+                <el-form-item label="附件" label-width="50px" prop="dataTwo">
                   <fileUpload v-model="dataThree"></fileUpload>
                 </el-form-item>
+                <el-form-item label="说明" label-width="50px" prop="describe">
+                  <el-input type="textarea" v-model="describe3" disabled/>
+                </el-form-item>
               </el-card>
             </el-col>
           </el-col>
@@ -224,7 +231,7 @@
 
     <!--立案-->
     <el-dialog :visible.sync="dialogVisible" :title="title" width="1200px" class="form-style">
-      <register @send-ok="sendOk" ref="register"  :caseNumber = "caseName"/>
+      <register @send-ok="sendOk" ref="register" :caseNumber="caseName"/>
       <div slot="footer" class="dialog-footer">
         <el-button type="primary" @click="submitForm">确 定</el-button>
         <el-button @click="cancel">取 消</el-button>
@@ -239,6 +246,7 @@
 import {listCase, getCase, getCaseLog, updateCase, addCase} from "@/api/lawenforcement/case";
 import register from "@/views/lawenforcement/register/index.vue";
 import form from "element-ui/packages/form";
+import fileUpload from '@/views/components/FileUpload/index.vue';
 
 export default {
   name: "Case",
@@ -247,13 +255,16 @@ export default {
       return form
     }
   },
-  components: {register},
+  components: {register, fileUpload},
   dicts: ['lawenforcement_punish_target', 'lawenforcement_punish_type', 'lawenforcement_caseState'],
   data() {
     return {
-      dataOne:null,
-      dataTwo:null,
-      dataThree:null,
+      dataOne: null,
+      dataTwo: null,
+      dataThree: null,
+      describe1: null,
+      describe2: null,
+      describe3: null,
 
       // 遮罩层
       loading: true,
@@ -264,7 +275,7 @@ export default {
       single: true,
       // 非多个禁用
       multiple: true,
-      caseName:"",
+      caseName: "",
       // 显示搜索条件
       showSearch: true,
       // 总条数
@@ -333,7 +344,7 @@ export default {
     submitForm() {
       this.$refs.register.submitForm();
     },
-    sendOk(){
+    sendOk() {
       debugger
       this.dialogVisible = false;
       this.getList();
@@ -343,9 +354,6 @@ export default {
     getCaseLog(row) {
       this.form.deptId = this.$store.state.user.dept.deptId;
       this.form.id = row.id;
-      console.log(row)
-      console.log(this.$store.state.user.dept.deptId)
-      console.log(this.$store.state.user.dept.deptId)
       getCaseLog(this.form).then(response => {
         this.logNum = response.data;
       });
@@ -410,6 +418,11 @@ export default {
         this.form = response.data;
         this.logList = response.data.logList
         this.dataOne = response.data.fileList[0].attachPath
+        this.dataTwo = response.data.fileList[1].attachPath
+        this.dataThree = response.data.fileList[2].attachPath
+        this.describe1 = response.data.fileList[0].describe
+        this.describe2 = response.data.fileList[1].describe
+        this.describe3 = response.data.fileList[2].describe
         this.open = true;
         this.title = "案件详情";
       });

+ 10 - 9
lawenforcement-ui/src/views/lawenforcement/register/index.vue

@@ -52,36 +52,37 @@
         <el-col :span="24">
           <el-col :span="8">
             <el-card style="height: 350px;">
-              <el-form-item prop="dataOne">
-                <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+              <div class="form-item-title">1.法制审核机构出具的审核意见书</div>
+              <br>
+              <el-form-item label="附件" label-width="50px" prop="dataOne">
                 <fileUpload :fileType = "fileType" :limit = "1" v-model="form.dataOne" :setFileName="setDataOne"
                             :removeFileName="removeDataOne"></fileUpload>
               </el-form-item>
-              <el-form-item label="说明" prop="describeOne">
+              <el-form-item label="说明" label-width="50px" prop="describeOne">
                 <el-input type="textarea" v-model="form.describeOne" placeholder="请输入材料说明"/>
               </el-form-item>
             </el-card>
           </el-col>
           <el-col :span="8">
             <el-card style="height: 350px;">
-              <el-form-item prop="dataTwo">
-                <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <div class="form-item-title">2.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <el-form-item label="附件" label-width="50px" prop="dataTwo">
                 <fileUpload :fileType = "fileType" v-model="form.dataTwo" :setFileName="setDataTwo"
                             :removeFileName="removeDataTwo"></fileUpload>
               </el-form-item>
-              <el-form-item label="说明" prop="describeTwo">
+              <el-form-item label="说明" label-width="50px" prop="describeTwo">
                 <el-input type="textarea" v-model="form.describeTwo" placeholder="请输入材料说明"/>
               </el-form-item>
             </el-card>
           </el-col>
           <el-col :span="8">
             <el-card style="height: 350px;">
-              <el-form-item prop="dataThree">
-                <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <div class="form-item-title">3.落实行政处罚裁量基准和包容审慎监管执法“四张清单”相关材料</div>
+              <el-form-item label="附件" label-width="50px" prop="dataThree">
                 <fileUpload :fileType = "fileType" v-model="form.dataThree" :setFileName="setDataThree"
                             :removeFileName="removeDataThree"></fileUpload>
               </el-form-item>
-              <el-form-item label="说明" prop="describeThree">
+              <el-form-item label="说明" label-width="50px" prop="describeThree">
                 <el-input type="textarea" v-model="form.describeThree" placeholder="请输入材料说明"/>
               </el-form-item>
             </el-card>

+ 5 - 12
src/main/java/com/sooka/sponest/lawenforcement/lawCase/service/impl/LawenforcementCaseServiceImpl.java

@@ -54,18 +54,11 @@ public class LawenforcementCaseServiceImpl extends BaseService implements ILawen
         List<LawenforcementAttach> fileList = lawenforcementAttachMapper.selectLawenforcementAttachList(attach);
         for (LawenforcementAttach file : fileList) {
             StringBuilder newDiles = new StringBuilder();
-            String suffix = file.getAttachPath().substring(file.getAttachPath().lastIndexOf(".")+1);
-            if (suffix.equals("pdf")){
-                String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DataConstants.DOWNLOAD_URL).getData();
-                String filename = file.getFileName();
-                String group = file.getAttachPath().substring(0, file.getAttachPath().indexOf('/'));
-                newDiles.append(fileurl).append("Download?fileName=").append(filename).append("&&group=").append(group).append("&&path=").append(file.getAttachPath().substring(file.getAttachPath().indexOf('/') + 1)).append("+").append(filename);
-                file.setAttachPath(newDiles.toString());
-            }else {
-                String fileUrl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DataConstants.FILE_URL).getData();
-                newDiles.append(fileUrl).append(file.getAttachPath());
-                file.setAttachPath(newDiles.toString());
-            }
+            String fileurl = SpringUtils.getBean(RemoteConfigService.class).remotegetConfigKey(DataConstants.DOWNLOAD_URL).getData();
+            String filename = file.getFileName();
+            String group = file.getAttachPath().substring(0, file.getAttachPath().indexOf('/'));
+            newDiles.append(fileurl).append("Download?fileName=").append(filename).append("&&group=").append(group).append("&&path=").append(file.getAttachPath().substring(file.getAttachPath().indexOf('/') + 1)).append("+").append(filename);
+            file.setAttachPath(newDiles.toString());
         }
         lawenforcementCase.setLogList(logList);
         lawenforcementCase.setFileList(fileList);

+ 82 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/controller/LawenforcementViewController.java

@@ -0,0 +1,82 @@
+package com.sooka.sponest.lawenforcement.record.controller;
+
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONObject;
+import com.ruoyi.common.core.domain.R;
+import com.ruoyi.common.core.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.web.controller.BaseController;
+import com.ruoyi.common.log.annotation.Log;
+import com.ruoyi.common.log.enums.BusinessType;
+import com.sooka.sponest.lawenforcement.record.domain.bo.LawenforcementViewBO;
+import com.sooka.sponest.lawenforcement.record.domain.vo.LawenforcementViewDeptVO;
+import com.sooka.sponest.lawenforcement.record.domain.vo.LawenforcementViewItemVO;
+import com.sooka.sponest.lawenforcement.record.domain.vo.LawenforcementViewObjVO;
+import com.sooka.sponest.lawenforcement.record.domain.vo.LawenforcementViewPersonVO;
+import com.sooka.sponest.lawenforcement.record.service.ILawenforcementViewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import javax.servlet.http.HttpServletResponse;
+import java.util.List;
+import java.util.Map;
+
+import static com.ruoyi.common.core.utils.DateUtils.getLast30Days;
+import static com.ruoyi.common.core.utils.DateUtils.getLast6Months;
+
+/**
+ * 可视化Controller
+ *
+ * @author lyq
+ * @date 2024-10-15
+ */
+@RestController
+@RequestMapping("/view")
+public class LawenforcementViewController extends BaseController {
+
+    @Autowired
+    private ILawenforcementViewService lawenforcementViewService;
+
+    @GetMapping("/getRecordReport")
+    public R getRecordRpoort(LawenforcementViewBO lawenforcementViewBO) {
+        return R.ok(lawenforcementViewService.getRecordReport(lawenforcementViewBO));
+    }
+
+    /**
+     * 导出数据列表
+     */
+    @Log(title = "执法数据统计", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, LawenforcementViewBO lawenforcementViewBO) {
+        List<Map<String, Object>> list = lawenforcementViewService.getRecordReport(lawenforcementViewBO);
+        if ("dept".equals(lawenforcementViewBO.getMark())) {
+            ExcelUtil<LawenforcementViewDeptVO> util = new ExcelUtil<>(LawenforcementViewDeptVO.class);
+            util.exportExcel(response, JSONObject.parseArray(JSON.toJSONString(list), LawenforcementViewDeptVO.class), "执法单位统计");
+        }
+        if ("person".equals(lawenforcementViewBO.getMark())) {
+            ExcelUtil<LawenforcementViewPersonVO> util = new ExcelUtil<>(LawenforcementViewPersonVO.class);
+            util.exportExcel(response, JSONObject.parseArray(JSON.toJSONString(list), LawenforcementViewPersonVO.class), "执法人员统计");
+        }
+        if ("obj".equals(lawenforcementViewBO.getMark())) {
+            ExcelUtil<LawenforcementViewObjVO> util = new ExcelUtil<>(LawenforcementViewObjVO.class);
+            util.exportExcel(response, JSONObject.parseArray(JSON.toJSONString(list), LawenforcementViewObjVO.class), "检查对象统计");
+        }
+        if ("item".equals(lawenforcementViewBO.getMark())) {
+            ExcelUtil<LawenforcementViewItemVO> util = new ExcelUtil<>(LawenforcementViewItemVO.class);
+            util.exportExcel(response, JSONObject.parseArray(JSON.toJSONString(list), LawenforcementViewItemVO.class), "任务类型统计");
+        }
+    }
+
+    @GetMapping("/getRecordYearMonth")
+    public R getRecordYearMonth(LawenforcementViewBO lawenforcementViewBO) {
+        if ("dept".equals(lawenforcementViewBO.getMark())) {
+            lawenforcementViewBO.setDates(getLast6Months());
+        }
+        if ("person".equals(lawenforcementViewBO.getMark())) {
+            lawenforcementViewBO.setDates(getLast30Days());
+        }
+        return R.ok(lawenforcementViewService.getRecordYearMonth(lawenforcementViewBO));
+    }
+}

+ 32 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/bo/LawenforcementViewBO.java

@@ -0,0 +1,32 @@
+package com.sooka.sponest.lawenforcement.record.domain.bo;
+
+import com.ruoyi.common.datascope.base.domain.BaseBusinessEntity;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class LawenforcementViewBO extends BaseBusinessEntity {
+
+    private String mark;// dept、person、obj、item
+
+    private String deptName;// 执法单位
+
+    private String personName;// 执法人员
+
+    private String objName;// 检查对象名称
+
+    private String objCode;// 检查对象代码
+
+    private String objPhone;// 检查对象电话
+
+    private String objType;// 检查对象类型lawenforcement_objType
+
+    private String jobType;// 任务类型lawenforcement_jobType
+
+    private String startDate;// 开始日期
+
+    private String endDate;// 结束日期
+
+    private List<String> dates;
+}

+ 29 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewDeptVO.java

@@ -0,0 +1,29 @@
+package com.sooka.sponest.lawenforcement.record.domain.vo;
+
+import com.ruoyi.common.core.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class LawenforcementViewDeptVO {
+
+    @Excel(name = "执法单位名称")
+    private String deptName;
+
+    @Excel(name = "执法总数")
+    private String total;
+
+    @Excel(name = "执法进行数")
+    private String ing;
+
+    @Excel(name = "预警频次")
+    private String yujing;
+
+    @Excel(name = "二次执法数")
+    private String two;
+
+    @Excel(name = "立案数")
+    private String lian;
+
+    @Excel(name = "案-件比")
+    private String caseload;
+}

+ 26 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewItemVO.java

@@ -0,0 +1,26 @@
+package com.sooka.sponest.lawenforcement.record.domain.vo;
+
+import com.ruoyi.common.core.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class LawenforcementViewItemVO {
+
+    @Excel(name = "任务类型")
+    private String jobType;
+
+    @Excel(name = "执法部门数")
+    private String dept;
+
+    @Excel(name = "检查对象数")
+    private String obj;
+
+    @Excel(name = "检查子项数量")
+    private String sub;
+
+    @Excel(name = "立案数")
+    private String lian;
+
+    @Excel(name = "案-件比")
+    private String caseload;
+}

+ 35 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewObjVO.java

@@ -0,0 +1,35 @@
+package com.sooka.sponest.lawenforcement.record.domain.vo;
+
+import com.ruoyi.common.core.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class LawenforcementViewObjVO {
+
+    @Excel(name = "检查对象名称")
+    private String objName;
+
+    @Excel(name = "检查对象代码")
+    private String objCode;
+
+    @Excel(name = "检查对象联系电话")
+    private String objPhone;
+
+    @Excel(name = "检查对象类型")
+    private String objType;
+
+    @Excel(name = "检查频次")
+    private String total;
+
+    @Excel(name = "立案数")
+    private String lian;
+
+    @Excel(name = "案-件比")
+    private String caseload;
+
+    @Excel(name = "检查子项数量")
+    private String sub;
+
+    @Excel(name = "检查好评占比")
+    private String haoping;
+}

+ 26 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewPersonVO.java

@@ -0,0 +1,26 @@
+package com.sooka.sponest.lawenforcement.record.domain.vo;
+
+import com.ruoyi.common.core.annotation.Excel;
+import lombok.Data;
+
+@Data
+public class LawenforcementViewPersonVO {
+
+    @Excel(name = "执法人员所在部门")
+    private String deptName;
+
+    @Excel(name = "执法人员名称")
+    private String personName;
+
+    @Excel(name = "执法总数")
+    private String total;
+
+    @Excel(name = "二次执法数")
+    private String two;
+
+    @Excel(name = "立案数")
+    private String lian;
+
+    @Excel(name = "案-件比")
+    private String caseload;
+}

+ 19 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/mapper/LawenforcementViewMapper.java

@@ -0,0 +1,19 @@
+package com.sooka.sponest.lawenforcement.record.mapper;
+
+import com.sooka.sponest.lawenforcement.record.domain.bo.LawenforcementViewBO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 可视化Mapper接口
+ *
+ * @author lyq
+ * @date 2024-10-15
+ */
+public interface LawenforcementViewMapper {
+
+    List<Map<String, Object>> getRecordReport(LawenforcementViewBO lawenforcementViewBO);
+
+    List<Map<String, Object>> getRecordYearMonth(LawenforcementViewBO lawenforcementViewBO);
+}

+ 19 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/service/ILawenforcementViewService.java

@@ -0,0 +1,19 @@
+package com.sooka.sponest.lawenforcement.record.service;
+
+import com.sooka.sponest.lawenforcement.record.domain.bo.LawenforcementViewBO;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 可视化Service接口
+ *
+ * @author lyq
+ * @date 2024-10-15
+ */
+public interface ILawenforcementViewService {
+
+    List<Map<String, Object>> getRecordReport(LawenforcementViewBO lawenforcementViewBO);
+
+    List<Map<String, Object>> getRecordYearMonth(LawenforcementViewBO lawenforcementViewBO);
+}

+ 36 - 0
src/main/java/com/sooka/sponest/lawenforcement/record/service/impl/LawenforcementViewServiceImpl.java

@@ -0,0 +1,36 @@
+package com.sooka.sponest.lawenforcement.record.service.impl;
+
+import com.ruoyi.common.datascope.base.service.BaseService;
+import com.sooka.sponest.lawenforcement.record.domain.bo.LawenforcementViewBO;
+import com.sooka.sponest.lawenforcement.record.mapper.LawenforcementViewMapper;
+import com.sooka.sponest.lawenforcement.record.service.ILawenforcementViewService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 可视化Service业务层处理
+ *
+ * @author lyq
+ * @date 2024-10-15
+ */
+@Service
+public class LawenforcementViewServiceImpl extends BaseService implements ILawenforcementViewService {
+
+    @Autowired
+    private LawenforcementViewMapper lawenforcementViewMapper;
+
+    @Override
+    public List<Map<String, Object>> getRecordReport(LawenforcementViewBO lawenforcementViewBO) {
+        setSookaDataBase(lawenforcementViewBO);
+        return lawenforcementViewMapper.getRecordReport(lawenforcementViewBO);
+    }
+
+    @Override
+    public List<Map<String, Object>> getRecordYearMonth(LawenforcementViewBO lawenforcementViewBO) {
+        setSookaDataBase(lawenforcementViewBO);
+        return lawenforcementViewMapper.getRecordYearMonth(lawenforcementViewBO);
+    }
+}

+ 142 - 0
src/main/resources/mapper/lawenforcement/LawenforcementViewMapper.xml

@@ -0,0 +1,142 @@
+<?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.sooka.sponest.lawenforcement.record.mapper.LawenforcementViewMapper">
+
+    <select id="getRecordReport" parameterType="LawenforcementViewBO" resultType="map">
+        SELECT
+        <if test="mark != null and mark == 'dept'">
+            a.dept_name deptName,
+            count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4', 'lawenforcement_type_6') OR NULL)
+            ing,
+            IFNULL(yujing, 0) yujing,
+            count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4', 'lawenforcement_type_5') OR NULL)
+            two,
+        </if>
+        <if test="mark != null and mark == 'person'">
+            p.dept_name deptName,
+            p.person_name personName,
+            count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4', 'lawenforcement_type_5') OR NULL)
+            two,
+        </if>
+        <if test="mark != null and mark == 'obj'">
+            check_object_name objName,
+            check_object_code objCode,
+            check_object_phone objPhone,
+            dict_label objType,
+            IFNULL(SUM(subitem_count), 0) sub,
+            concat(ROUND(IFNULL(count(evaluation = 1 OR NULL) / count(*), 0) * 100, 2), '%') haoping,
+        </if>
+        <if test="mark != null and mark == 'item'">
+            dict_label dictLabel,
+            count(DISTINCT a.dept_name) dept,
+            count(DISTINCT check_object_name) obj,
+            IFNULL(SUM(subitem_count), 0) sub,
+        </if>
+        count(*) total,
+        count(c.record_id) lian,
+        concat(ROUND(IFNULL(c.record_id / count(*), 0) * 100, 2), '%') caseload
+        FROM lawenforcement_record a
+        <if test="mark != null and mark == 'dept'">
+            LEFT JOIN (
+            SELECT dept_name, count(*) yujing FROM ${onest_event}.centerevent_t_eventcatalogue WHERE event_type_xl =
+            1301
+            <if test="startDate != null and startDate != ''">
+                AND create_time >= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND create_time &lt;= #{endDate}
+            </if>
+            GROUP BY dept_name) e ON e.dept_name = a.dept_name
+        </if>
+        <if test="mark != null and mark == 'person'">
+            LEFT JOIN lawenforcement_person p ON p.record_id = a.id AND main_person = 1
+        </if>
+        <if test="mark != null and mark == 'obj'">
+            LEFT JOIN ${onest_system}.sys_dict_data dict ON dict.dict_value = a.job_type AND dict_type =
+            'lawenforcement_objType'
+        </if>
+        LEFT JOIN lawenforcement_case c ON c.record_id = a.id
+        <if test="mark != null and mark == 'item'">
+            RIGHT JOIN ${onest_system}.sys_dict_data dict ON dict.dict_value = a.job_type
+        </if>
+        <where>
+            <if test="mark != null and mark == 'item'">
+                AND dict_type = 'lawenforcement_jobType'
+            </if>
+            <if test="deptName != null and deptName != ''">
+                AND a.dept_name LIKE CONCAT('%', #{deptName}, '%')
+            </if>
+            <if test="personName != null and personName != ''">
+                AND p.person_name LIKE CONCAT('%', #{personName}, '%')
+            </if>
+            <if test="objName != null and objName != ''">
+                AND check_object_name LIKE CONCAT('%', #{objName}, '%')
+            </if>
+            <if test="objCode != null and objCode != ''">
+                AND check_object_code LIKE CONCAT('%', #{objCode}, '%')
+            </if>
+            <if test="objPhone != null and objPhone != ''">
+                AND check_object_phone LIKE CONCAT('%', #{objPhone}, '%')
+            </if>
+            <if test="objType != null and objType != ''">
+                AND check_object_type = #{objType}
+            </if>
+            <if test="jobType != null and jobType != ''">
+                AND job_type = #{jobType}
+            </if>
+            <if test="startDate != null and startDate != ''">
+                AND check_start_time >= #{startDate}
+            </if>
+            <if test="endDate != null and endDate != ''">
+                AND check_end_time &lt;= #{endDate}
+            </if>
+        </where>
+        GROUP BY
+        <if test="mark != null and mark == 'dept'">
+            deptName
+        </if>
+        <if test="mark != null and mark == 'person'">
+            deptName,personName
+        </if>
+        <if test="mark != null and mark == 'obj'">
+            objName,objCode,objPhone,objType
+        </if>
+        <if test="mark != null and mark == 'item'">
+            dictLabel
+        </if>
+        WITH ROLLUP
+        <if test="mark != null and mark == 'person'">
+            HAVING deptName IS NULL OR personName IS NOT NULL
+        </if>
+        <if test="mark != null and mark == 'obj'">
+            HAVING objName IS NULL OR objType IS NOT NULL
+        </if>
+    </select>
+
+    <select id="getRecordYearMonth" parameterType="LawenforcementViewBO" resultType="map">
+        SELECT a.d, IFNULL(r.total, 0) total, IFNULL(c.lian, 0) lian, IFNULL(e.yujing, 0) yujing FROM (
+        <foreach item="date" collection="dates" open="select" separator="union" close="">
+            #{date} d
+        </foreach>) a
+        LEFT JOIN (
+        SELECT DATE_FORMAT( FROM_UNIXTIME( SUBSTR( check_start_time, 1, 10 ) ),
+        <if test="mark != null and mark == 'dept'">'%Y-%m'</if>
+        <if test="mark != null and mark == 'person'">'%Y-%m-%d'</if>) d, count(*) total,
+        count(DISTINCT check_object_name) obj
+        FROM lawenforcement_record GROUP BY d) r ON r.d = a.d
+        LEFT JOIN (
+        SELECT DATE_FORMAT( create_time,
+        <if test="mark != null and mark == 'dept'">'%Y-%m'</if>
+        <if test="mark != null and mark == 'person">'%Y-%m-%d'</if>) d, count(*) lian
+        FROM lawenforcement_case GROUP BY d) c ON c.d = a.d
+        <if test="mark != null and mark == 'dept'">
+            LEFT JOIN (
+            SELECT DATE_FORMAT( create_time,
+            <if test="mark != null and mark == 'dept'">'%Y-%m'</if>
+            <if test="mark != null and mark == 'person'">'%Y-%m-%d'</if>) d, count(*) yujing
+            FROM ${onest_event}.centerevent_t_eventcatalogue WHERE event_type_xl = 1301 GROUP BY d) e ON e.d = a.d
+        </if>
+    </select>
+</mapper>