[monitor]feature dashboard仪表盘重构 (#13)

This commit is contained in:
tomsun28
2022-03-06 21:48:00 +08:00
committed by GitHub
parent 0a3b077172
commit f324eeaa42
17 changed files with 710 additions and 25 deletions

View File

@@ -1,5 +1,6 @@
package com.usthe.alert.dao;
import com.usthe.alert.dto.AlertPriorityNum;
import com.usthe.common.entity.alerter.Alert;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@@ -32,4 +33,10 @@ public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationEx
@Query("update Alert set status = :status where id in :ids")
void updateAlertsStatus(@Param(value = "status") Byte status, @Param(value = "ids") List<Long> ids);
/**
* 查询各个告警级别的未处理告警数量
* @return 告警数量
*/
@Query("select new com.usthe.alert.dto.AlertPriorityNum(mo.priority, count(mo.id)) from Alert mo where mo.status = 0 group by mo.priority")
List<AlertPriorityNum> findAlertPriorityNum();
}