|
#2 的理解比较费力,以下简化的代码,测试过,数据和FORM上的一致
select connect_by_isleaf isleaf, v.*
from (select bbo.assembly_item_id,
bic.component_item_id,
bic.component_quantity,
bic.wip_supply_type,
bic.supply_subinventory
from bom_bill_of_materials bbo, bom_inventory_components bic
where bbo.bill_sequence_id = bic.bill_sequence_id
and bbo.organization_id = 10 --OU 参数
and bbo.alternate_bom_designator is null
--只选取已实施的物料,未实施的eco该字段均为空值
and bic.implementation_date is not null
--排除eco禁用物料已实施或bom物料失效
and bic.effectivity_date < sysdate
and nvl(bic.disable_date, sysdate + 1) > sysdate) v
start with v.assembly_item_id = 11111 -- item_id 参数
connect by prior v.component_item_id = v.assembly_item_id |
|