<?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.bonus.canteen.core.supply.purchase.mapper.DrpPurchaseQuoteMapper">

    <select id="listExcelDetail" resultType="com.bonus.canteen.core.supply.purchase.domain.vo.DrpExcelQuoteDetailVO">
        select
            d.material_name ,
            e.category_name ,
            c.unit_name ,
            b.pur_num ,
            b.size ,
            b.notes ,
            a.quote_num ,
            a.total_price as neTotalPrice ,
            a.single_price as neSinglePrice
        from drp_quote a
        left join drp_inquiry_detail b on a.inquiry_detail_id = b.inquiry_detail_id
        left join drp_unit c on b.unit_id = c.unit_id
        left join menu_material d on d.material_id = b.material_id
        left join menu_material_category e on e.category_id = d.category_id
        where
        a.inquiry_supplier_id = #{inquirySupplierId}
    </select>
    <select id="querySupplierQuoteDetail" resultType="com.bonus.canteen.core.supply.purchase.domain.vo.DrpQuerySupplierQuoteDetailVO">
        SELECT
            a.quote_id,
            b.material_id,
            c.material_code,
            c.material_name,
            c.category_id,
            e.category_name,
            b.unit_id,
            d.unit_name,
            b.size,
            a.single_price,
            a.quote_num purNum,
            a.total_price,
            c.image_url
        FROM
            drp_quote a
            LEFT JOIN drp_inquiry_detail b ON b.inquiry_detail_id = a.inquiry_detail_id
            LEFT JOIN menu_material c ON c.material_id = b.material_id
            LEFT JOIN drp_unit d ON d.unit_id = b.unit_id
            LEFT JOIN menu_material_category e ON e.category_id = c.category_id
        WHERE
            a.inquiry_supplier_id = #{inquirySupplierId}
    </select>

</mapper>


