package com.qaup.collision.pathconflict.repository;

import com.qaup.collision.pathconflict.model.entity.ConflictAlertLog;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Optional;

/**
 * 冲突预警告警记录Repository
 * 
 * @author AI Assistant
 * @version 1.0
 * @since 2025-01-17
 */
@Repository
public interface ConflictAlertLogRepository extends JpaRepository<ConflictAlertLog, Long> {
    
    /**
     * 根据告警类型和级别查找告警记录
     */
    List<ConflictAlertLog> findByAlertTypeAndAlertLevel(
        ConflictAlertLog.AlertType alertType,
        ConflictAlertLog.AlertLevel alertLevel
    );
    
    /**
     * 查找最新的一条告警记录
     */
    Optional<ConflictAlertLog> findFirstByOrderByAlertTimeDesc();
} 