Exemple #1
0
  /** 常用发货地址-总记录数 */
  @Override
  public Integer getAddressTotalRows(HttpSession session, Address address) {
    String userId = (String) session.getAttribute(Constant.USER_ID);
    String hql =
        "select count (*) from Address t where t.clientId=:clientId and t.kind=:kind "; // 1为发货地址,2为收货地址
    Map<String, Object> params = new HashMap<String, Object>();
    params.put("clientId", userId);
    params.put("kind", address.getKind());

    Long count = addressDao.count(hql, params);

    return count.intValue();
  }