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

    <select id="selectRepeat" parameterType="string" resultType="string">
        SELECT CONCAT(vr.bukrs,vr.belnr,vr.gjahr) from
        voucher_record vr where CONCAT(vr.bukrs,vr.gjahr,vr.monat) = #{belnr}
    </select>
    <select id="selectRepeatByBelnr" parameterType="collection" resultType="string">
        select id from voucher_record where CONCAT(bukrs,belnr,gjahr) in
        <foreach collection="belnrs" item="belnr" open="(" close=")" separator=",">
            #{belnr}
        </foreach>
    </select>

    <delete id="deleteBatch" parameterType="string">
        delete from voucher_record  where
        <foreach collection="deleteKeys" item="key" separator="or" index="index">
            <if test="key.bukrs">
                bukrs= #{key.bukrs}
            </if>
            <if test="key.belnr">
                and belnr = #{key.belnr}
            </if>
            <if test="key.gjahr">
                and gjahr = #{key.gjahr}
            </if>
        </foreach>
    </delete>


</mapper>
