package com.energy.manage.service.mappers.windenginegroup;


import com.energy.manage.common.mapper.MyMapper;
import com.energy.manage.common.po.windenginegroup.WindEngineGroupPO;
import com.energy.manage.service.domain.dto.windenginegroup.WindEngineGroupPageDto;
import com.energy.manage.service.domain.dto.windenginegroup.WindEngineGroupUpdateDto;
import com.energy.manage.service.domain.vo.windenginegroup.WindEngineGroupPageVo;
import com.energy.manage.service.domain.vo.windenginegroup.WindEngineGroupShortVo;
import com.energy.manage.service.domain.vo.windenginegroup.WindEngineGroupVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.math.BigDecimal;
import java.util.List;


@Repository
public interface WindEngineGroupMapper extends MyMapper<WindEngineGroupPO> {

   /**
    * 分页
    * @param windEngineGroupPageDto
    * @return
    */
   List<WindEngineGroupPageVo> selectWindEngineGroupByNames(@Param("item") WindEngineGroupPageDto windEngineGroupPageDto);

   /**
    * 集合
    * @param fieldCode
    * @return
    */
   List<WindEngineGroupPageVo> selectWindEngineGroupListByFieldCode(@Param("fieldCode") String fieldCode);

   /**
    * 集合
    * @param fieldCode
    * @return
    */
   List<WindEngineGroupPageVo> selectWindEngineGroupRatedListByFieldCode(@Param("fieldCode") String fieldCode);

   /**
    * 查看当前角色所关联的机组
    * @param roleId
    * @return
    */
   List<WindEngineGroupVo> selectWindEngineGroupByRoleId(@Param("roleId") Integer roleId);

   /**
    * 根据批次号查询风机组
    * @param batchCode
    * @return
    */
   List<WindEngineGroupVo> selectWindEngineGroupByBatchCode(@Param("batchCode") String batchCode);


   /**
    * 查询出最大风机功率
    * @param fieldCode
    * @param engineCodes
    * @return
    */
   BigDecimal selectMaxRatedCapacity(@Param("fieldCode") String fieldCode,@Param("engineCodes") List<String> engineCodes);

   /**
    * 批量更改风机信息
    * @return
    */
   Integer updateWindEngineGroupList(@Param("list")List<WindEngineGroupUpdateDto> list);

   /**
    * 查询该风场下所有风机
    * @param fieldCode
    * @return
    */
   List<WindEngineGroupShortVo> selectWindEngineGroupShortList(@Param("fieldCode") String fieldCode);

}
