<?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.ruoyi.web.modules.diagnosis.mapper.BizConsultUserMapper">

    <resultMap type="com.ruoyi.web.modules.diagnosis.domain.BizConsultUser" id="BizConsultUserResult">
        <id     property="userId"       column="user_id"/>
        <result property="firstUseTime" column="first_use_time"/>
        <result property="lastUseTime"  column="last_use_time"/>
    </resultMap>

    <select id="selectByUserId" resultMap="BizConsultUserResult">
        select user_id, first_use_time, last_use_time
        from biz_consult_user
        where user_id = #{userId}
    </select>

    <insert id="insertBizConsultUser" parameterType="com.ruoyi.web.modules.diagnosis.domain.BizConsultUser">
        insert into biz_consult_user (user_id, first_use_time, last_use_time)
        values (#{userId}, #{firstUseTime}, #{lastUseTime})
    </insert>

    <update id="updateLastUseTime">
        update biz_consult_user
        set last_use_time = #{lastUseTime}
        where user_id = #{userId}
    </update>
</mapper>
