package com.gyee.wisdom.dao.sql.alarm.repository;
import com.gyee.wisdom.dao.sql.alarm.Entity.FaultSnapEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface FaultSnapRepository extends JpaRepository<FaultSnapEntity, Long>, JpaSpecificationExecutor {

    FaultSnapEntity findByWindturbineIdAndAlertValue(String windturbineId, int alertValue);

    FaultSnapEntity findByStationIdAndAlertValue(String stationId, int alertValue);

    FaultSnapEntity findByTestingpointKey(String testingpointkey);

    //获取故障风机编号
    @Query(value ="select t1 from FaultSnapEntity t1   where t1.cateGory1='FJ' and t1.stationId like '%FDC%' and t1.stationId not like '%QS%' and t1.isOpened=1")
    List<FaultSnapEntity> searchAllFaultWindturbineId();
}
