package com.zhiqiyun.open.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zhiqiyun.open.core.models.user.UserBaseInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

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

/**
 * @author Administrator
 * @date 2017-6-7
 */
@Mapper
public interface UserBaseInfoMapper extends BaseMapper<UserBaseInfo> {
    /**
     * 查询用户所拥有的权限
     *
     * @param uid
     * @return
     */
    List<String> findUserAuthorities(@Param("uid") Long uid);

    /**
     * 删除用户所有角色
     *
     * @param uid
     */
    void deleteRoles(@Param("uid") Long uid);

    /**
     * 插入用户角色
     *
     * @param uid
     * @param listRoles
     */
    void insertRoles(@Param("uid") Long uid, @Param("listRoles") List<Long> listRoles);

    /**
     * 查询搜索账号
     *
     * @param searchKey
     * @return
     */
    List<Map<String, Object>> findSelectAccounts(@Param("searchKey") String searchKey);

}
