mirror of
https://gitee.com/bookshelfplus/bookshelfplus
synced 2025-09-16 23:22:20 +08:00
293 lines
10 KiB
XML
293 lines
10 KiB
XML
<?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="plus.bookshelf.Dao.Mapper.ThirdPartyUserDOMapper">
|
|
<resultMap id="BaseResultMap" type="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
<id column="id" jdbcType="INTEGER" property="id" />
|
|
<result column="uuid" jdbcType="VARCHAR" property="uuid" />
|
|
<result column="source" jdbcType="VARCHAR" property="source" />
|
|
<result column="access_token" jdbcType="VARCHAR" property="accessToken" />
|
|
<result column="expire_in" jdbcType="INTEGER" property="expireIn" />
|
|
<result column="refresh_token" jdbcType="VARCHAR" property="refreshToken" />
|
|
<result column="open_id" jdbcType="VARCHAR" property="openId" />
|
|
<result column="uid" jdbcType="VARCHAR" property="uid" />
|
|
<result column="access_code" jdbcType="VARCHAR" property="accessCode" />
|
|
<result column="union_id" jdbcType="VARCHAR" property="unionId" />
|
|
<result column="scope" jdbcType="VARCHAR" property="scope" />
|
|
<result column="token_type" jdbcType="VARCHAR" property="tokenType" />
|
|
<result column="id_token" jdbcType="VARCHAR" property="idToken" />
|
|
<result column="mac_algorithm" jdbcType="VARCHAR" property="macAlgorithm" />
|
|
<result column="mac_key" jdbcType="VARCHAR" property="macKey" />
|
|
<result column="code" jdbcType="VARCHAR" property="code" />
|
|
<result column="oauth_token" jdbcType="VARCHAR" property="oauthToken" />
|
|
<result column="oauth_token_secret" jdbcType="VARCHAR" property="oauthTokenSecret" />
|
|
</resultMap>
|
|
<sql id="Base_Column_List">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
id, uuid, `source`, access_token, expire_in, refresh_token, open_id, `uid`, access_code,
|
|
union_id, `scope`, token_type, id_token, mac_algorithm, mac_key, code, oauth_token,
|
|
oauth_token_secret
|
|
</sql>
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from third_party_user_info
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</select>
|
|
<delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
delete from third_party_user_info
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</delete>
|
|
<insert id="insert" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
insert into third_party_user_info (id, uuid, `source`,
|
|
access_token, expire_in, refresh_token,
|
|
open_id, `uid`, access_code,
|
|
union_id, `scope`, token_type,
|
|
id_token, mac_algorithm, mac_key,
|
|
code, oauth_token, oauth_token_secret
|
|
)
|
|
values (#{id,jdbcType=INTEGER}, #{uuid,jdbcType=VARCHAR}, #{source,jdbcType=VARCHAR},
|
|
#{accessToken,jdbcType=VARCHAR}, #{expireIn,jdbcType=INTEGER}, #{refreshToken,jdbcType=VARCHAR},
|
|
#{openId,jdbcType=VARCHAR}, #{uid,jdbcType=VARCHAR}, #{accessCode,jdbcType=VARCHAR},
|
|
#{unionId,jdbcType=VARCHAR}, #{scope,jdbcType=VARCHAR}, #{tokenType,jdbcType=VARCHAR},
|
|
#{idToken,jdbcType=VARCHAR}, #{macAlgorithm,jdbcType=VARCHAR}, #{macKey,jdbcType=VARCHAR},
|
|
#{code,jdbcType=VARCHAR}, #{oauthToken,jdbcType=VARCHAR}, #{oauthTokenSecret,jdbcType=VARCHAR}
|
|
)
|
|
</insert>
|
|
<insert id="insertSelective" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
insert into third_party_user_info
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
id,
|
|
</if>
|
|
<if test="uuid != null">
|
|
uuid,
|
|
</if>
|
|
<if test="source != null">
|
|
`source`,
|
|
</if>
|
|
<if test="accessToken != null">
|
|
access_token,
|
|
</if>
|
|
<if test="expireIn != null">
|
|
expire_in,
|
|
</if>
|
|
<if test="refreshToken != null">
|
|
refresh_token,
|
|
</if>
|
|
<if test="openId != null">
|
|
open_id,
|
|
</if>
|
|
<if test="uid != null">
|
|
`uid`,
|
|
</if>
|
|
<if test="accessCode != null">
|
|
access_code,
|
|
</if>
|
|
<if test="unionId != null">
|
|
union_id,
|
|
</if>
|
|
<if test="scope != null">
|
|
`scope`,
|
|
</if>
|
|
<if test="tokenType != null">
|
|
token_type,
|
|
</if>
|
|
<if test="idToken != null">
|
|
id_token,
|
|
</if>
|
|
<if test="macAlgorithm != null">
|
|
mac_algorithm,
|
|
</if>
|
|
<if test="macKey != null">
|
|
mac_key,
|
|
</if>
|
|
<if test="code != null">
|
|
code,
|
|
</if>
|
|
<if test="oauthToken != null">
|
|
oauth_token,
|
|
</if>
|
|
<if test="oauthTokenSecret != null">
|
|
oauth_token_secret,
|
|
</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null">
|
|
#{id,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="uuid != null">
|
|
#{uuid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="source != null">
|
|
#{source,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="accessToken != null">
|
|
#{accessToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="expireIn != null">
|
|
#{expireIn,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="refreshToken != null">
|
|
#{refreshToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="openId != null">
|
|
#{openId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="uid != null">
|
|
#{uid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="accessCode != null">
|
|
#{accessCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="unionId != null">
|
|
#{unionId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="scope != null">
|
|
#{scope,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="tokenType != null">
|
|
#{tokenType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="idToken != null">
|
|
#{idToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="macAlgorithm != null">
|
|
#{macAlgorithm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="macKey != null">
|
|
#{macKey,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="code != null">
|
|
#{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="oauthToken != null">
|
|
#{oauthToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="oauthTokenSecret != null">
|
|
#{oauthTokenSecret,jdbcType=VARCHAR},
|
|
</if>
|
|
</trim>
|
|
</insert>
|
|
<update id="updateByPrimaryKeySelective" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
update third_party_user_info
|
|
<set>
|
|
<if test="uuid != null">
|
|
uuid = #{uuid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="source != null">
|
|
`source` = #{source,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="accessToken != null">
|
|
access_token = #{accessToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="expireIn != null">
|
|
expire_in = #{expireIn,jdbcType=INTEGER},
|
|
</if>
|
|
<if test="refreshToken != null">
|
|
refresh_token = #{refreshToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="openId != null">
|
|
open_id = #{openId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="uid != null">
|
|
`uid` = #{uid,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="accessCode != null">
|
|
access_code = #{accessCode,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="unionId != null">
|
|
union_id = #{unionId,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="scope != null">
|
|
`scope` = #{scope,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="tokenType != null">
|
|
token_type = #{tokenType,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="idToken != null">
|
|
id_token = #{idToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="macAlgorithm != null">
|
|
mac_algorithm = #{macAlgorithm,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="macKey != null">
|
|
mac_key = #{macKey,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="code != null">
|
|
code = #{code,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="oauthToken != null">
|
|
oauth_token = #{oauthToken,jdbcType=VARCHAR},
|
|
</if>
|
|
<if test="oauthTokenSecret != null">
|
|
oauth_token_secret = #{oauthTokenSecret,jdbcType=VARCHAR},
|
|
</if>
|
|
</set>
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<update id="updateByPrimaryKey" parameterType="plus.bookshelf.Dao.DO.ThirdPartyUserDO">
|
|
<!--
|
|
WARNING - @mbg.generated
|
|
This element is automatically generated by MyBatis Generator, do not modify.
|
|
-->
|
|
update third_party_user_info
|
|
set uuid = #{uuid,jdbcType=VARCHAR},
|
|
`source` = #{source,jdbcType=VARCHAR},
|
|
access_token = #{accessToken,jdbcType=VARCHAR},
|
|
expire_in = #{expireIn,jdbcType=INTEGER},
|
|
refresh_token = #{refreshToken,jdbcType=VARCHAR},
|
|
open_id = #{openId,jdbcType=VARCHAR},
|
|
`uid` = #{uid,jdbcType=VARCHAR},
|
|
access_code = #{accessCode,jdbcType=VARCHAR},
|
|
union_id = #{unionId,jdbcType=VARCHAR},
|
|
`scope` = #{scope,jdbcType=VARCHAR},
|
|
token_type = #{tokenType,jdbcType=VARCHAR},
|
|
id_token = #{idToken,jdbcType=VARCHAR},
|
|
mac_algorithm = #{macAlgorithm,jdbcType=VARCHAR},
|
|
mac_key = #{macKey,jdbcType=VARCHAR},
|
|
code = #{code,jdbcType=VARCHAR},
|
|
oauth_token = #{oauthToken,jdbcType=VARCHAR},
|
|
oauth_token_secret = #{oauthTokenSecret,jdbcType=VARCHAR}
|
|
where id = #{id,jdbcType=INTEGER}
|
|
</update>
|
|
<select id="selectByUuidAndSource" resultMap="BaseResultMap">
|
|
select
|
|
<include refid="Base_Column_List" />
|
|
from third_party_user_info
|
|
where uuid = #{uuid} and `source` = #{source}
|
|
</select>
|
|
<select id="getLastInsertId" resultType="java.lang.Integer">
|
|
SELECT LAST_INSERT_ID();
|
|
</select>
|
|
<select id="getUserBindThirdParties" parameterType="java.lang.Integer" resultMap="BaseResultMap">
|
|
select <include refid="Base_Column_List" /> from third_party_user_info
|
|
where id in (select third_party_user_id from third_party_user_auth_relation where user_id = #{userId,jdbcType=INTEGER})
|
|
</select>
|
|
</mapper> |