Ver código fonte

统计分析

lyq 9 meses atrás
pai
commit
e85c996115

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

@@ -22,7 +22,7 @@ public class LawenforcementViewBO extends BaseBusinessEntity {
 
     private String objType;// 检查对象类型lawenforcement_objType
 
-    private String jobType;// 任务类型lawenforcement_jobType
+    private String subitemName;// 事务类型
 
     private String startDate;// 开始日期
 

+ 11 - 8
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewDeptVO.java

@@ -9,21 +9,24 @@ public class LawenforcementViewDeptVO {
     @Excel(name = "执法单位名称")
     private String deptName;
 
-    @Excel(name = "执法总数")
+    @Excel(name = "备案数")
     private String total;
 
-    @Excel(name = "执法进行数")
-    private String ing;
+    @Excel(name = "人员数")
+    private String person;
+
+    @Excel(name = "延续执法数")
+    private String two;
+
+    @Excel(name = "已执法数")
+    private String inged;
 
     @Excel(name = "预警频次")
     private String yujing;
 
-    @Excel(name = "二次执法数")
-    private String two;
-
     @Excel(name = "立案数")
     private String lian;
 
-    @Excel(name = "案-件比")
-    private String caseload;
+    @Excel(name = "案件转化率")
+    private String converRate;
 }

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

@@ -6,21 +6,21 @@ import lombok.Data;
 @Data
 public class LawenforcementViewItemVO {
 
-    @Excel(name = "务类型")
-    private String jobType;
+    @Excel(name = "务类型")
+    private String subitemName;
 
-    @Excel(name = "执法部门数")
-    private String dept;
+    @Excel(name = "执法数")
+    private String total;
 
-    @Excel(name = "检查对象数")
-    private String obj;
+    @Excel(name = "延续执法")
+    private String two;
 
-    @Excel(name = "检查子项数量")
-    private String sub;
+    @Excel(name = "延续执法转化率")
+    private String twoRate;
 
     @Excel(name = "立案数")
     private String lian;
 
-    @Excel(name = "案-件比")
-    private String caseload;
+    @Excel(name = "案件转化率")
+    private String converRate;
 }

+ 4 - 10
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewObjVO.java

@@ -12,20 +12,14 @@ public class LawenforcementViewObjVO {
     @Excel(name = "检查对象代码")
     private String objCode;
 
-    @Excel(name = "检查对象联系电话")
-    private String objPhone;
-
-    @Excel(name = "检查对象类型")
-    private String objType;
-
-    @Excel(name = "检查频次")
+    @Excel(name = "检查次数")
     private String total;
 
-    @Excel(name = "立案数")
+    @Excel(name = "立案次数")
     private String lian;
 
-    @Excel(name = "案-件比")
-    private String caseload;
+    @Excel(name = "案件转化率")
+    private String converRate;
 
     @Excel(name = "检查子项数量")
     private String sub;

+ 9 - 6
src/main/java/com/sooka/sponest/lawenforcement/record/domain/vo/LawenforcementViewPersonVO.java

@@ -6,21 +6,24 @@ import lombok.Data;
 @Data
 public class LawenforcementViewPersonVO {
 
-    @Excel(name = "执法人员所在部门")
+    @Excel(name = "部门名称")
     private String deptName;
 
     @Excel(name = "执法人员名称")
     private String personName;
 
-    @Excel(name = "执法总数")
-    private String total;
+    @Excel(name = "编号")
+    private String personCode;
 
-    @Excel(name = "二次执法数")
+    @Excel(name = "执法完成")
+    private String ed;
+
+    @Excel(name = "延续执法")
     private String two;
 
     @Excel(name = "立案数")
     private String lian;
 
-    @Excel(name = "案-件比")
-    private String caseload;
+    @Excel(name = "案件转化率")
+    private String converRate;
 }

+ 38 - 46
src/main/resources/mapper/lawenforcement/LawenforcementViewMapper.xml

@@ -8,83 +8,82 @@
         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,
+            person,
             count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4', 'lawenforcement_type_5') OR NULL)
             two,
+            count(record_status != 'lawenforcement_type_1' OR NULL) inged,
+            IFNULL(yujing, 0) yujing,
         </if>
         <if test="mark != null and mark == 'person'">
             p.dept_name deptName,
             p.person_name personName,
+            p.person_code personCode,
+            count(record_status IN ('lawenforcement_type_2', 'lawenforcement_type_5') OR NULL) ed,
             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,
+            subitem_name subitemName,
+            count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4', 'lawenforcement_type_5') OR NULL)
+            two,
+            concat(ROUND(IFNULL(count(record_status IN ('lawenforcement_type_3', 'lawenforcement_type_4',
+            'lawenforcement_type_5') OR NULL) / count(*), 0) * 100, 2), '%') twoRate,
         </if>
         count(*) total,
         count(c.record_id) lian,
-        concat(ROUND(IFNULL(c.record_id / count(*), 0) * 100, 2), '%') caseload
+        concat(ROUND(IFNULL(count(c.record_id) / count(*), 0) * 100, 2), '%') converRate
         FROM lawenforcement_record a
+        LEFT JOIN lawenforcement_case c ON c.record_id = a.id
         <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>
+            SELECT dept_name, count(DISTINCT person_code) person FROM lawenforcement_person
+            GROUP BY dept_name) p ON p.dept_name = a.dept_name
+            LEFT JOIN (
+            SELECT dept_name, count(*) yujing FROM ${onest_event}.centerevent_t_eventcatalogue
+            <where>
+                event_type_xl = 1301
+                <if test="deptName != null and deptName != ''">
+                    AND dept_name LIKE CONCAT('%', #{deptName}, '%')
+                </if>
+                <if test="startDate != null and startDate != ''">
+                    AND create_time >= #{startDate}
+                </if>
+                <if test="endDate != null and endDate != ''">
+                    AND create_time &lt;= #{endDate}
+                </if>
+            </where>
             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
+            LEFT JOIN lawenforcement_subitem s ON s.record_id = a.id
         </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="personCode != null and personCode != ''">
+                AND p.person_code LIKE CONCAT('%', #{personCode}, '%')
+            </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 test="subitemName != null and subitemName != ''">
+                AND subitem_name LIKE CONCAT('%', #{subitemName}, '%')
             </if>
             <if test="startDate != null and startDate != ''">
                 AND check_start_time >= #{startDate}
@@ -95,23 +94,16 @@
         </where>
         GROUP BY
         <if test="mark != null and mark == 'dept'">
-            deptName
+            a.dept_name
         </if>
         <if test="mark != null and mark == 'person'">
-            deptName,personName
+            p.person_code
         </if>
         <if test="mark != null and mark == 'obj'">
-            objName,objCode,objPhone,objType
+            check_object_name
         </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
+            subitem_code
         </if>
     </select>