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

import com.energy.manage.common.mapper.MyMapper;
import com.energy.manage.common.po.area.AreaPO;
import com.energy.manage.service.domain.dto.company.WindCompanyCustomDto;
import com.energy.manage.service.domain.vo.area.ProvinceVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author generate-code
 * @date 2020-07-29 11:28:12
 */
@Repository
public interface AreaMapper extends MyMapper<AreaPO> {

    List<AreaPO> findAll();

    List<AreaPO> findAllProvince();

    List<AreaPO> selectCityByPId(@Param("provinceId") int provinceId);

    List<AreaPO> selectAreaByCId(@Param("cityId") int cityId);

    int updateAreaByAId(@Param("areaId") int areaId,
                        @Param("area") String area,
                        @Param("areaType") int areaType);

    int deleteAreaById(@Param("areaId") int areaId);

    List<AreaPO> getEnableProvince(@Param("provinceName") String provinceName);

    List<AreaPO> selectProvinceById(@Param("list") List<Integer> list);

    List<ProvinceVo> getEnableArea();

    List<ProvinceVo> getUserEnableArea(@Param("officeId") Integer officeId,
                                       @Param("roleId") Integer roleId,
                                       @Param("userId") Integer userId);

    int insertArea(@Param("province") String province,
                   @Param("city") String city,
                   @Param("area") String area,
                   @Param("areaType") int areaType,
                   @Param("rootId") int rootId);

    List<AreaPO> getUserProvinceArea(@Param("userId") int userId);

    List<AreaPO> getUserCityByPid(@Param("userId") Integer userId,
                                  @Param("provinceId") Integer provinceId);

    List<AreaPO> finaProvinceByOfficeId(@Param("officeId") int officeId);

    List<AreaPO> finaProvinceByRegionId(@Param("regionId") int regionId);

    int updateAreaCodes(@Param("list") List<AreaPO> list);


    List<AreaPO> selectAreaByNames(@Param("type")Integer type,@Param("list")List<String> names);



}
