<?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.ylx.massage.mapper.THighlightsMapper">

    <resultMap type="com.ylx.massage.domain.THighlights" id="THighlightsMap">
        <result property="cId" column="c_id" jdbcType="VARCHAR"/>
        <result property="cDescribe" column="c_describe" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="cId" useGeneratedKeys="true">
        insert into ry-vue.t_highlights(c_describecreate_timeupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.cDescribe}#{entity.createTime}#{entity.updateTime})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="cId" useGeneratedKeys="true">
        insert into ry-vue.t_highlights(c_describecreate_timeupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.cDescribe}#{entity.createTime}#{entity.updateTime})
        </foreach>
        on duplicate key update
        c_describe = values(c_describe) create_time = values(create_time) update_time = values(update_time)
    </insert>

</mapper>

