package com.gyee.alarm.mapper.auto;

import com.gyee.alarm.model.auto.ProEconActivePowerData;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.gyee.alarm.model.vo.FitClassVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 动态功率数据 Mapper 接口
 * </p>
 *
 * @author shilin
 * @since 2022-10-27
 */
public interface ProEconActivePowerDataMapper extends BaseMapper<ProEconActivePowerData> {

    @Select(" SELECT windpowerstation_id windpowerstationId,windturbine_id windturbineId, " +
            "model_id modelId,speed,avg(power) power " +
            "FROM Pro_Econ_Active_Power_Data " +
            "  where  windpowerstation_id=#{windpowerstationId} and record_date>=#{beginDate}  and record_date<=#{endDate} " +
            "       group by windpowerstation_id,windturbine_id,model_id,speed order by speed ")
    public List<FitClassVo> getFitList(@Param(value = "windpowerstationId")String windpowerstationId, @Param(value = "beginDate") Date beginDate, @Param(value = "endDate")Date endDate);


}
