/** * 查询列表 * * @param entity * @return */ public ResultData list(Greade greade) { ResultData resultData = new ResultData(); try { List<Greade> greadeList = greadeDao.selectList(greade); if (greadeList != null) { resultData.setStatus(IBaseService.SUCCESS); resultData.addObject("greadeList", greadeList); } else { resultData.setStatus(IBaseService.FAIL); } } catch (Exception e) { resultData.setStatusException(e.getMessage()); e.printStackTrace(); } return resultData; }
/** * 查询单条数据 * * @param entity * @return */ public ResultData single(Greade greade) { ResultData resultData = new ResultData(); try { Greade greadeTemp = greadeDao.selectOneById(greade); if (greadeTemp != null) { resultData.setStatus(IBaseService.SUCCESS); resultData.addObject("greade", greadeTemp); } else { resultData.setStatus(IBaseService.FAIL); } } catch (Exception e) { resultData.setStatusException(e.getMessage()); e.printStackTrace(); } return resultData; }