You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
2.3 KiB
52 lines
2.3 KiB
<?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.epmet.dao.RefreshAuthorizerAccessTokenDao">
|
|
|
|
<resultMap type="com.epmet.entity.RefreshAuthorizerAccessTokenEntity" id="refreshAuthorizerAccessTokenMap">
|
|
<result property="id" column="ID"/>
|
|
<result property="authorizerAccessToken" column="AUTHORIZER_ACCESS_TOKEN"/>
|
|
<result property="expiresIn" column="EXPIRES_IN"/>
|
|
<result property="authorizerRefreshToken" column="AUTHORIZER_REFRESH_TOKEN"/>
|
|
<result property="authAppid" column="AUTH_APPID"/>
|
|
<result property="customerId" column="CUSTOMER_ID"/>
|
|
<result property="delFlag" column="DEL_FLAG"/>
|
|
<result property="createdBy" column="CREATED_BY"/>
|
|
<result property="createdTime" column="CREATED_TIME"/>
|
|
<result property="updatedBy" column="UPDATED_BY"/>
|
|
<result property="updatedTime" column="UPDATED_TIME"/>
|
|
</resultMap>
|
|
|
|
<select id="checkWillOverDue" resultType="com.epmet.dto.result.WillOverDueResultDTO">
|
|
SELECT
|
|
authorizer_access_token AS authorizerAccessToken,
|
|
authorizer_refresh_token AS authorizerRefreshToken,
|
|
auth_appid AS authAppId,
|
|
customer_id AS customerId
|
|
FROM
|
|
refresh_authorizer_access_token
|
|
WHERE
|
|
( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP(NOW()) <![CDATA[ <= ]]> 10
|
|
AND ( UNIX_TIMESTAMP( CREATED_TIME ) + EXPIRES_IN ) - UNIX_TIMESTAMP( NOW()) > 0
|
|
AND del_flag = 0
|
|
</select>
|
|
|
|
<insert id="insertAuthorizerAccessToken" parameterType="com.epmet.dto.form.AuthorizerAccessTokenFormDTO">
|
|
INSERT INTO refresh_authorizer_access_token ( ID, AUTHORIZER_ACCESS_TOKEN, EXPIRES_IN, AUTHORIZER_REFRESH_TOKEN, AUTH_APPID, CUSTOMER_ID, DEL_FLAG, CREATED_BY, CREATED_TIME, UPDATED_BY, UPDATED_TIME )
|
|
VALUES
|
|
(
|
|
REPLACE ( UUID(), '-', '' ),
|
|
#{authorizerAccessToken},
|
|
#{expiresIn},
|
|
#{authorizerRefreshToken},
|
|
#{authAppid},
|
|
#{customerId},
|
|
#{delFlag},
|
|
#{createdBy},
|
|
NOW(),
|
|
#{updatedBy},
|
|
NOW()
|
|
)
|
|
</insert>
|
|
|
|
</mapper>
|