OAuth2SecretMapper.xml
1.29 KB
<?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="cn.runsa.portal.base.dao.OAuth2SecretMapper">
<cache eviction="LRU" flushInterval="60000" size="512" readOnly="true"/>
<resultMap type="cn.runsa.portal.base.entity.OAuth2Secret" id="oAuth2Secret">
<id property="id" column="osId"/>
<result property="clientId" column="ocId"/>
<result property="name" column="osName"/>
<result property="secret" column="osSecret"/>
<result property="validBegin" column="osValidBegin"/>
<result property="validEnd" column="osValidEnd"/>
<result property="method" column="osMethod"/>
<result property="meId" column="meId"/>
<result property="upTime" column="ptUpTime"/>
<result property="updater" column="ptUpdater"/>
</resultMap>
<select id="exists" resultType="Boolean">
select count(*)
from smOAuthSecret
where ocId=#{clientId} and osSecret=#{secret} and #{nowTime} between ifnull(osValidBegin,#{nowTime}) and ifnull(osValidEnd,#{nowTime})
</select>
<select id="selectById" resultMap="oAuth2Secret">
select *
from smOAuthSecret
where ocId=#{clientId} and osSecret=#{secret} and #{nowTime} between ifnull(osValidBegin,#{nowTime}) and ifnull(osValidEnd,#{nowTime})
</select>
</mapper>