所有者和item

来源:互联网 发布:怎么删除windows账户 编辑:程序博客网 时间:2024/06/14 22:20

select i.pitem_id,r.pitem_revision_id,p2.puid,p2.pobject_type,o.rowning_groupu,o.rowning_useru,u.puser_id,u.puser_name,g.pname
from PITEM i,PITEMREVISION r,PIMANRELATION p1,PWORKSPACEOBJECT p2,PPOM_APPLICATION_OBJECT o,PPOM_USER u,PPOM_GROUP g
where i.puid=r.ritems_tagu and r.puid=p1.rprimary_objectu and p1.rsecondary_objectu=p2.puid and p2.puid=o.puid
and o.rowning_groupu=g.puid and o.rowning_useru=u.puid
and g.pname='汽车电子产品中心' and p2.pobject_type = '产品 Revision Master'


select i.pitem_id,r.pitem_revision_id,u.puser_id,u.puser_name,g.pname
from PITEM i,PITEMREVISION r,PIMANRELATION p1,PWORKSPACEOBJECT p2,PPOM_APPLICATION_OBJECT o,PPOM_USER u,PPOM_GROUP g
where i.puid=r.ritems_tagu and r.puid=p1.rprimary_objectu and p1.rsecondary_objectu=p2.puid and p2.puid=o.puid
and o.rowning_groupu=g.puid and o.rowning_useru=u.puid
and g.pname='汽车电子产品中心' and p2.pobject_type = '产品 Revision Master'


查询最新版本的(带物料描述):另外一个汽车电子的组为 要用min查询出V00版本才能查出item的所有者,可能还有些不一致
---------------------------------------------------------------------------------------------------
产品:
select i.pitem_id,min(r.pitem_revision_id),min(u.puser_id),min(u.puser_name),min(g.pname),min(p.ptb00_sapdesc),min(p.ptb01_sapdesc)
from PITEM i,PITEMREVISION r,PIMANRELATION p1,PWORKSPACEOBJECT p2,PPOM_APPLICATION_OBJECT o,PPOM_USER u,PPOM_GROUP g,
PTB_PRODUCTVERMASTER p,PFORM f
where i.puid=r.ritems_tagu and r.puid=p1.rprimary_objectu and p1.rsecondary_objectu=p2.puid and p2.puid=o.puid 
and o.rowning_groupu=g.puid and o.rowning_useru=u.puid and f.rdata_fileu=p.PUID and p1.rsecondary_objectu=f.puid
and g.pname='汽车电子产品中心' and p2.pobject_type = '产品 Revision Master' and i.pitem_id='41151060A' group by i.pitem_id
-------
硬件:
select i.pitem_id,min(r.pitem_revision_id),min(u.puser_id),min(u.puser_name),min(g.pname),min(p.ptb00_sapdesc),min(p.ptb01_sapdesc)
from PITEM i,PITEMREVISION r,PIMANRELATION p1,PWORKSPACEOBJECT p2,PPOM_APPLICATION_OBJECT o,PPOM_USER u,PPOM_GROUP g,
PTB_HWVERMASTER p,PFORM f
where i.puid=r.ritems_tagu and r.puid=p1.rprimary_objectu and p1.rsecondary_objectu=p2.puid and p2.puid=o.puid 
and o.rowning_groupu=g.puid and o.rowning_useru=u.puid and f.rdata_fileu=p.PUID and p1.rsecondary_objectu=f.puid
and g.pname='汽车电子产品中心' and p2.pobject_type = '硬件 Revision Master' group by i.pitem_id
--------以下只需要将P表改成对应的表即可
软件:PTB_SWVERMASTER
PCB:PTB_PCBVERMASTER
-------
立项:PTB_PROJECTAPPLYVERMASTER
select i.pitem_id,min(r.pitem_revision_id),min(u.puser_id),min(u.puser_name),min(g.pname),min(p.ptb03_projectname),min(p.ptb07_producttype)
from PITEM i,PITEMREVISION r,PIMANRELATION p1,PWORKSPACEOBJECT p2,PPOM_APPLICATION_OBJECT o,PPOM_USER u,PPOM_GROUP g,
PTB_PROJECTAPPLYVERMASTER p,PFORM f
where i.puid=r.ritems_tagu and r.puid=p1.rprimary_objectu and p1.rsecondary_objectu=p2.puid and p2.puid=o.puid 
and o.rowning_groupu=g.puid and o.rowning_useru=u.puid and f.rdata_fileu=p.PUID and p1.rsecondary_objectu=f.puid
and g.pname='汽车电子产品中心' and p2.pobject_type = '立项 Revision Master' group by i.pitem_id


 

0 0
原创粉丝点击