/** 附属账户-总记录数 */ @Override public Integer getSubAccountTotalRows(HttpSession session, SubAccount subAccount) { String carrierId = (String) session.getAttribute(Constant.USER_ID); String hql = "select count(*) from SubAccount t where t.hostAccountId=:hostAccountId"; Map<String, Object> params = new HashMap<String, Object>(); params.put("hostAccountId", carrierId); Long count = subAccountDao.count(hql, params); return count.intValue(); }
/** 检查附属账户是否存在 */ @Override public boolean checkSubAccountUsername(String username) { String hql = "select count(*) from SubAccount t where t.username=:username"; Map<String, Object> params = new HashMap<String, Object>(); params.put("username", username); Long count = subAccountDao.count(hql, params); if (count == 0) { // 不存在 return false; } else return true; }