|
@@ -0,0 +1,557 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.ozs.service.mapper.MsgAlarmCloudMapper">
|
|
|
+ <resultMap id="AlarmStatisticVoResult" type="com.ozs.service.entity.vo.AlarmStatisticVo">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="alarm_id" property="alarmId"/>
|
|
|
+ <result column="railway_name" property="railwayName"/>
|
|
|
+ <result column="camera_code" property="cameraCode"/>
|
|
|
+ <result column="alarm_time" property="alarmTime"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ <result column="released_reason" property="releasedReason"/>
|
|
|
+ <result column="released_type" property="releasedType"/>
|
|
|
+ <result column="alarm_mile" property="alarmMile"/>
|
|
|
+ <result column="content" property="content"/>
|
|
|
+ <result column="alarm_confidence" property="alarmConfidence"/>
|
|
|
+ <result column="line_dir" property="lineDir"/>
|
|
|
+ <result column="alarm_type" property="alarmType"/>
|
|
|
+ <result column="alarm_attr" property="alarmAttr"/>
|
|
|
+ <result column="image_url" property="imageUrl"/>
|
|
|
+ <result column="released_by" property="releasedBy"/>
|
|
|
+ <result column="released_time" property="releasedTime"/>
|
|
|
+ <result column="is_lock" property="isLock"/>
|
|
|
+ </resultMap>
|
|
|
+
|
|
|
+ <select id="list" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticVoResult">
|
|
|
+ SELECT
|
|
|
+ a.alarm_id ,
|
|
|
+ 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.released_reason,
|
|
|
+ a.released_type,
|
|
|
+ c.railway_name,
|
|
|
+ a.remark,
|
|
|
+ a.is_lock
|
|
|
+ FROM
|
|
|
+ msg_alarm_cloud AS a inner join
|
|
|
+ base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
|
+ base_railway_management c on b.railway_code=c.railway_code
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ and UPPER(b.railway_code) like UPPER(CONCAT('%',#{railwayCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear != null and currentYear != 0">
|
|
|
+ and YEAR(a.alarm_time) like UPPER(CONCAT('%',#{currentYear},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear == null or currentYear == ''">
|
|
|
+ and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
+ </if>
|
|
|
+ <if test="currentMonth != null and currentMonth != 0">
|
|
|
+ and MONTH(a.alarm_time) =#{currentMonth}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ group by a.alarm_id order by a.alarm_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <resultMap id="AlarmStatisticDtoResult" type="com.ozs.service.entity.vo.AlarmStatisticDto">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="alarmId" property="alarmId"/>
|
|
|
+ <result column="cameraCode" property="cameraCode"/>
|
|
|
+ <result column="alarmTime" property="alarmTime"/>
|
|
|
+ <result column="alarmMile" property="alarmMile"/>
|
|
|
+ <result column="content" property="content"/>
|
|
|
+ <result column="alarmConfidence" property="alarmConfidence"/>
|
|
|
+ <result column="lineDir" property="lineDir"/>
|
|
|
+ <result column="alarmType" property="alarmType"/>
|
|
|
+ <result column="alarmAttr" property="alarmAttr"/>
|
|
|
+ <result column="imageUrl" property="imageUrl"/>
|
|
|
+ <result column="releasedBy" property="releasedBy"/>
|
|
|
+ <result column="releasedTime" property="releasedTime"/>
|
|
|
+ <result column="releasedReason" property="releasedReason"/>
|
|
|
+ <result column="releasedType" property="releasedType"/>
|
|
|
+ <result column="railwayName" property="railwayName"/>
|
|
|
+ <result column="remark" property="remark"/>
|
|
|
+ <result column="isLock" property="isLock"/>
|
|
|
+ </resultMap>
|
|
|
+ <select id="listDto" parameterType="com.ozs.service.entity.vo.AlarmStatisticResVo" resultMap="AlarmStatisticDtoResult">
|
|
|
+ SELECT
|
|
|
+ a.alarm_id AS alarmId,
|
|
|
+ a.camera_code AS cameraCode,
|
|
|
+ a.alarm_time AS alarmTime,
|
|
|
+ a.alarm_mile AS alarmMile,
|
|
|
+ a.content AS content,
|
|
|
+ a.alarm_confidence AS alarmConfidence,
|
|
|
+ a.line_dir AS lineDir,
|
|
|
+ a.alarm_type AS alarmType,
|
|
|
+ a.alarm_attr AS alarmAttr,
|
|
|
+ a.image_url AS imageUrl,
|
|
|
+ a.released_by AS releasedBy,
|
|
|
+ a.released_time AS releasedTime,
|
|
|
+ a.released_reason AS releasedReason,
|
|
|
+ a.released_type AS releasedType,
|
|
|
+ c.railway_name AS railwayName,
|
|
|
+ a.remark AS remark,
|
|
|
+ a.is_lock AS isLock
|
|
|
+ FROM
|
|
|
+ msg_alarm_cloud AS a inner join
|
|
|
+ base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
|
+ base_railway_management c on b.railway_code=c.railway_code
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ and UPPER(b.railway_code) like UPPER(CONCAT('%',#{railwayCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear != null and currentYear != 0">
|
|
|
+ and YEAR(a.alarm_time) like UPPER(CONCAT('%',#{currentYear},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear == null or currentYear == ''">
|
|
|
+ and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
+ </if>
|
|
|
+ <if test="currentMonth != null and currentMonth != 0">
|
|
|
+ and MONTH(a.alarm_time) =#{currentMonth}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="ids != null and ids.size>0">
|
|
|
+ and a.id in
|
|
|
+ <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
|
|
|
+ #{items}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ group by a.alarm_id order by a.alarm_time desc
|
|
|
+ </select>
|
|
|
+ <resultMap id="AlarmStatisticMonthDtoResult" type="com.ozs.service.entity.vo.AlarmStatisticMonthDto">
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="monthsta" property="monthsta"/>
|
|
|
+ <result column="monthstaString" property="monthstaString"/>
|
|
|
+ <result column="frequency" property="frequency"/>
|
|
|
+ <result column="alarm_type" property="alarmType"/>
|
|
|
+ </resultMap>
|
|
|
+ <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
|
|
|
+ from
|
|
|
+ (SELECT
|
|
|
+ DATE_FORMAT(a.alarm_time,'%Y年%m月') as monthstaString,
|
|
|
+ MONTH(a.alarm_time) as monthsta,
|
|
|
+ count(DISTINCT a.alarm_id) as fre
|
|
|
+ FROM
|
|
|
+ msg_alarm_cloud AS a inner join
|
|
|
+ base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
|
+ base_railway_management c on b.railway_code=c.railway_code
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ and UPPER(b.railway_code) like UPPER(CONCAT('%',#{railwayCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear != null and currentYear != 0">
|
|
|
+ and YEAR(a.alarm_time) like UPPER(CONCAT('%',#{currentYear},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear == null or currentYear == ''">
|
|
|
+ and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
+ </if>
|
|
|
+ <if test="currentMonth != null and currentMonth != 0">
|
|
|
+ and MONTH(a.alarm_time) =#{currentMonth}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ group by a.alarm_id) AS p group by p.monthsta order by p.monthsta
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <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
|
|
|
+ from
|
|
|
+ (SELECT
|
|
|
+ DATE_FORMAT(a.alarm_time,'%Y年%m月%d日') as daystaString,
|
|
|
+ DAY(a.alarm_time) as daysta,
|
|
|
+ count(DISTINCT a.alarm_id) as fre
|
|
|
+ FROM
|
|
|
+ msg_alarm_cloud AS a inner join
|
|
|
+ base_camera_management AS b on a.camera_code=b.camera_code left join
|
|
|
+ base_railway_management c on b.railway_code=c.railway_code
|
|
|
+
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ and UPPER(b.railway_code) like UPPER(CONCAT('%',#{railwayCode},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear != null and currentYear != 0">
|
|
|
+ and YEAR(a.alarm_time) like UPPER(CONCAT('%',#{currentYear},'%'))
|
|
|
+ </if>
|
|
|
+ <if test="currentYear == null or currentYear == ''">
|
|
|
+ and YEAR(a.alarm_time) = YEAR(SYSDATE())
|
|
|
+ </if>
|
|
|
+ <if test="currentMonth != null and currentMonth != 0">
|
|
|
+ and MONTH(a.alarm_time) =#{currentMonth}
|
|
|
+ </if>
|
|
|
+ <if test="alarmType != null and alarmType != ''">
|
|
|
+ and UPPER(a.alarm_type) like UPPER(CONCAT('%',#{alarmType},'%'))
|
|
|
+ </if>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ group by a.alarm_id) AS p group by p.daysta order by p.daysta
|
|
|
+ </select>
|
|
|
+ <select id="selectCameraCode" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
+ select is_lock
|
|
|
+ from msg_alarm_cloud
|
|
|
+ where camera_code = #{cameraCode}
|
|
|
+ ORDER BY alarm_time DESC LIMIT 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectByCameraCode" parameterType="java.lang.String" resultType="com.ozs.service.entity.MsgAlarmCloud">
|
|
|
+ select *
|
|
|
+ from msg_alarm_cloud
|
|
|
+ where camera_code = #{cameraCode}
|
|
|
+ order by alarm_time desc limit 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMsgAlarmListHome" resultType="com.ozs.service.entity.MsgAlarmCloud"
|
|
|
+ parameterType="com.ozs.service.entity.vo.MsgAlarmVo">
|
|
|
+ SELECT
|
|
|
+ a.alarm_id AS alarmId,
|
|
|
+ a.alarm_time AS alarmTime,
|
|
|
+ a.alarm_mile AS alarmMile,
|
|
|
+ a.line_dir AS lineDir,
|
|
|
+ a.alarm_type AS alarmType,
|
|
|
+ a.camera_code AS cameraCode,
|
|
|
+ a.id AS id,
|
|
|
+ a.content AS content,
|
|
|
+ a.alarm_confidence AS alarmConfidence,
|
|
|
+ a.alarm_attr AS alarmAttr,
|
|
|
+ a.image_url AS imageUrl,
|
|
|
+ a.released_by AS releasedBy,
|
|
|
+ a.is_lock AS isLock,
|
|
|
+ a.released_time AS releasedTime,
|
|
|
+ a.released_type AS releasedType,
|
|
|
+ a.released_reason AS releasedReason,
|
|
|
+ a.remark AS remark
|
|
|
+ FROM msg_alarm_cloud AS a
|
|
|
+ join base_camera_management AS b on a.camera_code=b.camera_code
|
|
|
+ join base_railway_management AS l on b.railway_code=l.railway_code
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ concat(l.railway_name,l.railway_code)
|
|
|
+ like concat("%",#{railwayCode},"%")
|
|
|
+ </if>
|
|
|
+ <if test="beginMile != null and beginMile != 0">
|
|
|
+ and b.begin_mile >=#{beginMile}
|
|
|
+ </if>
|
|
|
+ <if test="endMile != null and endMile != 0">
|
|
|
+ and b.end_mile <=#{endMile}
|
|
|
+ </if>
|
|
|
+ <if test="ids != null and ids.size>0">
|
|
|
+ and a.id in
|
|
|
+ <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
|
|
|
+ #{items}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <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 test="alarmType != null and alarmType != 0">
|
|
|
+ and a.alarm_type=#{alarmType}
|
|
|
+ </if>
|
|
|
+ <if test="alarmMile != null and alarmMile != 0">
|
|
|
+ and a.alarm_mile=#{alarmMile}
|
|
|
+ </if>
|
|
|
+ <if test="isLock != null and isLock != 0">
|
|
|
+ and a.is_lock=#{isLock}
|
|
|
+ </if>
|
|
|
+ <if test="lineDir != null and lineDir != 0">
|
|
|
+ and a.line_dir =#{lineDir}
|
|
|
+ </if>
|
|
|
+ <if test="releasedType != null and releasedType != 0">
|
|
|
+ and a.released_type =#{releasedType}
|
|
|
+ </if>
|
|
|
+ <if test="beginAlarmTime != null and beginAlarmTime != ''">
|
|
|
+ and date_format(a.alarm_time,'%Y-%m-%d') >= date_format(#{beginAlarmTime},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="endAlarmTime != null and endAlarmTime != ''">
|
|
|
+ AND date_format(a.alarm_time,'%Y-%m-%d') <= date_format(#{endAlarmTime},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by a.is_lock desc, a.alarm_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectMsgAlarmList" resultType="com.ozs.service.entity.MsgAlarmCloud"
|
|
|
+ parameterType="com.ozs.service.entity.vo.MsgAlarmVo">
|
|
|
+ SELECT
|
|
|
+ a.alarm_id AS alarmId,
|
|
|
+ a.alarm_time AS alarmTime,
|
|
|
+ a.alarm_mile AS alarmMile,
|
|
|
+ a.line_dir AS lineDir,
|
|
|
+ a.alarm_type AS alarmType,
|
|
|
+ a.camera_code AS cameraCode,
|
|
|
+ a.id AS id,
|
|
|
+ a.content AS content,
|
|
|
+ a.alarm_confidence AS alarmConfidence,
|
|
|
+ a.alarm_attr AS alarmAttr,
|
|
|
+ a.image_url AS imageUrl,
|
|
|
+ a.released_by AS releasedBy,
|
|
|
+ a.is_lock AS isLock,
|
|
|
+ a.released_time AS releasedTime,
|
|
|
+ a.released_type AS releasedType,
|
|
|
+ a.released_reason AS releasedReason,
|
|
|
+ a.remark AS remark
|
|
|
+ FROM
|
|
|
+ msg_alarm_cloud AS a join
|
|
|
+ base_camera_management AS b on a.camera_code=b.camera_code join
|
|
|
+ base_railway_management AS l on b.railway_code=l.railway_code
|
|
|
+ <where>
|
|
|
+ <if test="railwayCode != null and railwayCode != ''">
|
|
|
+ concat(l.railway_name,l.railway_code)
|
|
|
+ like concat("%",#{railwayCode},"%")
|
|
|
+ </if>
|
|
|
+ <if test="beginMile != null and beginMile != 0">
|
|
|
+ and b.begin_mile >=#{beginMile}
|
|
|
+ </if>
|
|
|
+ <if test="endMile != null and endMile != 0">
|
|
|
+ and b.end_mile <=#{endMile}
|
|
|
+ </if>
|
|
|
+ <if test="ids != null and ids.size>0">
|
|
|
+ and a.id in
|
|
|
+ <foreach item="items" collection="ids" separator="," open="(" close=")" index="">
|
|
|
+ #{items}
|
|
|
+ </foreach>
|
|
|
+ </if>
|
|
|
+ <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 test="alarmType != null and alarmType != 0">
|
|
|
+ and a.alarm_type=#{alarmType}
|
|
|
+ </if>
|
|
|
+ <if test="alarmMile != null and alarmMile != 0">
|
|
|
+ and a.alarm_mile=#{alarmMile}
|
|
|
+ </if>
|
|
|
+ <if test="isLock != null and isLock != 0">
|
|
|
+ and a.is_lock=#{isLock}
|
|
|
+ </if>
|
|
|
+ <if test="lineDir != null and lineDir != 0">
|
|
|
+ and a.line_dir =#{lineDir}
|
|
|
+ </if>
|
|
|
+ <if test="releasedType != null and releasedType != 0">
|
|
|
+ and a.released_type =#{releasedType}
|
|
|
+ </if>
|
|
|
+ <if test="beginAlarmTime != null and beginAlarmTime != ''">
|
|
|
+ and date_format(a.alarm_time,'%Y-%m-%d') >= date_format(#{beginAlarmTime},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ <if test="endAlarmTime != null and endAlarmTime != ''">
|
|
|
+ AND date_format(a.alarm_time,'%Y-%m-%d') <= date_format(#{endAlarmTime},'%Y-%m-%d')
|
|
|
+ </if>
|
|
|
+ </where>
|
|
|
+ order by a.alarm_time desc
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getByAlarmId" resultType="com.ozs.service.entity.MsgAlarmCloud" parameterType="java.lang.String">
|
|
|
+ select *
|
|
|
+ from msg_alarm_cloud
|
|
|
+ where alarm_id = #{alarmId}
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countMsg" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
|
|
|
+ select count(1) from msg_alarm_cloud AS a join base_camera_management AS b on a.camera_code = b.camera_code
|
|
|
+ <where>
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countJC" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
|
|
|
+ select count(1) from msg_alarm_cloud AS a join base_camera_management AS b on a.camera_code=b.camera_code
|
|
|
+ <where>
|
|
|
+ is_lock = 1
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="countWJC" parameterType="com.ozs.service.entity.vo.MsgAlarmVo" resultType="java.lang.Integer">
|
|
|
+ select count(1) from msg_alarm_cloud AS a join base_camera_management AS b on a.camera_code=b.camera_code
|
|
|
+ <where>
|
|
|
+ is_lock = 2
|
|
|
+ <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>
|
|
|
+ </where>
|
|
|
+ </select>
|
|
|
+
|
|
|
+
|
|
|
+ <select id="queryAlarmInfoByAfterTenMinute" resultType="com.ozs.service.entity.MsgAlarmCloud">
|
|
|
+ SELECT a.id as id,
|
|
|
+ a.alarm_id AS alarmId,
|
|
|
+ a.alarm_time AS alarmTime,
|
|
|
+ a.alarm_mile AS alarmMile,
|
|
|
+ a.line_dir AS lineDir,
|
|
|
+ a.alarm_type AS alarmType,
|
|
|
+ a.camera_code AS cameraCode,
|
|
|
+ a.content AS content,
|
|
|
+ a.alarm_confidence AS alarmConfidence,
|
|
|
+ a.alarm_attr AS alarmAttr,
|
|
|
+ a.image_url AS imageUrl,
|
|
|
+ a.released_by AS releasedBy,
|
|
|
+ a.is_lock AS isLock,
|
|
|
+ a.released_time AS releasedTime,
|
|
|
+ a.released_type AS releasedType,
|
|
|
+ a.released_url AS releasedUrl,
|
|
|
+ a.released_reason AS releasedReason,
|
|
|
+ a.remark AS remark
|
|
|
+ from msg_alarm_cloud AS a
|
|
|
+ where a.is_lock = 2
|
|
|
+ and a.released_url is null
|
|
|
+ and a.alarm_time <= DATE_SUB(NOW(), INTERVAL 10 MINUTE)
|
|
|
+ </select>
|
|
|
+</mapper>
|