告警保护方案轮询-调整
This commit is contained in:
@ -92,8 +92,9 @@ public interface EmsAlarmRecordsMapper
|
||||
public int getDeviceAlarmNum(@Param("siteId") String siteId, @Param("deviceId") String deviceId);
|
||||
|
||||
//获取未处理的订阅失败告警
|
||||
public EmsAlarmRecords getFailedRecord(@Param("siteId")String siteId, @Param("deviceId")String deviceId,
|
||||
@Param("content") String content,@Param("status")String status);
|
||||
public EmsAlarmRecords getFailedRecord(@Param("siteId")String siteId,
|
||||
@Param("content") String content,
|
||||
@Param("level")String level);
|
||||
|
||||
// 批量处理告警数据
|
||||
public void batchUpsert(@Param("recordsList")List<EmsAlarmRecords> recordsList);
|
||||
|
||||
@ -75,4 +75,9 @@ public interface EmsStrategyRunningMapper
|
||||
|
||||
// 获取运行中的策略
|
||||
public List<StrategyRunningVo> getPendingPollerStrategy(String siteId);
|
||||
|
||||
// 获取正在运行的策略
|
||||
public EmsStrategyRunning getRunningStrategy(String siteId);
|
||||
// 获取已存在并且状态为:未启用和已暂停的最晚一条策略,
|
||||
public EmsStrategyRunning getPendingStrategy(String siteId);
|
||||
}
|
||||
|
||||
@ -153,7 +153,7 @@
|
||||
t.ticket_no as ticketNo,
|
||||
t.id
|
||||
from ems_alarm_records t
|
||||
INNER JOIN ems_devices_setting t2 on t.site_id = t2.site_id and t.device_id = t2.device_id
|
||||
LEFT JOIN ems_devices_setting t2 on t.site_id = t2.site_id and t.device_id = t2.device_id
|
||||
where t.site_id = #{siteId}
|
||||
<if test="deviceType != null and deviceType != ''">
|
||||
AND t.device_type = #{deviceType}
|
||||
@ -186,9 +186,9 @@
|
||||
<select id="getFailedRecord" resultMap="EmsAlarmRecordsResult">
|
||||
<include refid="selectEmsAlarmRecordsVo"/>
|
||||
where site_id = #{siteId}
|
||||
and device_id = #{deviceId}
|
||||
and alarm_content = #{content}
|
||||
and status = #{status}
|
||||
and alarm_level = #{level}
|
||||
and status <![CDATA[ != ]]> 1
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
|
||||
@ -115,10 +115,6 @@
|
||||
and `status` = 1
|
||||
</select>
|
||||
|
||||
<update id="updateStatusRunning">
|
||||
update ems_strategy_running set `status`= #{status} where site_id = #{siteId}
|
||||
</update>
|
||||
|
||||
<select id="getPendingPollerStrategy" parameterType="String" resultType="com.xzzn.ems.domain.vo.StrategyRunningVo">
|
||||
select t.id,
|
||||
t.`status`,
|
||||
@ -135,4 +131,20 @@
|
||||
and t.site_id = #{siteId}
|
||||
</if>
|
||||
</select>
|
||||
|
||||
<select id="getRunningStrategy" parameterType="String" resultMap="EmsStrategyRunningResult">
|
||||
<include refid="selectEmsStrategyRunningVo"/>
|
||||
where site_id = #{siteId}
|
||||
and `status` = 1
|
||||
order by update_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<select id="getPendingStrategy" parameterType="String" resultMap="EmsStrategyRunningResult">
|
||||
<include refid="selectEmsStrategyRunningVo"/>
|
||||
where site_id = #{siteId}
|
||||
and `status` in (0, 2)
|
||||
order by update_time desc
|
||||
limit 1
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user