$PBExportHeader$f_cmp_ifemp_oa.srf global type f_cmp_ifemp_oa from function_object end type forward prototypes global function integer f_cmp_ifemp_oa (long arg_docid, long arg_empid) end prototypes global function integer f_cmp_ifemp_oa (long arg_docid, long arg_empid);//判断传入的arg_empid是否arg_docid公文当前审批的人员,如果不是,定义为下级用户的公文 Int if_user //下级用户的公文 Long cnt Select count(*) Into :cnt From oa_doc Inner JOIN oa_doc_flow ON oa_doc.docID = oa_doc_flow.Docid And oa_doc.rowid = oa_doc_flow.rowid Where oa_doc.docID = :arg_docid And oa_doc_flow.Empid = :arg_empid; If sqlca.SQLCode <> 0 Then if_user = 0 Goto ext End If If cnt > 0 Then if_user = 0 Else if_user = 1 End If ext: Return if_user end function