|
@@ -185,17 +185,29 @@
|
|
|
|
|
|
<select id="getAlarmNum" resultType="java.lang.Long">
|
|
|
select count(DISTINCT alarm_id) as alarmNum
|
|
|
- from
|
|
|
- msg_alarm
|
|
|
+ from msg_alarm
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCameraCode" parameterType="java.lang.String" resultType="java.lang.Integer">
|
|
|
- select is_lock from msg_alarm where camera_code = #{cameraCode} ORDER BY alarm_time DESC LIMIT 1
|
|
|
+ select is_lock
|
|
|
+ from msg_alarm
|
|
|
+ where camera_code = #{cameraCode}
|
|
|
+ ORDER BY alarm_time DESC
|
|
|
+ LIMIT 1
|
|
|
</select>
|
|
|
|
|
|
<select id="selectByCameraCode" parameterType="java.lang.String" resultType="com.ozs.entity.MsgAlarm">
|
|
|
- select * from msg_alarm where camera_code = #{cameraCode} order by alarm_time desc limit 1
|
|
|
+ select *
|
|
|
+ from msg_alarm
|
|
|
+ where camera_code = #{cameraCode}
|
|
|
+ order by alarm_time desc
|
|
|
+ limit 1
|
|
|
</select>
|
|
|
+
|
|
|
+ <!-- and date_format(alarm_time,'%Y-%m-%d %H:%i:%S') >= date_format(#{beginAlarmTime},'%Y-%m-%d
|
|
|
+ %H:%i:%S') -->
|
|
|
+ <!-- AND date_format(alarm_time,'%Y-%m-%d %H:%i:%S') <= date_format(#{endAlarmTime},'%Y-%m-%d
|
|
|
+ %H:%i:%S')-->
|
|
|
<select id="selectMsgAlarmList" resultType="com.ozs.entity.MsgAlarm" parameterType="com.ozs.entity.vo.MsgAlarmVo">
|
|
|
SELECT * FROM msg_alarm
|
|
|
<where>
|
|
@@ -217,13 +229,9 @@
|
|
|
<if test="beginAlarmTime != null and beginAlarmTime != ''">
|
|
|
and TO_CHAR(alarm_time, 'YYYY-MM-DD HH24:MI:SS') >= TO_CHAR(#{beginAlarmTime}, 'YYYY-MM-DD
|
|
|
HH24:MI:SS')
|
|
|
- -- and date_format(alarm_time,'%Y-%m-%d %H:%i:%S') >= date_format(#{beginAlarmTime},'%Y-%m-%d
|
|
|
- %H:%i:%S')
|
|
|
</if>
|
|
|
<if test="endAlarmTime != null and endAlarmTime != ''">
|
|
|
and TO_CHAR(alarm_time, 'YYYY-MM-DD HH24:MI:SS') <= TO_CHAR(#{endAlarmTime}, 'YYYY-MM-DD HH24:MI:SS')
|
|
|
- -- AND date_format(alarm_time,'%Y-%m-%d %H:%i:%S') <= date_format(#{endAlarmTime},'%Y-%m-%d
|
|
|
- %H:%i:%S')
|
|
|
</if>
|
|
|
</where>
|
|
|
order by alarm_time desc
|