| | |
| | | t1.outbound_order_detail_id outboundOrderDetailId, |
| | | t8.id equipmentId, |
| | | t1.is_lock isLock, |
| | | IFNULL(t5.use_quantity,0) useQuantity, |
| | | IFNULL(t5.outbound_main_quantity,0) mainQuantity, |
| | | (IFNULL(t5.outbound_main_quantity,0)-IFNULL(t5.use_quantity,0)) as availableQuantity |
| | | ISNULL(t5.use_quantity,0) useQuantity, |
| | | ISNULL(t5.outbound_main_quantity,0) mainQuantity, |
| | | (ISNULL(t5.outbound_main_quantity,0)-ISNULL(t5.use_quantity,0)) as availableQuantity |
| | | |
| | | |
| | | FROM mom_eam_repair_order_actual_material t1 |
| | |
| | | LEFT JOIN mom_eam_spare_part t2 on t2.id = t1.spare_part_id |
| | | LEFT JOIN mom_base_constructor t3 on t3.id = t2.constructor_id |
| | | LEFT JOIN mom_eam_spare_part_outbound t4 on t4.id = t1.outbound_order_id |
| | | LEFT JOIN mom_eam_spare_part_outbound_detail t5 on t5.spare_part_outbound_id = t4.id |
| | | -- LEFT JOIN mom_eam_spare_part_outbound_detail t5 on t5.spare_part_outbound_id = t4.id |
| | | LEFT JOIN mom_base_unit t6 on t6.id = t2.main_unit_id |
| | | LEFT JOIN mom_eam_report_after_repair t7 on t7.id = t1.report_after_repair_id |
| | | LEFT JOIN mom_eam_equipment t8 on t8.id = t7.equipment_id |