方式一:SQL语句查询
SELECT FToUnitID--被委托的组织id
FROM T_ORG_UnitRelation--组织单元关系表
WHERE FTypeRelationID = (
SELECT fid
FROM T_ORG_TypeRelation--组织类型关系表
WHERE ffromtype = 委托的组织枚举值
AND ftotype = 被委托的组织枚举值
)
AND FFromUnitID = '委托的组织id'
组织类型的枚举值:
方法二:使用java方法查询
try {
// 获取前端请求
HttpServletRequest request = event.getReqeustContext().getHttpServletRequest();
// 返回map
Map map = new HashMap();
// 委托组织id
String id = request.getParameter("useDepartmentID");
// 获得委托的组织与被委托组织的关系
OrgTypeRelationInfo relation = OrgTypeRelationFactory.getRemoteInstance().getOrgTypeRelationInfo("where fromType = 委托的组织枚举值 and toType = 被委托的组织枚举值");
// 获取委托组织
AdminOrgUnitInfo info = AdminOrgUnitFactory.getRemoteInstance().getAdminOrgUnitInfo(new ObjectUuidPK(id));
// 组织关系远程接口
IOrgUnitRelation