<?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="getByLogisticsInfoId" resultType="com.fjhx.params.stock.GetLogisticsDetailsVo">
        select ld.id                   id,
               ld.shipment_quantity    shipmentQuantity,
               ld.receipt_quantity     receiptQuantity,
               ap.quantity             purchaseQuantity,
               ap.receipt_warehouse_id receiptWarehouseId,
               pi.id                   goodsId,
               pi.code                 goodsCode,
               pi.name                 goodsName
        from logistics_details ld
                 left join apply_purchase ap on ap.id = ld.apply_purchase_id
                 left join product_info pi on pi.id = ap.goods_id
        where ld.logistics_info_id = #{logisticsInfoId}
    </select>

</mapper>
