xufenglei
2018-07-02 62520477e6ac5fc8ccce28fdb69ec26246a4a37b
src/main/java/com/moral/service/impl/OrganizationServiceImpl.java
@@ -40,7 +40,7 @@
       if (IS_DELETE_FALSE.equals(organization.getIsDelete())) {
          List<OrganizationRelation> organizationRelations = organizationRelationMapper.select(relation);
          for (OrganizationRelation organizationRelation : organizationRelations) {
             Set<Integer> organizationIds = getChildOrganizationIds(organizationRelation.getParentId());
             Set<Integer> organizationIds = getChildOrganizationIds(organizationRelation.getChildId());
             orgIds.addAll(organizationIds);
          }
      }
@@ -68,7 +68,7 @@
      if(pageBean.getPageSize()>0){
         PageHelper.startPage(pageBean.getPageIndex(),pageBean.getPageSize());
      }
      if(example.getOrderByClause().isEmpty()) {
      if(example.getOrderByClause() == null || example.getOrderByClause().isEmpty()) {
         example.setOrderByClause("create_time desc");
      }
      List<Organization> organizationList = organizationMapper.selectWithAreaNameByExample(example);
@@ -119,4 +119,11 @@
      return organizations;
   }
   @Override
   public Organization getOrganizationsById(int id) {
       Example example = new Example(ENTITY_CLASS);
       example.or().andEqualTo("id",id);
       List<Organization> organizationList = organizationMapper.selectWithAreaNameByExample(example);
      return organizationList.size()>0?organizationList.get(0):null;
   }
}