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

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.mosty.common.core.business.entity.SysDept;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mosty.common.core.business.entity.SysRole;
import com.mosty.common.core.business.entity.SysUser;
import com.mosty.common.core.business.entity.vo.RoleByDeptPage;
import com.mosty.common.core.business.entity.vo.RoleDeptVO;
import com.mosty.common.core.business.entity.vo.UserByDeptPage;
import com.mosty.common.core.business.entity.vo.UserDeptVO;
import com.mosty.common.core.login.dto.DeptDTO;
import io.swagger.annotations.ApiOperation;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* @author li
* @description 针对表【sys_dept(部门表)】的数据库操作Mapper
* @createDate 2022-02-12 16:52:58
* @Entity generator.domain.SysDept
*/
public interface SysDeptMapper extends BaseMapper<SysDept> {

    @ApiOperation("查询用户关联的部门id集合")
    List<DeptDTO> selectUserDeptList(@Param("userId") Long userId);

    @ApiOperation("分页查询部门下用户信息")
    IPage<UserDeptVO> selectUserPageByDept(@Param("param") UserByDeptPage userByDeptPage);

    @ApiOperation("分页查询部门下角色信息")
    IPage<RoleDeptVO> selectRolePageByDept(@Param("param")  RoleByDeptPage roleByDeptPage);

    @ApiOperation("查询用户的所属部门")
    SysDept getDeptByUserId(Long id);

    @ApiOperation("查询下级部门")
    List<SysDept> getDeptListByParentId(@Param("parentid") Integer parentid, @Param("deptname") String deptname);

    @ApiOperation("查询下级部门")
    List<SysDept> getDeptListByOrgcode(@Param("deptCode") String deptCode, @Param("deptname") String deptname, @Param("deptId") Long deptId);
}




