package com.mosty.common.core.business.service;

import com.mosty.common.core.business.entity.SysUserDept;
import com.baomidou.mybatisplus.extension.service.IService;

import java.util.List;

/**
* @author li
* @description 针对表【sys_user_dept(用户和部门关联表)】的数据库操作Service
* @createDate 2022-02-12 16:53:21
*/
public interface SysUserDeptService extends IService<SysUserDept> {
    /**
     *
     * @param id
     * @return
     */
    List<SysUserDept> listByDeptId(Long id);

    /**
     * 根据部门id，用户id查询关联关系
     * @param deptId
     * @param userId
     * @return
     */
    SysUserDept getByDeptIdAndUserId(Long deptId, Long userId);

    /**
     * 根据userId获取相关部门
     * @param id
     * @return
     */
    List<Long> listByUserId(Long id);

    /**
     * 根据部门ID集合查询用户
     * @param ids
     * @return
     */
    List<SysUserDept> listByDeptIds(List<String> ids);
}
