package com.xydl.cac.repository;

import com.xydl.cac.entity.Warning;
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 org.springframework.stereotype.Repository;


@Repository
public interface WarningRepository extends JpaRepository<Warning, Integer>, JpaSpecificationExecutor<Warning> {

    @Modifying
    @Query("update Warning set state = :frontState where state = :afterState")
    int updateWarningState(@Param("frontState") String frontState , @Param("afterState") String afterState);

}