public User login(User user) { List<Object> param = new LinkedList<Object>(); StringBuffer hql = new StringBuffer("from User where username=? and password=?"); param.add(user.getUsername()); param.add(user.getPassword()); return baseDao.get(hql.toString(), param); }
public List<User> list(User s_User, PageBean pb) { List<Object> param = new LinkedList<Object>(); StringBuffer hql = new StringBuffer("from User"); hql.append(" and status=1 "); if (pb != null) { return baseDao.find(hql.toString().replaceFirst("and", "where"), param, pb); } return null; }
public boolean existUserByUserName(String userName) { String hql = "select count(*) from User where userName=?"; List<Object> param = new LinkedList<Object>(); param.add(userName); Long i = baseDao.count(hql, param); if (i > 0) { return true; } else { return false; } }
public Long count(User s_User) { List<Object> param = new LinkedList<Object>(); StringBuffer hql = new StringBuffer("select count(*) from User"); hql.append(" and status=1 "); return baseDao.count(hql.toString().replaceFirst("and", "where"), param); }
public void saveUser(User user) { baseDao.save(user); }