コード例 #1
0
  /**
   * 查询机构下的所有岗位
   *
   * @param orgid
   * @return
   */
  public OrgPosition[] queryPositionsOfOrg(String orgid) {
    if (StringUtils.isBlank(orgid)) {
      return new OrgPosition[0];
    }

    // 设置查询条件
    IDASCriteria dasCriteria = getDASTemplate().createCriteria(OrgPosition.QNAME);
    dasCriteria.add(ExpressionHelper.eq("orgOrganization.orgid", orgid));
    dasCriteria.add(ExpressionHelper.isNull("orgPosition.positionid"));

    OrgPosition[] positions =
        getDASTemplate().queryEntitiesByCriteriaEntity(OrgPosition.class, dasCriteria);

    return positions;
  }
コード例 #2
0
  /**
   * 查询机构下的所有子机构,参数orgid为空时返回顶级机构
   *
   * @param orgid
   * @return
   */
  public OrgOrganization[] querySubOrgs(String orgid) {
    // 设置查询条件
    IDASCriteria dasCriteria = getDASTemplate().createCriteria(OrgOrganization.QNAME);
    if (StringUtils.isBlank(orgid)) {
      // orgid为空则查询顶级机构
      dasCriteria.add(ExpressionHelper.isNull("orgOrganization"));
    } else {
      dasCriteria.add(ExpressionHelper.eq("orgOrganization.orgid", orgid));
    }

    OrgOrganization[] orgs =
        getDASTemplate().queryEntitiesByCriteriaEntity(OrgOrganization.class, dasCriteria);

    return orgs;
  }