package com.gyee.wisdom.dao.sql.power.repository;

import com.gyee.wisdom.dao.sql.power.entity.WindturbinePowerCurvefittingEntity;
import com.gyee.wisdom.dao.sql.things.entity.TsPointEntity;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;


@Repository
public interface WindturbinePowerCurvefittingRepository extends JpaRepository<WindturbinePowerCurvefittingEntity, String>, JpaSpecificationExecutor {

    @Query("SELECT wpcf FROM WindturbinePowerCurvefittingEntity wpcf WHERE wpcf.windturbineId = :wtId " +
            "AND wpcf.speed > 2.99 AND wpcf.speed < 15.01 ")
    List<WindturbinePowerCurvefittingEntity> queryData(@Param("wtId") String windturbineId);

}
