|
|
|
@ -588,11 +588,12 @@
|
|
|
|
|
IFNULL( sum( quantity ), 0 ) |
|
|
|
|
FROM |
|
|
|
|
logpm_distribution_reservation AS ldr |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id AND ldrp.packet_bar_status != 2 AND ldrp.is_deleted = 0 |
|
|
|
|
LEFT JOIN logpm_distribution_reservation_package AS ldrp ON ldr.id = ldrp.reservation_id AND ldrp.packet_bar_status != 2 |
|
|
|
|
AND ldrp.is_deleted = 0 |
|
|
|
|
LEFT JOIN logpm_distribution_parcel_list AS ldpl ON ldrp.parce_list_id = ldpl.id AND ldpl.order_package_status != 70 |
|
|
|
|
<where> |
|
|
|
|
ldr.is_deleted = 0 |
|
|
|
|
AND DATE_FORMAT( ldrp.create_time, "%y%m%d" ) = DATE_FORMAT( now(), "%y%m%d" ) |
|
|
|
|
AND DATE_FORMAT( ldr.create_time, "%y%m%d" ) = DATE_FORMAT( now(), "%y%m%d" ) |
|
|
|
|
AND ldpl.warehouse_id = #{warehouseId} |
|
|
|
|
</where> |
|
|
|
|
) + (SELECT |
|
|
|
|