<?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.DrpDeliveryGoodsDetailMapper">
    <update id="plusDeliveryDetailQualifiedNum">
        UPDATE drp_delivery_goods_detail set inspect_qualified_num = IFNULL(inspect_qualified_num,0) + #{plusNum} where delivery_goods_detail_id = #{deliveryGoodsDetailId};
    </update>
<!--    <select id="listImportDeliveryGoodsDetailById" resultType="net.xnzn.core.drp.vo.DrpImportDeliveryGoodsDetailVO">-->
<!--        SELECT-->
<!--            a.delivery_goods_detail_id,-->
<!--            a.delivery_goods_id,-->
<!--            a.material_id,-->
<!--            b.image_url,-->
<!--            b.material_code,-->
<!--            b.material_name,-->
<!--            b.category_id,-->
<!--            d.category_name,-->
<!--            a.unit_id,-->
<!--            c.unit_name,-->
<!--            a.unit_price,-->
<!--            a.delivery_num-->
<!--        FROM-->
<!--            drp_delivery_goods_detail a-->
<!--            LEFT JOIN menu_material b ON b.material_id = a.material_id-->
<!--            LEFT JOIN drp_unit c ON c.unit_id = a.unit_id-->
<!--            LEFT JOIN menu_material_category d ON d.category_id = b.category_id-->
<!--        WHERE-->
<!--            a.delivery_goods_id = #{deliveryGoodsId}-->
<!--    </select>-->
<!--    <select id="listDeliveryGoodsDetailById" resultType="net.xnzn.core.drp.vo.DrpDeliveryGoodsPageDetailVO">-->
<!--        SELECT-->
<!--        a.delivery_goods_detail_id,-->
<!--        a.delivery_goods_id,-->
<!--        a.material_id,-->
<!--        b.image_url,-->
<!--        b.material_code,-->
<!--        b.material_name,-->
<!--        b.category_id,-->
<!--        d.category_name,-->
<!--        a.unit_id,-->
<!--        c.unit_name,-->
<!--        a.unit_price,-->
<!--        a.order_goods_num,-->
<!--        a.delivery_num,-->
<!--        a.inspect_qualified_num,-->
<!--        e.supplier_id,-->
<!--        f.supplier_name,-->
<!--        b.sales_mode,-->
<!--        round(a.unit_price * a.delivery_num) totalPrice-->
<!--        FROM-->
<!--        drp_delivery_goods_detail a-->
<!--        LEFT JOIN menu_material b ON b.material_id = a.material_id-->
<!--        LEFT JOIN drp_unit c ON c.unit_id = a.unit_id-->
<!--        LEFT JOIN menu_material_category d ON d.category_id = b.category_id-->
<!--        left join drp_delivery_goods e on e.delivery_goods_id = a.delivery_goods_id-->
<!--        left join drp_supplier f on f.supplier_id = e.supplier_id-->
<!--        WHERE-->
<!--        a.delivery_goods_id = #{content.deliveryGoodsId}-->
<!--        <if test="content.drpSourceType != null and content.drpSourceType != ''">-->
<!--            AND (-->
<!--            e.delivery_total_num IS NULL-->
<!--            OR e.inspect_total_num IS NULL-->
<!--            or COALESCE ( e.inspect_total_num, - 1 ) <![CDATA[ < ]]> COALESCE ( e.delivery_total_num, - 1 )-->
<!--            )-->
<!--        </if>-->
<!--        order by b.material_code-->
<!--    </select>-->
<!--    <select id="sumTotalInspectQualifiedNum" resultType="java.math.BigDecimal">-->
<!--        select SUM(inspect_qualified_num) from drp_delivery_goods_detail where delivery_goods_id = #{deliveryGoodsId}-->
<!--    </select>-->
</mapper>
