package com.yeejoin.amos.boot.module.hygf.api.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.hygf.api.config.DealerRestrict;
import com.yeejoin.amos.boot.module.hygf.api.config.UserEmpower;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDto;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpInverterDtoNew;
import com.yeejoin.amos.boot.module.hygf.api.dto.JpStationDto;
import com.yeejoin.amos.boot.module.hygf.api.entity.JpInverter;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 户用光伏监盘逆变器表 Mapper 接口
 *
 * @author system_generator
 * @date 2023-09-19
 */
public interface JpInverterMapper extends BaseMapper<JpInverter> {

    List<Map<String,Object>> queryInverterCountStatus(@Param("dto") JpStationDto reviewDto);

    @UserEmpower(field ={"sta.regional_companies_code"} ,dealerField={"sta.amos_company_code","sta.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
   // @DealerRestrict(field ={"amos_company_code","regional_companies_code","developer_user_id"},fieldConditions ={"in","in","in"} ,relationship="and")
    List<JpInverterDtoNew> selectPageData(@Param("dto") JpInverterDto reviewDto, int current, int size);

    @UserEmpower(field ={"sta.regional_companies_code"} ,dealerField={"sta.amos_company_code","sta.regional_companies_code"} ,fieldConditions ={"eq","in"} ,relationship="and")
    int  selectPageDataTotal(@Param("dto") JpInverterDto reviewDto);

    List<Map<String,Object>> selectInverterState(@Param("thirdStationIds") List<String> thirdStationIds);
}
