|
@@ -22,7 +22,7 @@
|
|
<result column="is_lock" property="isLock"/>
|
|
<result column="is_lock" property="isLock"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
|
|
|
|
- <select id="list" resultMap="AlarmStatisticVoResult">
|
|
|
|
|
|
+ <select id="list" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticVoResult">
|
|
SELECT
|
|
SELECT
|
|
a.alarm_id ,
|
|
a.alarm_id ,
|
|
a.camera_code ,
|
|
a.camera_code ,
|
|
@@ -42,9 +42,8 @@
|
|
a.remark,
|
|
a.remark,
|
|
a.is_lock
|
|
a.is_lock
|
|
FROM
|
|
FROM
|
|
- msg_alarm AS a left join
|
|
|
|
|
|
+ msg_alarm AS a inner join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
- msg_web_push m on a.alarm_id = m.alarm_id left join
|
|
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
|
|
|
|
<where>
|
|
<where>
|
|
@@ -63,8 +62,22 @@
|
|
<if test="alarmType != null and alarmType != ''">
|
|
<if test="alarmType != null and alarmType != ''">
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
</if>
|
|
</if>
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
|
|
|
|
|
|
+ <if test="!dsFlay">
|
|
|
|
+ and
|
|
|
|
+ <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
|
+ <if test="dsUserId != null and dsUserId != ''">
|
|
|
|
+ or a.create_by=#{dsUserId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
|
+ or b.dept_id=#{dsDeptId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptIds != null">
|
|
|
|
+ or b.dept_id in
|
|
|
|
+ <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
group by a.alarm_id order by a.alarm_time desc
|
|
group by a.alarm_id order by a.alarm_time desc
|
|
@@ -90,7 +103,7 @@
|
|
<result column="remark" property="remark"/>
|
|
<result column="remark" property="remark"/>
|
|
<result column="isLock" property="isLock"/>
|
|
<result column="isLock" property="isLock"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
- <select id="listDto" resultMap="AlarmStatisticDtoResult">
|
|
|
|
|
|
+ <select id="listDto" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticDtoResult">
|
|
SELECT
|
|
SELECT
|
|
a.alarm_id AS alarmId,
|
|
a.alarm_id AS alarmId,
|
|
a.camera_code AS cameraCode,
|
|
a.camera_code AS cameraCode,
|
|
@@ -110,9 +123,8 @@
|
|
a.remark AS remark,
|
|
a.remark AS remark,
|
|
a.is_lock AS isLock
|
|
a.is_lock AS isLock
|
|
FROM
|
|
FROM
|
|
- msg_alarm AS a left join
|
|
|
|
|
|
+ msg_alarm AS a inner join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
- msg_web_push m on a.alarm_id = m.alarm_id left join
|
|
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
|
|
|
|
<where>
|
|
<where>
|
|
@@ -131,8 +143,22 @@
|
|
<if test="alarmType != null and alarmType != ''">
|
|
<if test="alarmType != null and alarmType != ''">
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
</if>
|
|
</if>
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
|
|
|
|
|
|
+ <if test="!dsFlay">
|
|
|
|
+ and
|
|
|
|
+ <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
|
+ <if test="dsUserId != null and dsUserId != ''">
|
|
|
|
+ or a.create_by=#{dsUserId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
|
+ or b.dept_id=#{dsDeptId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptIds != null">
|
|
|
|
+ or b.dept_id in
|
|
|
|
+ <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
group by a.alarm_id order by a.alarm_time desc
|
|
group by a.alarm_id order by a.alarm_time desc
|
|
@@ -144,7 +170,7 @@
|
|
<result column="frequency" property="frequency"/>
|
|
<result column="frequency" property="frequency"/>
|
|
<result column="alarm_type" property="alarmType"/>
|
|
<result column="alarm_type" property="alarmType"/>
|
|
</resultMap>
|
|
</resultMap>
|
|
- <select id="listDtoMonth" resultMap="AlarmStatisticMonthDtoResult">
|
|
|
|
|
|
+ <select id="listDtoMonth" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticMonthDtoResult">
|
|
SELECT p.monthsta as monthsta,sum(p.fre) as frequency,p.monthstaString as monthstaString
|
|
SELECT p.monthsta as monthsta,sum(p.fre) as frequency,p.monthstaString as monthstaString
|
|
from
|
|
from
|
|
(SELECT
|
|
(SELECT
|
|
@@ -152,9 +178,8 @@
|
|
MONTH(a.alarm_time) as monthsta,
|
|
MONTH(a.alarm_time) as monthsta,
|
|
count(DISTINCT a.alarm_id) as fre
|
|
count(DISTINCT a.alarm_id) as fre
|
|
FROM
|
|
FROM
|
|
- msg_alarm AS a left join
|
|
|
|
|
|
+ msg_alarm AS a inner join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
- msg_web_push m on a.alarm_id = m.alarm_id left join
|
|
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
|
|
|
|
<where>
|
|
<where>
|
|
@@ -173,14 +198,28 @@
|
|
<if test="alarmType != null and alarmType != ''">
|
|
<if test="alarmType != null and alarmType != ''">
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
</if>
|
|
</if>
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
|
|
|
|
|
|
+ <if test="!dsFlay">
|
|
|
|
+ and
|
|
|
|
+ <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
|
+ <if test="dsUserId != null and dsUserId != ''">
|
|
|
|
+ or a.create_by=#{dsUserId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
|
+ or b.dept_id=#{dsDeptId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptIds != null">
|
|
|
|
+ or b.dept_id in
|
|
|
|
+ <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
group by a.alarm_id) AS p group by p.monthsta order by p.monthsta
|
|
group by a.alarm_id) AS p group by p.monthsta order by p.monthsta
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <select id="listDtoDay" resultMap="AlarmStatisticMonthDtoResult">
|
|
|
|
|
|
+ <select id="listDtoDay" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticMonthDtoResult">
|
|
SELECT p.daysta as monthsta,sum(p.fre) as frequency,p.daystaString as monthstaString
|
|
SELECT p.daysta as monthsta,sum(p.fre) as frequency,p.daystaString as monthstaString
|
|
from
|
|
from
|
|
(SELECT
|
|
(SELECT
|
|
@@ -188,9 +227,8 @@
|
|
DAY(a.alarm_time) as daysta,
|
|
DAY(a.alarm_time) as daysta,
|
|
count(DISTINCT a.alarm_id) as fre
|
|
count(DISTINCT a.alarm_id) as fre
|
|
FROM
|
|
FROM
|
|
- msg_alarm AS a left join
|
|
|
|
|
|
+ msg_alarm AS a inner join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
- msg_web_push m on a.alarm_id = m.alarm_id left join
|
|
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
base_railway_management c on b.railway_code=c.railway_code
|
|
|
|
|
|
<where>
|
|
<where>
|
|
@@ -209,8 +247,22 @@
|
|
<if test="alarmType != null and alarmType != ''">
|
|
<if test="alarmType != null and alarmType != ''">
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
</if>
|
|
</if>
|
|
- <if test="userId != null and userId != ''">
|
|
|
|
- and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
|
|
|
|
|
|
+ <if test="!dsFlay">
|
|
|
|
+ and
|
|
|
|
+ <trim prefix="(" prefixOverrides="or" suffix=")">
|
|
|
|
+ <if test="dsUserId != null and dsUserId != ''">
|
|
|
|
+ or a.create_by=#{dsUserId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptId != null and dsDeptId != 0">
|
|
|
|
+ or b.dept_id=#{dsDeptId}
|
|
|
|
+ </if>
|
|
|
|
+ <if test="dsDeptIds != null">
|
|
|
|
+ or b.dept_id in
|
|
|
|
+ <foreach item="item" collection="dsDeptIds" separator="," open="(" close=")" index="">
|
|
|
|
+ #{item}
|
|
|
|
+ </foreach>
|
|
|
|
+ </if>
|
|
|
|
+ </trim>
|
|
</if>
|
|
</if>
|
|
</where>
|
|
</where>
|
|
group by a.alarm_id) AS p group by p.daysta order by p.daysta
|
|
group by a.alarm_id) AS p group by p.daysta order by p.daysta
|