package cn.com.countrygarden.bi.main.dao.manager.map;

import cn.com.countrygarden.bi.main.dto.HouseKeeperDTO;
import cn.com.countrygarden.bi.main.dto.ManagerMapOrganTreeDTO;
import com.github.pagehelper.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * package: cn.com.countrygarden.bi.main.dao.manager.map
 * describe:
 * creat_user: lsl
 * creat_date: 2018/6/27
 * creat_time: 12:53
 **/

@Repository
public interface ManagerMapMapper {


    /**
     * 根据项目编号统计管家数量
     * TODO 只取岗位为管家的用户
     * @param projects
     * @return
     */
    int countHousekeeperByProjects(@Param("projects") List<String> projects);


    /**
     * 根据项目查询管家信息
     * TODO 只取岗位为管家的用户
     * @param projects
     * @param objects
     * @return
     */
    List<HouseKeeperDTO> selectHouseKeeperPageDataByOrganCode(@Param("commNames") List<String> commNames,
                                                              @Param("userCode") String userCode,
                                                              @Param("phoneNums") List<String> phoneNums,
                                                              @Param("gardenDistricts") String gardenDistricts,
                                                              @Param("startRow")Integer startRow,
                                                              @Param("pageSize") Integer pageSize);

    int countHouseKeeperPageDataByOrganCode(@Param("commNames")List<String> communityNames,
                                            @Param("userCode") String userCode,
                                            @Param("phoneNums")List<String> phoneNums,
                                            @Param("gardenDistricts")String gardenDistricts);


    List<String> selectCommNameByProjectName(@Param("projectName") String projectName);
    
    String selectCommNameByProjectNameAndOrganName(@Param("projectName") String projectName,
    		@Param("organName") String organName);
    
    List<ManagerMapOrganTreeDTO> selectAllOrganTree();
    
    List<ManagerMapOrganTreeDTO> selectCommNameTreeByOrganName(@Param("organName") String organName);
    
    List<String> selectCommNameTreeByOrganNameStr(@Param("organName") String organName);
    
    /**
     * 根据多个区域的项目
     * @param organCode
     * @return
     */
    List<String> selectAllCommNameTree(@Param("organNames")List<String> organNames);
    
    String selectCommNameByPropertyProjectName(@Param("propertyProjectName") String propertyProjectName);

    List<String> selectPropertyProjectNameByCommName(@Param("projectName") String projectName);

    ManagerMapOrganTreeDTO selectOrganTreeByErpOrgan(@Param("organName") String organName);

    Integer selectHouserKeeperIsEffective(@Param("pkPsndoc") String pkPsndoc);

}
