/**
 * Copyright (c) 2020 fumeiai All rights reserved.
 * <p>
 * <p>
 * <p>
 * 版权所有，侵权必究！
 */

package com.lz.modules.sys.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.lz.modules.app.dto.UserDto;
import com.lz.modules.sys.entity.SysUserEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * 系统用户
 *
 * @author Mark sunlightcs@gmail.com
 */
@Mapper
public interface SysUserDao extends BaseMapper<SysUserEntity> {

    /**
     * 查询用户的所有权限
     * @param userId  用户ID
     */
    List<String> queryAllPerms(Long userId);

    /**
     * 查询用户的所有菜单ID
     */
    List<Long> queryAllMenuId(Long userId);

    /**
     * 根据用户名，查询系统用户
     */
    SysUserEntity queryByUserName(String username);

    List<UserDto> getUserInfos(String realName, Long createUserId, String mobile, String roleName, int pageLimit, int startIndex);

    int getTotalCount(String realName, Long createUserId, String mobile, String roleName);


    List<Long> queryMenuIdListByRoleId(@Param("roleId") Long roleId);

    List<Long> queryMenuIdListByRoleIds(@Param("roleIds") Set<Long> roleIds);
}
