<?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.example.his.api.db.dao.CustomerImDao">

    <resultMap id="BaseResultMap" type="com.example.his.api.db.pojo.CustomerImEntity">
            <id property="id" column="id" jdbcType="INTEGER"/>
            <result property="customerId" column="customer_id" jdbcType="INTEGER"/>
            <result property="loginTime" column="login_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <!--  IM-客服新增  -->
    <insert id="insertCustomerIM" parameterType="int">
        INSERT INTO tb_customer_im
        SET customer_id = #{customerId},
            login_time = NOW()
        ON DUPLICATE KEY UPDATE login_time = NOW()
    </insert>

</mapper>
