mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
@ -1,40 +0,0 @@
|
||||
package org.dromara.system.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@TableName("sys_auth_user")
|
||||
public class SysAuthUser {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 授权ID */
|
||||
private Long authId;
|
||||
|
||||
/** 第三方平台用户唯一ID */
|
||||
private String uuid;
|
||||
|
||||
/** 系统用户ID */
|
||||
private Long userId;
|
||||
|
||||
/** 登录账号 */
|
||||
private String userName;
|
||||
|
||||
/** 用户昵称 */
|
||||
private String nickName;
|
||||
|
||||
/** 头像地址 */
|
||||
private String avatar;
|
||||
|
||||
/** 用户邮箱 */
|
||||
private String email;
|
||||
|
||||
/** 用户来源 */
|
||||
private String source;
|
||||
|
||||
private String createTime;
|
||||
|
||||
}
|
@ -7,7 +7,6 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.dromara.common.mybatis.annotation.DataColumn;
|
||||
import org.dromara.common.mybatis.annotation.DataPermission;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.system.domain.SysAuthUser;
|
||||
import org.dromara.system.domain.SysUser;
|
||||
import org.dromara.system.domain.vo.SysUserVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@ -124,8 +123,8 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
||||
* @return 用户对象信息
|
||||
*/
|
||||
@DataPermission({
|
||||
@DataColumn(key = "deptName", value = "d.dept_id"),// 部门权限
|
||||
@DataColumn(key = "userName", value = "u.user_id")// 用户权限
|
||||
@DataColumn(key = "deptName", value = "d.dept_id"),
|
||||
@DataColumn(key = "userName", value = "u.user_id")
|
||||
})
|
||||
SysUserVo selectUserById(Long userId);
|
||||
|
||||
@ -143,44 +142,4 @@ public interface SysUserMapper extends BaseMapperPlus<SysUser, SysUserVo> {
|
||||
})
|
||||
int updateById(@Param(Constants.ENTITY) SysUser user);
|
||||
|
||||
/**
|
||||
* 根据用户编号查询授权列表
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @return 授权列表
|
||||
*/
|
||||
public List<SysAuthUser> selectAuthUserListByUserId(Long userId);
|
||||
|
||||
/**
|
||||
* 根据uuid查询用户信息
|
||||
*
|
||||
* @param uuid 唯一信息
|
||||
* @return 结果
|
||||
*/
|
||||
public SysUserVo selectAuthUserByUuid(String uuid);
|
||||
|
||||
/**
|
||||
* 校验source平台是否绑定
|
||||
*
|
||||
* @param userId 用户编号
|
||||
* @param source 绑定平台
|
||||
* @return 结果
|
||||
*/
|
||||
public int checkAuthUser(@Param("userId") Long userId, @Param("source") String source);
|
||||
|
||||
/**
|
||||
* 新增第三方授权信息
|
||||
*
|
||||
* @param authUser 用户信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertAuthUser(SysAuthUser authUser);
|
||||
|
||||
/**
|
||||
* 根据编号删除第三方授权信息
|
||||
*
|
||||
* @param authId 授权编号
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteAuthUser(Long authId);
|
||||
}
|
||||
|
@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.system.mapper.SysUserMapper">
|
||||
|
||||
<resultMap id="SysAuthUserResult" type="org.dromara.system.domain.SysAuthUser">
|
||||
<id property="authId" column="auth_id" />
|
||||
<result property="uuid" column="uuid" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="nickName" column="nick_name" />
|
||||
<result property="avatar" column="avatar" />
|
||||
<result property="email" column="email" />
|
||||
<result property="source" column="source" />
|
||||
<result property="createTime" column="create_time" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<select id="selectAuthUserByUuid" parameterType="String" resultMap="SysUserResult">
|
||||
select b.user_id as user_id, b.user_name as user_name, b.password as password , a.tenant_id as tenant_id
|
||||
from sys_auth_user a left join sys_user b on a.user_id = b.user_id
|
||||
where a.uuid = #{uuid} and b.del_flag = '0'
|
||||
</select>
|
||||
|
||||
<select id="selectAuthUserListByUserId" parameterType="Long" resultMap="SysAuthUserResult">
|
||||
select auth_id, uuid, user_id, user_name, nick_name, avatar, email, source, create_time, tenant_id from sys_auth_user where user_id = #{userId}
|
||||
</select>
|
||||
|
||||
<select id="checkAuthUser" parameterType="org.dromara.system.domain.SysAuthUser" resultType="int">
|
||||
select count(1) from sys_auth_user where user_id=#{userId} and source=#{source} limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertAuthUser" parameterType="org.dromara.system.domain.SysAuthUser">
|
||||
insert into sys_auth_user(
|
||||
<if test="uuid != null and uuid != ''">uuid,</if>
|
||||
<if test="userId != null and userId != 0">user_id,</if>
|
||||
<if test="userName != null and userName != ''">user_name,</if>
|
||||
<if test="nickName != null and nickName != ''">nick_name,</if>
|
||||
<if test="avatar != null and avatar != ''">avatar,</if>
|
||||
<if test="email != null and email != ''">email,</if>
|
||||
<if test="source != null and source != ''">source,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="uuid != null and uuid != ''">#{uuid},</if>
|
||||
<if test="userId != null and userId != 0">#{userId},</if>
|
||||
<if test="userName != null and userName != ''">#{userName},</if>
|
||||
<if test="nickName != null and nickName != ''">#{nickName},</if>
|
||||
<if test="avatar != null and avatar != ''">#{avatar},</if>
|
||||
<if test="email != null and email != ''">#{email},</if>
|
||||
<if test="source != null and source != ''">#{source},</if>
|
||||
now()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<delete id="deleteAuthUser" parameterType="Long">
|
||||
delete from sys_auth_user where auth_id = #{authId}
|
||||
</delete>
|
||||
|
||||
</mapper>
|
Reference in New Issue
Block a user