<?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.RefundVoucherMapper">

    <resultMap type="com.ylx.massage.domain.RefundVoucher" id="RefundVoucherMap">
        <result property="id" column="id" jdbcType="VARCHAR"/>
        <result property="refundNo" column="refund_no" jdbcType="VARCHAR"/>
        <result property="openId" column="open_id" jdbcType="VARCHAR"/>
        <result property="money" column="money" jdbcType="NUMERIC"/>
        <result property="orderNo" column="order_no" jdbcType="VARCHAR"/>
        <result property="reason" column="reason" jdbcType="VARCHAR"/>
        <result property="reStatus" column="re_status" jdbcType="INTEGER"/>
        <result property="isDelete" column="is_delete" jdbcType="INTEGER"/>
        <result property="createTime" column="create_time" jdbcType="TIMESTAMP"/>
        <result property="updateTime" column="update_time" jdbcType="TIMESTAMP"/>
    </resultMap>

    <!-- 批量插入 -->
    <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true">
        insert into ry-vue.refund_voucher(refund_noopen_idmoneyorder_noreasonre_statusis_deletecreate_timeupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.refundNo}#{entity.openId}#{entity.money}#{entity.orderNo}#{entity.reason}#{entity.reStatus}#{entity.isDelete}#{entity.createTime}#{entity.updateTime})
        </foreach>
    </insert>
    <!-- 批量插入或按主键更新 -->
    <insert id="insertOrUpdateBatch" keyProperty="id" useGeneratedKeys="true">
        insert into ry-vue.refund_voucher(refund_noopen_idmoneyorder_noreasonre_statusis_deletecreate_timeupdate_time)
        values
        <foreach collection="entities" item="entity" separator=",">
            (#{entity.refundNo}#{entity.openId}#{entity.money}#{entity.orderNo}#{entity.reason}#{entity.reStatus}#{entity.isDelete}#{entity.createTime}#{entity.updateTime})
        </foreach>
        on duplicate key update
        refund_no = values(refund_no) open_id = values(open_id) money = values(money) order_no = values(order_no) reason
        = values(reason) re_status = values(re_status) is_delete = values(is_delete) create_time = values(create_time)
        update_time = values(update_time)
    </insert>

</mapper>

