|
@@ -3,7 +3,20 @@
|
|
|
<mapper namespace="cn.com.ctop.job.kuaishou.data.mapper.OauthTokenMapper">
|
|
<mapper namespace="cn.com.ctop.job.kuaishou.data.mapper.OauthTokenMapper">
|
|
|
|
|
|
|
|
<select id="getByAccountId" resultType="java.lang.String">
|
|
<select id="getByAccountId" resultType="java.lang.String">
|
|
|
- SELECT access_token from `jeecg-boot`.ctop_oauth_token WHERE account_id = #{accountId}
|
|
|
|
|
|
|
+ SELECT
|
|
|
|
|
+ (CASE
|
|
|
|
|
+ WHEN
|
|
|
|
|
+ t2.access_token IS NOT NULL
|
|
|
|
|
+ THEN t2.access_token
|
|
|
|
|
+ ELSE
|
|
|
|
|
+ t1.access_token
|
|
|
|
|
+ END
|
|
|
|
|
+ ) as 'access_token'
|
|
|
|
|
+ FROM
|
|
|
|
|
+ `jeecg-boot`.ctop_oauth_token t1
|
|
|
|
|
+ LEFT JOIN `jeecg-boot`.ctop_oauth_agent_token t2 ON t1.app_id = t2.app_id
|
|
|
|
|
+ WHERE
|
|
|
|
|
+ t1.account_id = #{accountId}
|
|
|
</select>
|
|
</select>
|
|
|
|
|
|
|
|
|
|
|