|
@@ -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 <= #{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 <= #{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>
|
|
|
|