package cn.com.countrygarden.bi.main.dao.performance;

import cn.com.countrygarden.bi.main.model.performance.PerformanceArea;
import cn.com.countrygarden.bi.main.model.performance.dto.PerformanceAreaDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 绩效考核对象Mapper
 * @Author:Wyman
 * @date 2018/10/19
 */
public interface PerformanceAreaMapper {

    int deleteByPrimaryKey(String areaId);

    int insertSelective(PerformanceArea record);

    PerformanceArea selectByPrimaryKey(String typeNo);

    int updateByPrimaryKeySelective(PerformanceArea record);

    //根据类型查询所有所属的area
    List<PerformanceArea> selectAllByTypeNo(@Param("typeNo") String typeNo);

    //根据类型查询分类记录总数
    int selectCountByTypeNo(@Param("typeNo") String typeNo);


    //根据账号区域过滤(分类)
    List<String> areaFilter(@Param("areaList") List<String> areaList, @Param("typeNo") String typeNo);

    //通过hierachyIds获得实体集合
    List<PerformanceAreaDto> selectByIds(@Param("idList") List<String> idList);

    //通过hierachyId获得子类型
    String getSubType(@Param("hierachyId") String hierachyId);

    //通过hierachyId获得名称
    String selectHierachyName(@Param("hierachyId") String hierachyId);


}
