package com.jiayue.ipfcst.dataexchange.repository;

import com.jiayue.ipfcst.common.data.entity.ForecastForSendAttribute;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 发送预测数据属性操作仓库
 *
 * @author 修唯xiuwei
 * @version 3.0
 */
public interface ForecastForSendAttributeRepository extends JpaRepository<ForecastForSendAttribute, Integer>, JpaSpecificationExecutor<ForecastForSendAttribute> {
  /**
   * 通过预测节点发现和预测类型
   * 根据预测功率的类型和预测节点查询点位
   *
   * @param forecastNode 预测节点
   * @param forecastType 预测类型
   * @return ForecastForSendAttribute 预测属性集合
   */
  List<ForecastForSendAttribute> findByForecastNodeAndForecastType(Integer forecastNode, ForecastForSendAttribute.ForecastType forecastType);

  /**
   * 找点数量和预测和预测节点类型
   * 根据点位和预测功率类型查询预测属性的id
   *
   * @param pointNumber  点数量
   * @param forecastNode 预测节点
   * @param forecastType 预测类型
   * @return ForecastForSendAttribute 预测属性集合
   */
  List<ForecastForSendAttribute> findByPointNumberAndForecastNodeAndForecastType(Integer pointNumber, Integer forecastNode, ForecastForSendAttribute.ForecastType forecastType);
}
