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';
相关文章
- 09-24IO(老杜)
- 09-24【luogu3768】简单的数学题 欧拉函数(欧拉反演)+杜教筛
- 09-24【XSY2731】Div 数论 杜教筛 莫比乌斯反演
- 09-24杜教筛提高
- 09-24习题:DZY Loves Math IV(杜教筛)
- 09-24UOJ#221. 【NOI2016】循环之美 数论,杜教筛
- 09-24【题解】[51Nod 1847] 奇怪的数学题【min_25筛 杜教筛 莫比乌斯反演】
- 09-24社科院中外合作办学硕士|社科院美国杜兰大学能源硕士MME申请流程
- 09-2411.23A T4方(思维好题----杜教筛(总复习))
- 09-24【bzoj 4176】 Lucas的数论 莫比乌斯反演(杜教筛)