<?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>
|