|
@@ -78,57 +78,6 @@
|
|
|
group by a.alarm_id
|
|
|
</select>
|
|
|
|
|
|
- <select id="listMonth" resultMap="AlarmStatisticVoResult">
|
|
|
- SELECT
|
|
|
- a.alarm_id ,
|
|
|
- MONTH(a.alarm_time) as monthsta,
|
|
|
- count(DISTINCT a.alarm_id) as frequency,
|
|
|
- a.camera_code ,
|
|
|
- a.alarm_time ,
|
|
|
- a.alarm_mile ,
|
|
|
- a.content ,
|
|
|
- a.alarm_confidence,
|
|
|
- a.line_dir ,
|
|
|
- a.alarm_type ,
|
|
|
- a.alarm_attr ,
|
|
|
- a.image_url ,
|
|
|
- a.released_by ,
|
|
|
- a.released_time,
|
|
|
- a.is_lock ,
|
|
|
- b.railway_code AS railway_code,
|
|
|
- b.channel AS channel,
|
|
|
- b.install_mile AS install_mile,
|
|
|
- b.begin_mile AS begin_mile,
|
|
|
- b.end_mile AS end_mile,
|
|
|
- b.install_longitude AS install_longitude,
|
|
|
- b.install_latitude AS install_latitude
|
|
|
- FROM
|
|
|
- msg_alarm AS a 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
|
|
|
-
|
|
|
- <where>
|
|
|
- <if test="railwayCode != null and railwayCode != ''">
|
|
|
- and UPPER(b.railway_code) like UPPER(CONCAT('%',#{railwayCode},'%'))
|
|
|
- </if>
|
|
|
- <if test="startMonth != null and startMonth != 0">
|
|
|
- <![CDATA[and MONTH(a.alarm_time) >=#{startMonth}]]>
|
|
|
- </if>
|
|
|
- <if test="endMonth != null and endMonth != 0">
|
|
|
- <![CDATA[and MONTH(a.alarm_time) <=#{endMonth}]]>
|
|
|
- </if>
|
|
|
- <if test="alarmType != null and alarmType != ''">
|
|
|
- and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
|
- </if>
|
|
|
- <if test="userId != null and userId != ''">
|
|
|
- and UPPER(m.receive_by) like UPPER(CONCAT('%',#{userId},'%'))
|
|
|
- </if>
|
|
|
- and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
- </where>
|
|
|
- group by a.alarm_id,MONTH(a.alarm_time)
|
|
|
-
|
|
|
- </select>
|
|
|
-
|
|
|
<resultMap id="AlarmStatisticDtoResult" type="com.ozs.service.entity.vo.AlarmStatisticDto">
|
|
|
<id column="id" property="id"/>
|
|
|
<result column="alarmId" property="alarmId"/>
|
|
@@ -180,21 +129,16 @@
|
|
|
</select>
|
|
|
<resultMap id="AlarmStatisticMonthDtoResult" type="com.ozs.service.entity.vo.AlarmStatisticMonthDto">
|
|
|
<id column="id" property="id"/>
|
|
|
- <result column="alarmId" property="alarmId"/>
|
|
|
- <result column="railwayName" property="railwayName"/>
|
|
|
- <result column="alarmType" property="alarmType"/>
|
|
|
- <result column="alarmTime" property="alarmTime"/>
|
|
|
<result column="monthsta" property="monthsta"/>
|
|
|
<result column="frequency" property="frequency"/>
|
|
|
+ <result column="alarm_type" property="alarmType"/>
|
|
|
</resultMap>
|
|
|
<select id="listDtoMonth" resultMap="AlarmStatisticMonthDtoResult">
|
|
|
- SELECT
|
|
|
- a.alarm_id AS alarmId,
|
|
|
+ SELECT p.monthsta,SUM(p.fre) as frequency
|
|
|
+ from
|
|
|
+ (SELECT
|
|
|
MONTH(a.alarm_time) as monthsta,
|
|
|
- count(DISTINCT a.alarm_id) as frequency,
|
|
|
- a.alarm_type AS alarmType,
|
|
|
- a.alarm_time AS alarmTime,
|
|
|
- c.railway_name AS railwayName
|
|
|
+ count(DISTINCT a.alarm_id) as fre
|
|
|
FROM
|
|
|
msg_alarm AS a left join
|
|
|
base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
@@ -219,7 +163,7 @@
|
|
|
</if>
|
|
|
and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
</where>
|
|
|
- group by a.alarm_id,MONTH(a.alarm_time)
|
|
|
+ group by a.alarm_id,MONTH(a.alarm_time)) AS p
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCameraCode" parameterType="java.lang.String" resultType="java.util.Map">
|