<?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.jianshui.invoice.mapper.yuande.InvoiceFormItemMapper">

    <resultMap id="invoiceFromItem" type="com.jianshui.invoice.domain.yuande.Invoiceformitem">
        <result column="quantity" property="quantity__c"></result>
        <result column="price" property="price__c"></result>
        <result column="unit" property="unit__c"></result>
        <result column="product" property="field_E01xD__c"></result>
    </resultMap>
<!--    查询所有-->
    <select id="findAllPushInfo" resultMap="invoiceFromItem" parameterType="list">
        select quantity,
        price,
        unit,
        product
        from invoiceformitem
        where invoiceformid in
        <foreach collection="invoiceformids" item="invoiceformid" separator="," close=")" open="(">
            #{invoiceformid}
        </foreach>
    </select>

<!--    跟据invoiceformid查询所有-->
    <select id="findAllPushInfoWithId" parameterType="string" resultMap="invoiceFromItem">
        select quantity,
        price,
        unit,
        product
        from invoiceformitem
        where invoiceformid = #{id}
    </select>
</mapper>
