1、生成同步部门的VIEW:
create or replace view hirisun.v_x3_dept_2_oid as
select 'true' state,'orcladmin' owner, c.fid deptid, c.fdisplayname deptname, f.fid parentid, f.fdisplayname parentname from scmsys.tdept c,scmsys.tdept f
where c.fparentguid = f.fguid and c.fkind = '.DPT'
2、生成用户的VIEW:
CREATE OR REPLACE VIEW HIRISUN.V_X3_USER_2_OID AS
SELECT s.fid userid,s.fdisplayname username,a.fvalue passwd,m.fvalue mobile,
d.fid deptid, d.fdisplayname department,f.fid paraentid,f.fdisplayname parentname
FROM scmsys.torgsystem s,
(SELECT FGUID,FVALUE FROM scmsys.torgattribute WHERE FID = 'PASSWORD') a,
(SELECT FGUID,FVALUE FROM scmsys.torgattribute WHERE lower(FID) = 'emobile') m,
scmsys.tperson p,
scmsys.tdept d,
scmsys.tdept f
WHERE s.fguid = a.fguid(+)
AND s.fguid = m.fguid(+)
AND s.fkind = '.PSN'
AND p.fguid = s.fguid
AND d.fid = p.fdeptid
AND d.fparentguid = f.fguid
ORDER BY userid |