日期:2014-05-16 浏览次数:20750 次
select * from (
select vd.id as doorid, /*文档ID*/
vd.docsubject as subject, /*文档标题*/
vd.doccontent as doccontent, /*文档内容*/
vd.createdatetime as datecreated, /*创建日期*/
r.orgid,r.parentid from v_docdetail vd inner join doc_sharedetail s on(vd.id=s.docid) inner join orgunitrelate r on(s.orgid=r.orgid)
where vd.docstatus not in(0,5,6) and r.orgid in(select orgid from orgunitrelate start with orgid=183 connect by prior parentid=orgid)
union all
select vd.id as doorid, /*文档ID*/
vd.docsubject as subject, /*文档标题*/
vd.doccontent as doccontent, /*文档内容*/
vd.createdatetime as datecreated, /*创建日期*/
null orgid,null parentid from v_docdetail vd inner join doc_sharedetail s on(vd.id=s.docid)
where vd.docstatus not in(0,5,6) and s.isalluser=1 or s.userid=1658
union all
select vd.id as doorid, /*文档ID*/
vd.docsubject as subject, /*文档标题*/
vd.doccontent as doccontent, /*文档内容*/
vd.createdatetime as datecreated, /*创建日期*/
null orgid,null parentid from v_docdetail vd where vd.docstatus not in(0,5,6) and 1=1658
union all
select * from (
select vd.id as doorid, /*文档ID*/
vd.docsubject as subject, /*文档标题*/
vd.doccontent as doccontent, /*文档内容*/
vd.createdatetime as datecreated, /*创建日期*/
re.childid orgid,re.roleid parentid from v_docdetail vd inner join doc_sharedetail s on( vd.docstatus not in(0,5,6) and vd.id=s.docid)
inner join hrmrolerelation re on(s.