|
|
|
@ -295,6 +295,12 @@ |
|
|
|
,device_info.id desc |
|
|
|
</sql> |
|
|
|
|
|
|
|
<sql id="Where_In_Alarm"> |
|
|
|
(alert_history.handle_status != 3 AND alert_history.handle_status != 4) |
|
|
|
OR |
|
|
|
(alert_history.handle_status = 4 AND alert_history.retain_alert = 1) |
|
|
|
</sql> |
|
|
|
|
|
|
|
<select id="getDevice4AlarmData" resultType="com.dongjian.dashboard.back.vo.data.DeviceAlarmData"> |
|
|
|
select |
|
|
|
<include refid="deviceDataSelect"/> |
|
|
|
@ -341,10 +347,7 @@ |
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
|
<choose> |
|
|
|
<when test="searchType == 1"> |
|
|
|
AND ( |
|
|
|
(alert_history.handle_status != 3 AND alert_history.handle_status != 4) |
|
|
|
OR (alert_history.handle_status = 4 AND alert_history.retain_alert = 1) |
|
|
|
) |
|
|
|
AND (<include refid="Where_In_Alarm"/>) |
|
|
|
</when> |
|
|
|
<when test="searchType == 2"> |
|
|
|
|
|
|
|
@ -408,10 +411,7 @@ |
|
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
|
<choose> |
|
|
|
<when test="searchType == 1"> |
|
|
|
AND ( |
|
|
|
(alert_history.handle_status != 3 AND alert_history.handle_status != 4) |
|
|
|
OR (alert_history.handle_status = 4 AND alert_history.retain_alert = 1) |
|
|
|
) |
|
|
|
AND (<include refid="Where_In_Alarm"/>) |
|
|
|
</when> |
|
|
|
<when test="searchType == 2"> |
|
|
|
|
|
|
|
@ -426,6 +426,16 @@ |
|
|
|
<include refid="alertHistoryOrder"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="selectAlertingDeviceIds" resultType="java.lang.String"> |
|
|
|
SELECT DISTINCT LOWER(device_id) AS device_id |
|
|
|
FROM alert_history |
|
|
|
WHERE device_id IN |
|
|
|
<foreach collection="deviceIds" item="deviceId" open="(" close=")" separator=","> |
|
|
|
#{deviceId} |
|
|
|
</foreach> |
|
|
|
AND (<include refid="Where_In_Alarm"/>) |
|
|
|
</select> |
|
|
|
|
|
|
|
<!-- 公共字段 --> |
|
|
|
<sql id="commonDeviceSelectFields"> |
|
|
|
device_info.id, |
|
|
|
|