| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?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="com.fs.xiaoshouyi.mapper.XsyAccountMapper">
- <select id="selectList" resultType="com.fs.xiaoshouyi.domain.XsyAccount">
- select
- id,
- account_name as accountName,
- client_id as clientId,
- client_secret as clientSecret,
- redirect_uri as redirectUri,
- instance_uri as instanceUri,
- access_token as accessToken,
- refresh_token as refreshToken,
- expires_at as expiresAt,
- refresh_token_expires_at as refreshTokenExpiresAt,
- status,
- create_time as createTime,
- update_time as updateTime,
- send_user_id as sendUserId
- from xsy_account
- <where>
- <if test="clientId != null and clientId != ''">
- and client_id like concat('%', #{clientId}, '%')
- </if>
- <if test="status != null">
- and status = #{status}
- </if>
- <if test="accountName != null and accountName != ''">
- and account_name like concat('%', #{accountName}, '%')
- </if>
- </where>
- order by id desc
- </select>
- <!-- 查询单个 -->
- <select id="selectById" resultType="com.fs.xiaoshouyi.domain.XsyAccount">
- select
- id,
- account_name as accountName,
- client_id as clientId,
- client_secret as clientSecret,
- redirect_uri as redirectUri,
- instance_uri as instanceUri,
- access_token as accessToken,
- refresh_token as refreshToken,
- expires_at as expiresAt,
- refresh_token_expires_at as refreshTokenExpiresAt,
- status,
- create_time as createTime,
- update_time as updateTime
- from xsy_account
- where id = #{id}
- </select>
- <select id="selectListByIds" resultType="com.fs.xiaoshouyi.domain.XsyAccount">
- select
- id,
- account_name as accountName,
- client_id as clientId,
- client_secret as clientSecret,
- redirect_uri as redirectUri,
- instance_uri as instanceUri,
- access_token as accessToken,
- refresh_token as refreshToken,
- expires_at as expiresAt,
- refresh_token_expires_at as refreshTokenExpiresAt,
- status,
- create_time as createTime,
- update_time as updateTime
- from xsy_account
- where id in
- <foreach collection="ids" item="id" open="(" separator="," close=")">
- #{id}
- </foreach>
- </select>
- <!-- 新增 -->
- <insert id="insert" parameterType="com.fs.xiaoshouyi.domain.XsyAccount">
- insert into xsy_account (
- id,
- account_name,
- client_id,
- client_secret,
- redirect_uri,
- status,
- create_time,
- send_user_id
- ) values (
- #{id},
- #{accountName},
- #{clientId},
- #{clientSecret},
- #{redirectUri},
- #{status},
- now(),
- #{sendUserId}
- )
- </insert>
- <!-- 修改 -->
- <update id="update" parameterType="com.fs.xiaoshouyi.domain.XsyAccount">
- update xsy_account
- <set>
- <if test="accountName != null">account_name = #{accountName},</if>
- <if test="clientId != null">client_id = #{clientId},</if>
- <if test="clientSecret != null">client_secret = #{clientSecret},</if>
- <if test="redirectUri != null">redirect_uri = #{redirectUri},</if>
- <if test="instanceUri != null">instance_uri = #{instanceUri},</if>
- <if test="accessToken != null">access_token = #{accessToken},</if>
- <if test="refreshToken != null">refresh_token = #{refreshToken},</if>
- <if test="expiresAt != null">expires_at = #{expiresAt},</if>
- <if test="refreshTokenExpiresAt != null">refresh_token_expires_at = #{refreshTokenExpiresAt},</if>
- <if test="status != null">status = #{status},</if>
- <if test="sendUserId != null">send_user_id = #{sendUserId},</if>
- update_time = now()
- </set>
- where id = #{id}
- </update>
- <!-- 删除 -->
- <delete id="deleteById">
- delete from xsy_account where id = #{id}
- </delete>
- <update id="updateTokenInfo" parameterType="com.fs.xiaoshouyi.domain.XsyAccount">
- update xsy_account
- <set>
- <if test="instanceUri != null">instance_uri = #{instanceUri},</if>
- <if test="accessToken != null">access_token = #{accessToken},</if>
- <if test="refreshToken != null">refresh_token = #{refreshToken},</if>
- <if test="expiresAt != null">expires_at = #{expiresAt},</if>
- <if test="refreshTokenExpiresAt != null">refresh_token_expires_at = #{refreshTokenExpiresAt},</if>
- update_time = now()
- </set>
- where id = #{id}
- </update>
- </mapper>
|