package com.storlead.user.mapper;

import com.storlead.framework.mybatis.mapper.MyBaseMapper;
import com.storlead.user.pojo.entity.DeptEntity;
import com.storlead.user.model.DeptTreeModel;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Set;

/**
 * <p>
 * 部门 Mapper 接口
 * <p>
 *
 * @Author: Steve
 * @Since：   2019-01-22
 */
public interface DeptMapper extends MyBaseMapper<DeptEntity> {

    List<DeptTreeModel> queryDeptBySubList(Integer subCompanyId);

    @Select("truncate table dept;")
    Boolean truncateDept();

    List<Long> queryDeptIdListByDeptId(Long deptId);

    List<DeptEntity> findByPid(Long deptId);

    /**
     * 根据角色ID查询部门列表
     *
     * @param roleId 角色ID
     * @return java.util.Set<com.storlead.web.model.entity.Dept>
     * @author blank
     * @date 2021-3-31 下午 5:14
     */
    Set<DeptEntity> findByRoleId(Long roleId);


    List<DeptEntity> getDeptTreeIdsByDeptIds(Long deptId);
}
