<?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">
<!-- 命名，每一个映射对象不一样
	namespace:必须与对应的接口全类名一致
 -->
<mapper namespace="com.iamberry.wechat.service.mapper.TokenMapper">
	<!-- 获取token -->
	<select id="selectOne" resultType="Token" parameterType="String">
		SELECT 
			T_ID tokenId, T_TOKEN token, T_ENDDATE endDate, T_APPID appid
		FROM 
			TB_WX_TOKEN 
		WHERE 
			T_APPID = #{appid}
	</select>
	<!-- 更新token -->
	<update id="updateToken" parameterType="Token">
		UPDATE 
			TB_WX_TOKEN 
		SET 
			T_TOKEN=#{token}, T_ENDDATE=#{endDate} 
		WHERE 
			T_APPID = #{appid}
	</update>
</mapper>
