<?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.reghao.tnb.user.app.db.mapper.UserVipMapper">
    <insert id="save">
        insert into user_vip
        (`user_id`,`expire_at`,`rcmd_mode`)
        values
        (#{userId},#{expireAt},#{rcmd_mode})
    </insert>

    <select id="updateUserVip">
        update user_vip
        set expire_at=#{expireAt}
        where user_id=#{userId}
    </select>
    <select id="updateRcmdMode">
        update user_vip
        set rcmd_mode=#{rcmdMode}
        where user_id=#{userId}
    </select>

    <select id="findByUserId" resultType="cn.reghao.tnb.user.app.model.po.UserVip">
        select *
        from user_vip
        where user_id=#{userId}
    </select>
</mapper>
