package com.lz.modules.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.app.dto.DepartmentsDto;
import com.lz.modules.app.dto.StaffDepartmentDto;
import com.lz.modules.app.entity.DepartmentsEntity;
import com.lz.modules.job.model.responseBo.DepartmentInfosBo;

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

/**
 * 部门表
 *
 * @author fumeiai
 * @email fumeiai@linzikg.com
 * @date 2020-04-30 16:59:50
 */
public interface DepartmentsService extends IService<DepartmentsEntity> {

    PageUtils queryPage(Map<String, Object> params);

    //DepartmentsEntity filterUpdateDepartmentInfos(DepartmentInfosBo departmentInfosBo);

    void updateDepartmentInfos(List<DepartmentInfosBo> departmentInfosBos);



    List<DepartmentsDto> getDepartmentTree(int type);

    List<DepartmentsDto> selectByParentDepartmentId(String deparentId);

    List<DepartmentsEntity> selectEntityByParentDepartmentId(String parentId);

    DepartmentsEntity selectByDepartmentId(String departmentId);

    StaffDepartmentDto selectStaffAllDepartments(String departmentId);

    void updateDepartmentInfo(DepartmentInfosBo departmentInfosBo);

    Map<String,String> selectUserAllDepartmentIds(String departmentId);

    List<String> selectAllChildDepartmentIds(String departmentId);

    Map<String,String> selectUserAllDepartmentInFo(String departmentId);

    /**
     * 获取自己管理得部门列表
     * @param staffId  人员id
     * @param containSelf 是否包含本身
     * @return
     */
    List<DepartmentsDto> getDepartmentTreeByStaffId(String staffId,boolean containSelf);

    List<DepartmentsEntity> selectAllDepartmentIds(List<String> dIds);

    //查找父级部门
    DepartmentsEntity selectParentDepartmentByDepartmentId(String departmentId);

    List<DepartmentsEntity> selectAll();

    int delDepartments(List<DepartmentsEntity> departmentsEntities);

    Map<Long,List<String>> selectDepartmentTreeByDepIds(List<String> depIds);
}

