<?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.reptileclient.jlifeapp.dao.hm.HmTokenMapper">
    <resultMap id="BaseResultMap" type="com.reptileclient.jlifeapp.entity.hm.HmToken">
        <result column="token" property="token" jdbcType="VARCHAR"/>
        <result column="sub_token" property="subToken" jdbcType="VARCHAR"/>
    </resultMap>

    <insert id="insert" parameterType="java.lang.String">
    insert into hm_token (token)
    values (#{token,jdbcType=VARCHAR})
  </insert>

    <update id="update" parameterType="java.lang.String">
    update hm_token
    set token = #{token,jdbcType=VARCHAR}
  </update>

    <insert id="insertSubToken" parameterType="java.lang.String">
        insert into hm_token (sub_token)
        values (#{subToken,jdbcType=VARCHAR})
    </insert>

    <update id="updateSubToken" parameterType="java.lang.String">
        update hm_token
        set sub_token = #{subToken,jdbcType=VARCHAR}
    </update>

    <select id="selectAll" resultMap="BaseResultMap">
        select  * from hm_token
    </select>

</mapper>