Package com.jpoweredcart.common

Examples of com.jpoweredcart.common.QueryBean


  public List<Category> getList(final String separator, PageParam pageParam) {
   
    Integer languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    String sql = "SELECT * FROM " +quoteTable("category")+" c LEFT JOIN "+quoteTable("category_description")
      +" cd ON (c.category_id = cd.category_id) WHERE cd.language_id = ? ORDER BY c.sort_order, cd.name ASC";
    QueryBean query = createPaginationQuery(sql, pageParam);
    query.addParameters(languageId);
   
    List<Category> catList = getJdbcOperations().query(query.getSql(),
        query.getParameters(), new CategoryRowMapper(){
      @Override
      public Category mapRow(ResultSet rs, int rowNum)
          throws SQLException {
        Category cat = super.mapRow(rs, rowNum);
        cat.setName(getPath(cat.getId(), separator));
View Full Code Here


  @Override
  public List<UserGroup> getList(PageParam pageParam) {
   
    String sql = "SELECT * FROM "+quoteTable("user_group");
    //sortedKeys={"name"}
    QueryBean query = createPaginationQuery(sql, pageParam);
    List<UserGroup> userGroupList = getJdbcOperations().query(query.getSql(),
        query.getParameters(), new UserGroupRowMapper());
    return userGroupList;
  }
View Full Code Here

    int languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    String sql = "SELECT pd.name, p.model, p.viewed FROM "+quoteTable("product")+" p LEFT JOIN " +
      quoteTable("product_description")+ " pd ON (p.product_id = pd.product_id) WHERE pd.language_id = ? AND p.viewed > 0 ORDER BY p.viewed DESC";
    params.add(languageId);
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    int totalProductViews = getTotalProductViews();
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new ProductViewedRptRowMapper(totalProductViews));
  }
View Full Code Here

      sql += " AND o.date_added <= ?";
      params.add(filter.getDateEnd());
    }
    sql += " GROUP BY op.model ORDER BY total DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new ProductPurchasedRptRowMapper());
  }
View Full Code Here

  @Override
  public List<User> getList(PageParam pageParam) {
   
    //sortedKeys={"username", "status", "date_added"}
    String sql = "SELECT * FROM "+quoteTable("user");
    QueryBean query = createPaginationQuery(sql, pageParam);
    List<User> userList = getJdbcOperations().query(query.getSql(),
        query.getParameters(), new UserRowMapper());
    return userList;
  }
View Full Code Here

      sql += " AND o.date_added <= ?";
      params.add(filter.getDateEnd());
    }
    sql +=  " GROUP BY o.customer_id ORDER BY total DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new CustomerOrderRptRowMapper());
  }
View Full Code Here

      sql += " AND cr.date_added <= ?";
      params.add(filter.getDateEnd());
    }
    sql += " GROUP BY cr.customer_id ORDER BY points DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new CustomerRewardRptRowMapper());
  }
View Full Code Here

      sql += " AND ct.date_added <= ?";
      params.add(filter.getDateEnd());
    }
    sql += " GROUP BY ct.customer_id ORDER BY total DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new CustomerCreditRptRowMapper());
  }
View Full Code Here

  public List<Information> getList(PageParam pageParam) {
    Integer languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    String sql = "SELECT * FROM " +quoteTable("information")+ " i LEFT JOIN " +quoteTable("information_description")
        + " id ON (i.information_id = id.information_id) WHERE id.language_id = ?";
    //sortedKeys={"id.title", "i.sort_order"}
    QueryBean query = createPaginationQuery(sql, pageParam);
    query.addParameters(languageId);
    List<Information> infoList = getJdbcOperations().query(query.getSql(),
        query.getParameters(), new InformationRowMapper(){
      @Override
      public Information mapRow(ResultSet rs, int rowNum)
          throws SQLException {
        Information info = super.mapRow(rs, rowNum);
        info.setTitle(rs.getString("title"));
View Full Code Here

      sql += " AND co.customer_id > 0 AND CONCAT(c.firstname, ' ', c.lastname) LIKE ?";
      params.add("%"+filter.getCustomerName()+"%");
    }
    sql += " ORDER BY co.date_added DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new CustomerOnlineRptRowMapper());
  }
View Full Code Here

TOP

Related Classes of com.jpoweredcart.common.QueryBean

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.