[alert,webapp] 告警中心条件查询与搜索支持,支持批量已读未读
This commit is contained in:
@@ -3,7 +3,11 @@ package com.usthe.alert.dao;
|
||||
import com.usthe.alert.pojo.entity.Alert;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
import org.springframework.data.repository.query.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
/**
|
||||
@@ -19,4 +23,13 @@ public interface AlertDao extends JpaRepository<Alert, Long>, JpaSpecificationEx
|
||||
*/
|
||||
void deleteAlertsByIdIn(Set<Long> alertIds);
|
||||
|
||||
/**
|
||||
* 根据告警ID-状态值 更新告警状态
|
||||
* @param status 状态值
|
||||
* @param ids 告警ID列表
|
||||
*/
|
||||
@Modifying
|
||||
@Query("update Alert set status = :status where id in :ids")
|
||||
void updateAlertsStatus(@Param(value = "status") Byte status, @Param(value = "ids") List<Long> ids);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user