| | |
| | | p.product_name, |
| | | sl.customer_name, |
| | | spd.totalQuantity, |
| | | sor.outboundBatches |
| | | sor.outboundBatches, |
| | | pl.purchase_contract_number |
| | | FROM shipping_info s |
| | | LEFT JOIN (select shipping_info_id,sum(quantity) totalQuantity from shipping_product_detail GROUP BY shipping_info_id) spd ON spd.shipping_info_id = s.id |
| | | LEFT JOIN sales_ledger sl ON s.sales_ledger_id = sl.id |
| | | LEFT JOIN purchase_ledger pl ON sl.purchase_ledger_id = pl.id |
| | | LEFT JOIN sales_ledger_product slp ON s.sales_ledger_product_id = slp.id and slp.type = 1 |
| | | left join product_model pm on slp.product_model_id = pm.id |
| | | left join product p on pm.product_id = p.id |
| | |
| | | <if test="req.expressNumber != null and req.expressNumber != ''"> |
| | | AND s.express_number LIKE CONCAT('%',#{req.expressNumber},'%') |
| | | </if> |
| | | <if test="req.customerId != null"> |
| | | AND sl.customer_id = #{req.customerId} |
| | | </if> |
| | | order by create_time DESC |
| | | </select> |
| | | <select id="listAll" resultType="com.ruoyi.sales.pojo.ShippingInfo"> |