public String filedutyofficer() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     int rowCount;
     Sort sort;
     Limit limit;
     C_T_SYS_FiledutyofficerMapper mapper =
         sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
     C_T_SYS_FiledutyofficerExample example = new C_T_SYS_FiledutyofficerExample();
     Criteria criteria = example.createCriteria();
     if (NameS != null && !"".equals(NameS.trim())) {
       criteria.andFiledutyofficerNameLike("%" + NameS + "%");
     }
     rowCount = mapper.countByExample(example);
     limit = DbOperationFation.GetECSideInfo(rowCount);
     if (rowCount != 0) {
       criteria.setLimitValue(limit.getRowStart() + 1, limit.getRowEnd());
     }
     sort = limit.getSort();
     if (sort.getAlias() != null) {
       example.setOrderByClause(sort.getAlias() + " " + sort.getSortOrder());
     } else {
       example.setOrderByClause("sort");
     }
     example.or(criteria);
     list_C_T_SYS_Filedutyofficer = mapper.selectByExample(example);
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   // allPermission =
   // WorkflowengineCommon.GetAllPermissions("module03010405",filetypeId,sqlSession);
   return SUCCESS;
 }
Example #2
0
  public String deptuserListLoad() throws Exception {

    int rowCount;
    Sort sort;
    Limit limit;
    SqlSession sqlSession = null;
    try {
      sqlSession = DbSessionFactory.getOracleSession();
      C_V_Sys_Dept_UserMapper mapper = sqlSession.getMapper(C_V_Sys_Dept_UserMapper.class);
      // 创建查询条件
      C_V_Sys_Dept_UserExample example = new C_V_Sys_Dept_UserExample();
      Criteria criteria = example.createCriteria();

      // 添加页面查询条件
      if (UserNameS != null && !"".equals(UserNameS.trim())) {
        // criteria.andUserNameEqualTo(UserNameS);
        criteria.andUserSysNameLike("%" + UserNameS + "%");
      }

      if (DeptNameS != null && !"".equals(DeptNameS.trim())) {
        criteria.andDeptIdEqualTo(DeptNameS);
      }

      // 取得总的记录条数
      rowCount = mapper.countByExample(example);

      // 取得ECSide信息
      limit = DbOperationFation.GetECSideInfo(rowCount);

      // 如果记录集为空,则不分页查询
      if (rowCount != 0) {
        // 在条件中设置起始数和结束数
        criteria.setLimitValue(limit.getRowStart() + 1, limit.getRowEnd());
      }

      // 如果有排序则设置排序
      sort = limit.getSort();
      if (sort.getAlias() != null) {
        example.setOrderByClause(sort.getAlias() + " " + sort.getSortOrder());
      }

      // 将所有的条件放到条件集合中
      example.or(criteria);

      // 根据条件取得流程基本信息列表
      list_C_T_Sys_Dept_User = mapper.selectByExample(example);

      // 取得部门基本信息
      listDept = GetBaseInfor.getDepartmentBaseInfor("sort", sqlSession);
      // 取得当前用户的权限
      curUserRole = WorkflowengineCommon.GetCurUserRole("", sqlSession);
      allPermission = "*";
    } catch (Exception e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
      return ERROR;
    } finally {
      if (sqlSession != null) {
        sqlSession.close();
        sqlSession = null;
      }
    }
    return SUCCESS;
  }