<?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.UserRecommendMapper">
    <insert id="save">
        insert into user_recommend
        (`user_id`,`mode`,`id`,`deleted`,`create_time`,`update_time`)
        values
        (#{userId},#{mode},#{id},#{deleted},#{createTime},#{updateTime})
    </insert>
    <update id="updateMode">
        update user_recommend
        set `mode`=#{mode}
        where user_id=#{userId}
    </update>

    <select id="findByUserId" resultType="java.lang.Integer">
        select `mode`
        from user_recommend
        where user_id=#{userId}
    </select>
</mapper>
