[alter,webapp]fix 告警定义关联监控问题
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
package com.usthe.alert.dao;
|
||||
|
||||
import com.usthe.common.entity.alerter.AlertDefineBind;
|
||||
import com.usthe.common.entity.alerter.AlertDefineMonitorBind;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
@@ -11,7 +11,7 @@ import java.util.List;
|
||||
* @author tom
|
||||
* @date 2021/12/9 10:03
|
||||
*/
|
||||
public interface AlertDefineBindDao extends JpaRepository<AlertDefineBind, Long>, JpaSpecificationExecutor<AlertDefineBind> {
|
||||
public interface AlertDefineBindDao extends JpaRepository<AlertDefineMonitorBind, Long>, JpaSpecificationExecutor<AlertDefineMonitorBind> {
|
||||
|
||||
/**
|
||||
* 根据告警定义ID删除告警定义与监控关联
|
||||
@@ -24,5 +24,5 @@ public interface AlertDefineBindDao extends JpaRepository<AlertDefineBind, Long>
|
||||
* @param alertDefineId 告警定义ID
|
||||
* @return 关联监控信息
|
||||
*/
|
||||
List<AlertDefineBind> getAlertDefineBindsByAlertDefineIdEquals(Long alertDefineId);
|
||||
List<AlertDefineMonitorBind> getAlertDefineBindsByAlertDefineIdEquals(Long alertDefineId);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ public interface AlertDefineDao extends JpaRepository<AlertDefine, Long>, JpaSpe
|
||||
* @param metrics 指标组
|
||||
* @return 告警定义列表
|
||||
*/
|
||||
@Query("select define from AlertDefine define join AlertDefineBind bind on bind.alertDefineId = define.id " +
|
||||
@Query("select define from AlertDefine define join AlertDefineMonitorBind bind on bind.alertDefineId = define.id " +
|
||||
"where bind.monitorId = :monitorId and define.metric = :metrics and define.enable = true")
|
||||
List<AlertDefine> queryAlertDefinesByMonitor(@Param(value = "monitorId") Long monitorId,
|
||||
@Param(value = "metrics") String metrics);
|
||||
|
||||
Reference in New Issue
Block a user