<?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.hzs.member.account.mapper.CuMemberRechargeDetailMapper">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hzs.common.domain.member.account.CuMemberRechargeDetail">
        <result column="CREATION_TIME" property="creationTime"/>
        <result column="DEL_FLAG" property="delFlag"/>
        <result column="PK_CREATOR" property="pkCreator"/>
        <result column="PK_ID" property="pkId"/>
        <result column="RECHARGE_CODE" property="rechargeCode"/>
        <result column="PAYMENT_METHOD" property="paymentMethod"/>
        <result column="PAYMENT_AMOUNT" property="paymentAmount"/>
        <result column="PAYMENT_BALANCE" property="paymentBalance"/>
        <result column="PAYMENT_BEFORE_BALANCE" property="paymentBeforeBalance"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        CREATION_TIME,
        DEL_FLAG,
        PK_CREATOR,
        PK_ID, PK_MEMBER_RECHARGE, PAYMENT_METHOD, PAYMENT_AMOUNT
    </sql>

    <insert id="batchSaveMemberRechargeDetail" parameterType="com.hzs.common.domain.member.account.CuMemberRechargeDetail">
        insert into CU_MEMBER_RECHARGE_DETAIL (PK_ID, RECHARGE_CODE, PAYMENT_METHOD, PAYMENT_AMOUNT,PK_CREATOR,PAYMENT_BALANCE,PAYMENT_BEFORE_BALANCE)
        SELECT cu_member_recharge_detail_seq.nextval,d.* FROM
        (
        <foreach collection="cuMemberRechargeDetails" item="item" separator="UNION ALL">
            SELECT #{item.rechargeCode},#{item.paymentMethod},#{item.paymentAmount} ,#{item.pkCreator},#{item.paymentBalance},#{item.paymentBeforeBalance}
            FROM dual
        </foreach>
        ) d
    </insert>

</mapper>
