TokenMapper.xml 672 B

12345678910111213
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace = "com.fuzamei.mapperInterface.TokenInterface">
  4. <select id="getTokenById" parameterType="com.fuzamei.entity.Token" resultType="com.fuzamei.entity.Token">
  5. select * from token where user_id = #{userId};
  6. </select>
  7. <insert id="insertToken" parameterType="com.fuzamei.entity.Token">
  8. insert into token(user_id,token)values(#{userId},#{token});
  9. </insert>
  10. <update id="updateToken" parameterType="com.fuzamei.entity.Token">
  11. update token set token = #{token} where user_id = #{userId};
  12. </update>
  13. </mapper>