<?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.fjhx.mapper.logistics.LogisticsDetailsMapper">

    <select id="getLogisticsDetailsByLogisticsId" resultType="java.util.LinkedHashMap">
        select ld.id,
               ap.code     applyPurchaseCode,
               pi.code     productCode,
               pi.name     productName,
               pi.type     productType,
               ap.receipt_warehouse_id warehouseId,
               w.name      warehouseName,
               ap.quantity applyPurchaseQuantity,
               ld.shipment_quantity shipmentQuantity
        from logistics_details ld
                 left join apply_purchase ap on ld.apply_purchase_id = ap.id
                 left join product_info pi on ap.goods_id = pi.id
                 left join warehouse w on ap.receipt_warehouse_id = w.id
            ${ew.customSqlSegment}
    </select>

</mapper>
