cust_v_tc_bom_impactanalysis-- 杜正东
作者:互联网
create or replace view cust_v_tc_bom_impactanalysis as
Select
occ.puid as occuid,--BOM行uid
pc.PITEM_ID as subid, --子件号
subw.pobject_name as subname, --子件名
'' as subver,--子件版本,
occ.ruom_tagu as bom_uom, --BOM度量单位
subw.pobject_type as subitemtype, --子件对象类型
ps.PITEM_ID as superid, --父级件号
pv.PITEM_REVISION_ID as superver, --父级版本
supw.pobject_type as supitemtype, --父级对象类型
To_Number(Decode(occ.PQTY_VALUE, -1, 1, occ.PQTY_VALUE)) as qty --数量
From INFODBA.PPSOCCURRENCE occ,
INFODBA.PITEM ps,
INFODBA.PITEM pc,
INFODBA.PPSBOMVIEW b,
INFODBA.PPSBOMVIEWREVISION bv,
INFODBA.PSTRUCTURE_REVISIONS sv,
INFODBA.PITEMREVISION pv,
INFODBA.PWORKSPACEOBJECT subw,
INFODBA.PWORKSPACEOBJECT supw
Where occ.RPARENT_BVRU = bv.PUID
And bv.RBOM_VIEWU = b.PUID
And b.RPARENT_ITEMU = ps.PUID
And occ.RCHILD_ITEMU = pc.PUID
And sv.PVALU_0 = bv.PUID
And pv.PUID = sv.PUID
and subw.puid = pc.puid
and ps.puid = supw.puid
--and pc.pitem_id = 'Y4G31-6050-4040-3-1'
union
---BOM查询,精确BOM
Select
occ.puid as occuid,--BOM行uid
pc.PITEM_ID as subid, --子件号
subw.POBJECT_NAME as subname, --子件名
pcv.pitem_revision_id as subver,--子件版本
occ.ruom_tagu as bom_uom, --BOM度量单位
subw.pobject_type as subitemtype, --子件对象类型
ps.PITEM_ID as superid, --父级件号
pv.PITEM_REVISION_ID as superver, --父级版本
supw.pobject_type as supitemtype, --父级对象类型
To_Number(Decode(occ.PQTY_VALUE, -1, 1, occ.PQTY_VALUE)) as qty --数量
From INFODBA.PPSOCCURRENCE occ,
INFODBA.PITEM ps,
INFODBA.PITEM pc,
INFODBA.PPSBOMVIEW b,
INFODBA.PPSBOMVIEWREVISION bv,
INFODBA.PSTRUCTURE_REVISIONS sv,
INFODBA.PITEMREVISION pv,
INFODBA.PITEMREVISION pcv,
INFODBA.PWORKSPACEOBJECT subw,
INFODBA.PWORKSPACEOBJECT supw
Where
occ.RPARENT_BVRU = bv.PUID
And bv.RBOM_VIEWU = b.PUID
And b.RPARENT_ITEMU = ps.PUID
And occ.RCHILD_ITEMU = pcv.PUID
And pcv.ritems_tagu = pc.puid
And sv.PVALU_0 = bv.PUID
And pv.PUID = sv.PUID
And subw.PUID = pc.PUID
and ps.puid = supw.puid
--and pc.pitem_id = '004149';
标签:PITEM,cust,pc,--,occ,INFODBA,PUID,bom 来源: https://www.cnblogs.com/PLM-Teamcenter/p/15915543.html