|
|
@ -315,7 +315,7 @@ |
|
|
PARTITION BY device_id |
|
|
PARTITION BY device_id |
|
|
ORDER BY receive_ts DESC |
|
|
ORDER BY receive_ts DESC |
|
|
) AS rn |
|
|
) AS rn |
|
|
FROM alert_history |
|
|
FROM alert_history where alert_history.source_type = 1 |
|
|
) alert_history on alert_history.device_id = device_info.device_id AND alert_history.rn = 1 |
|
|
) alert_history on alert_history.device_id = device_info.device_id AND alert_history.rn = 1 |
|
|
</when> |
|
|
</when> |
|
|
<otherwise> |
|
|
<otherwise> |
|
|
@ -334,6 +334,7 @@ |
|
|
<where> |
|
|
<where> |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
|
|
|
and alert_history.source_type = 1 |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<choose> |
|
|
<choose> |
|
|
<when test="searchType == 1"> |
|
|
<when test="searchType == 1"> |
|
|
@ -375,7 +376,7 @@ |
|
|
PARTITION BY device_id |
|
|
PARTITION BY device_id |
|
|
ORDER BY receive_ts DESC |
|
|
ORDER BY receive_ts DESC |
|
|
) AS rn |
|
|
) AS rn |
|
|
FROM alert_history |
|
|
FROM alert_history where alert_history.source_type = 1 |
|
|
) alert_history on alert_history.device_id = device_info.device_id AND alert_history.rn = 1 |
|
|
) alert_history on alert_history.device_id = device_info.device_id AND alert_history.rn = 1 |
|
|
</when> |
|
|
</when> |
|
|
<otherwise> |
|
|
<otherwise> |
|
|
@ -396,6 +397,7 @@ |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and device_info.flag = 0 and basic_monitoring_asset.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
and basic_space.flag != 1 and basic_floor.flag != 1 and basic_building.flag != 1 |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
and ddgr.device_group_id = #{deviceGroupId} |
|
|
|
|
|
and alert_history.source_type = 1 |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<include refid="deviceDataCommonWhere"/> |
|
|
<choose> |
|
|
<choose> |
|
|
<when test="searchType == 1"> |
|
|
<when test="searchType == 1"> |
|
|
|