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


    <select id="pageInspectGoodsDetail" resultType="com.bonus.canteen.core.supply.purchase.domain.vo.DrpInspectGoodsDetailPageVO">
        SELECT
            a.id,
            a.inspect_goods_id,
            a.inspect_goods_detail_id,
            a.material_id,
            b.material_name,
            b.material_code,
            d.category_name,
            c.unit_id,
            c.unit_name,
            a.unit_price,
            a.order_num,
            a.delivery_num,
            a.total_qualified_num,
            a.qualified_num,
            a.unqualified_reason,
            a.image_url,
            a.check_pic_urls
        FROM
            drp_inspect_goods_detail a
            LEFT JOIN menu_material b ON b.material_id = a.material_id
            LEFT JOIN drp_unit c ON c.unit_id = b.unit_id
            LEFT JOIN menu_material_category d ON d.category_id = b.category_id
        WHERE
            a.inspect_goods_id = #{content.inspectGoodsId}
    </select>
</mapper>
