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

import com.energy.manage.common.mapper.MyMapper;
import com.energy.manage.common.po.system.SysUserRolePO;
import com.energy.manage.common.po.windfield.WindFieldPO;
import com.energy.manage.service.domain.dto.windfield.WindFieldPageDto;
import com.energy.manage.service.domain.vo.windenginegroup.WindFieldRatedCapacityVo;
import com.energy.manage.service.domain.vo.windfield.WindFieldNameVo;
import com.energy.manage.service.domain.vo.windfield.WindFieldPageVo;
import com.energy.manage.service.domain.vo.windfield.WindFieldVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 风场信息mapper
 */
@Repository
public interface WindFieldMapper extends MyMapper<WindFieldPO> {


    int updateWindFieldEngineNumberByFieldCode(@Param("fieldCode") String fieldCode);


    List<WindFieldPageVo> selectWindFieldPageByfield(@Param("item") WindFieldPageDto windFieldPageDto);

    List<WindFieldNameVo> selectWindFieldNamesByUserId(@Param("userId") Integer userId, @Param("roleId") Integer roleId);

    /**
     * 根据编号查询风场信息
     *
     * @param codeNumber
     * @return
     */
    WindFieldVo selectByCodeNumber(@Param("codeNumber") String codeNumber);

    /**
     * 查询风机总容量
     * @return
     */
    List<WindFieldRatedCapacityVo> selectRatedCapacityByState();

    /**
     * 批量更新总容量
     * @param list
     */
    void batchUpdateRatedCapacity(@Param("list")List<WindFieldRatedCapacityVo> list);

}
