|
@@ -8,14 +8,17 @@
|
|
|
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,
|
|
|
+ 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,
|
|
|
+ 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,
|
|
|
+ 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,
|
|
@@ -37,7 +40,8 @@
|
|
|
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
|
|
|
+ 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>
|
|
@@ -50,12 +54,12 @@
|
|
|
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 =
|
|
|
+ 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
|
|
|
+ RIGHT JOIN ${onest_system}.sys_dict_data dict ON dict.dict_value = a.job_type
|
|
|
</if>
|
|
|
<where>
|
|
|
<if test="mark != null and mark == 'item'">
|
|
@@ -110,4 +114,29 @@
|
|
|
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>
|