public List<User> selectByCriteria(User paramUser) { List userList = this.userDao.selectByCriteria(paramUser); List results = new ArrayList(); if (userList != null) { for (int i = 0; i < userList.size(); i++) { User user = (User) userList.get(i); user.setBirthdayStr(DateUtils.formatDate2Str(user.getBirthday(), "yyyy-MM-dd")); user.setSex((String) Constants.SEX_MAP.get(user.getSex())); user.setStatus((String) Constants.USER_STATUS_MAP.get(user.getStatus())); user.setCreateDateStr( DateUtils.formatDate2Str(user.getCreateTime(), "yyyy-MM-dd HH:mm:ss")); results.add(user); } } return results; }
public List<User> selectByCriteriaForPaging(User paramUser) { if ("1".equals(SessionUtils.getUserRole())) paramUser.setRole("'2','3'"); else { paramUser.setRole("'3'"); } List userList = this.userDao.selectByCriteriaForPaging( paramUser, paramUser.getStart(), paramUser.getLimit()); List results = new ArrayList(); if (userList != null) { for (int i = 0; i < userList.size(); i++) { User user = (User) userList.get(i); user.setBirthdayStr(DateUtils.formatDate2Str(user.getBirthday(), "yyyy-MM-dd")); user.setRole((String) Constants.ROLE_MAP.get(user.getRole())); user.setSex((String) Constants.SEX_MAP.get(user.getSex())); user.setStatus((String) Constants.USER_STATUS_MAP.get(user.getStatus())); results.add(user); } } return results; }