<?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=".dao.InvoiceBackDao">

    <resultMap type=".entity.InvoiceBack" id="InvoiceBackMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="systemOrderno" column="system_orderno" jdbcType="VARCHAR"/>
        <result property="status" column="status" jdbcType="VARCHAR"/>
        <result property="backUrl" column="back_url" jdbcType="VARCHAR"/>
        <result property="identity" column="identity" jdbcType="VARCHAR"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="backMsg" column="back_msg" jdbcType="VARCHAR"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into jianshui_dev.invoice_back(system_ordernostatusback_urlidentitycreate_timeback_msg)
        values
        <foreach collection="entities" item="entity" separator=",">
        (#{entity.systemOrderno}#{entity.status}#{entity.backUrl}#{entity.identity}#{entity.createTime}#{entity.backMsg})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into jianshui_dev.invoice_back(system_ordernostatusback_urlidentitycreate_timeback_msg)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.systemOrderno}#{entity.status}#{entity.backUrl}#{entity.identity}#{entity.createTime}#{entity.backMsg})
        </foreach>
        on duplicate key update
system_orderno = values(system_orderno) status = values(status) back_url = values(back_url) identity = values(identity) create_time = values(create_time) back_msg = values(back_msg)     </insert>

</mapper>

