Ejemplo n.º 1
0
 public String fileDutyOfficerUpdate() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     C_T_SYS_Filedutyofficer record = new C_T_SYS_Filedutyofficer();
     C_T_SYS_FiledutyofficerMapper mapper =
         sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
     if (null == c_T_SYS_Filedutyofficer.getFiledutyofficerId()
         || "".equals(c_T_SYS_Filedutyofficer.getFiledutyofficerId().trim())) {
       c_T_SYS_Filedutyofficer.setFiledutyofficerId((new GUID().toString()));
       DbSetData.setPerporyData(c_T_SYS_Filedutyofficer, record, 2);
       mapper.insertSelective(record);
     } else {
       DbSetData.setPerporyData(c_T_SYS_Filedutyofficer, record, 1);
       mapper.updateByPrimaryKey(record);
     }
     jsonResult = Constants.DISP_OPERATION_SUCCESSFUL;
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   return SUCCESS;
 }
Ejemplo n.º 2
0
 public String filedutyofficerDelete() throws Exception {
   SqlSession sqlSession = null;
   try {
     sqlSession = DbSessionFactory.getOracleSession();
     if (!"".equals(checkedIds)) {
       String[] arrUuids;
       arrUuids = checkedIds.split("%2C");
       C_T_SYS_FiledutyofficerExample example = new C_T_SYS_FiledutyofficerExample();
       C_T_SYS_FiledutyofficerMapper mapper =
           sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
       for (String tempUuid : arrUuids) {
         example.or().andFiledutyofficerIdEqualTo(tempUuid);
       }
       mapper.deleteByExample(example);
     }
     jsonResult = Constants.DISP_OPERATION_SUCCESSFUL;
     sqlSession.commit();
   } catch (Exception e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
     return ERROR;
   } finally {
     if (sqlSession != null) {
       sqlSession.close();
       sqlSession = null;
     }
   }
   allPermission = "*";
   return SUCCESS;
 }
Ejemplo n.º 3
0
 public String fileDutyOfficerDetailsLoad() throws Exception {
   SqlSession sqlSession = null;
   sqlSession = DbSessionFactory.getOracleSession();
   C_T_SYS_FiledutyofficerMapper mapper =
       sqlSession.getMapper(C_T_SYS_FiledutyofficerMapper.class);
   c_T_SYS_Filedutyofficer = mapper.selectByPrimaryKey(filetypeId);
   JSONObject jo = JSONObject.fromObject(c_T_SYS_Filedutyofficer);
   this.jsonResult = jo.toString();
   sqlSession.commit();
   // allPermission =
   // WorkflowengineCommon.GetAllPermissions("module03010405",filetypeId,sqlSession);
   allPermission = "*";
   sqlSession.close();
   sqlSession = null;
   return SUCCESS;
 }
Ejemplo n.º 4
0
 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;
 }