package com.lz.modules.app.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.lz.common.utils.PageUtils;
import com.lz.modules.app.entity.DepartmentsStaffRelateEntity;
import com.lz.modules.app.entity.StaffEntity;
import com.lz.modules.job.model.responseBo.DepartmentStaffBo;

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

/**
 * 部门与员工关联表
 *
 * @author fumeiai
 * @email fumeiai@linzikg.com
 * @date 2020-04-29 20:59:20
 */
public interface DepartmentsStaffRelateService extends IService<DepartmentsStaffRelateEntity> {

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

    /**
     * 根据部门ID和员工Ids创建部门和员工关系表
     */
    void addRelateInfos(String departmentId, List<DepartmentStaffBo> staffs);


    void deleteAllRelates();


    List<DepartmentsStaffRelateEntity> selectAll();

    List<DepartmentsStaffRelateEntity> selectByStaffIds(List<Long> staffIds);

    DepartmentsStaffRelateEntity selectLastDepartmentByStaffId(Long staffId);

    DepartmentsStaffRelateEntity selectLeaderByDepartmentId(String departmentId);

    DepartmentsStaffRelateEntity selectDepartmentByDepartmentId(String departmentId);

    DepartmentsStaffRelateEntity selectByStaffId(Long staffId);

    List<String> selectStaffIdsByDepartments(List<String> deparmentIds);

    List<StaffEntity> selectLeadersByDepartmentId(String depId);

    List<Long> selectLongStaffIdsByDepartments(List<String> departmentIds);

    List<Long> selectAllStaffIds();
}

