<?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.dxhy.erp.dao.AuthRecordDao">
    <insert id="insertAuthRecord" databaseId="mysql">
        insert into t_dx_auth_record
        (
        id,
        batch_no,
        invoice_code,
        invoice_no,
        uuid,
        rzlx,
        apply_tax_period,
        buyer_tax_no,
        yxse,
        create_date,
        customs_code
        ) values
        <foreach collection="list" item="item" index="index" separator=",">
            (
            #{item.id},
            #{item.batchNo},
            #{item.invoiceCode},
            #{item.invoiceNo},
            #{item.uuid},
            #{item.rzlx},
            #{item.applyTaxPeriod},
            #{item.buyerTaxNo},
            #{item.yxse},
            now(),
            #{item.customsCode}
            )
        </foreach>
    </insert>


    <select id="selectCountRecord" resultType="int">
        select count(1)
        from t_dx_auth_record
        where batch_no = #{batchNo}
    </select>

    <insert id="insertAuthRecord" databaseId="oracle">
        insert into t_dx_auth_record
        (
        id,
        batch_no,
        invoice_code,
        invoice_no,
        uuid,
        rzlx,
        apply_tax_period,
        buyer_tax_no,
        yxse,
        create_date,
        customs_code
        ) values
        <foreach collection="list" item="item" index="index" separator=",">
            (
            #{item.id},
            #{item.batchNo},
            #{item.invoiceCode},
            #{item.invoiceNo},
            #{item.uuid},
            #{item.rzlx},
            #{item.applyTaxPeriod},
            #{item.buyerTaxNo},
            #{item.yxse},
            SYSDATE,
            #{item.customsCode}
            )
        </foreach>
    </insert>

</mapper>
