select A.ID,
A.TITLE,
A.MEETINGNAME,
A.USEUSER_NAME,
A.CREATETIME,
V.USETIME
from TZ_APP_MEETING A, vz_app_meeting V
where A.ID = V.ID
and A.STATUS = '7'
and (HZSQL_SUBSTR(A.USEDEPT, 3, 32) = '|deptid|' or
'|userid|' in
(select o.object_id
from TPR_HORIZON_Obj_Role o, TO_HORIZON_ROLE r
where o.role_id = r.id
and o.object_type = 'U'
and r.role_code = 'SYSTEM_ADMINISTRATOR'))
order by A.CREATETIME desc
----------------------代码贴出 菜鸟求教