Package com.jpoweredcart.common

Examples of com.jpoweredcart.common.QueryBean


   
    String sql = "SELECT r.review_id, pd.name, r.author, r.rating, r.status, r.date_added FROM "
        +quoteTable("review")+" r LEFT JOIN " +quoteTable("product_description")
        +" pd ON (r.product_id = pd.product_id) WHERE pd.language_id = ?";
    //sortedKeys={"pd.name","r.author","r.rating","r.status","r.date_added"}
    QueryBean query = createPaginationQuery(sql, pageParam);
    Integer languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    query.addParameters(languageId);
    return getJdbcOperations().query(query.getSql(),
        query.getParameters(), new RowMapper<Review>(){
          @Override
          public Review mapRow(ResultSet rs, int rowNum)
              throws SQLException {
            Review review = new Review();
            review.setId(rs.getInt("review_id"));
View Full Code Here


  public List<AttributeGroup> getList(PageParam pageParam) {
    Integer languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    String sql = "SELECT * FROM "+quoteTable("attribute_group")+" ag LEFT JOIN "+quoteTable("attribute_group_description")
        +" agd ON (ag.attribute_group_id = agd.attribute_group_id) WHERE agd.language_id = ?";
    //sortedKeys={"agd.name", "ag.sort_order"}
    QueryBean query = createPaginationQuery(sql, pageParam);
    query.addParameters(languageId);
    return getJdbcOperations().query(query.getSql(),
        query.getParameters(), new AttributeGroupRowMapper(){
          @Override
          public AttributeGroup mapRow(ResultSet rs, int rowNum)
              throws SQLException {
            AttributeGroup attrGrp = super.mapRow(rs, rowNum);
            attrGrp.setName(rs.getString("name"));
View Full Code Here

  public List<Download> getList(PageParam pageParam) {
    Integer languageId = getSettingService().getConfig(SettingKey.ADMIN_LANGUAGE_ID, Integer.class);
    String sql = "SELECT * FROM "+quoteTable("download")+" d LEFT JOIN "+quoteTable("download_description")+
        " dd ON (d.download_id = dd.download_id) WHERE dd.language_id =?";
    //sortedKeys={"dd.name", "d.remaining"}
    QueryBean query = createPaginationQuery(sql, pageParam);
    query.addParameters(languageId);
    return getJdbcOperations().query(query.getSql(),
        query.getParameters(), new DownloadRowMapper(){
          @Override
          public Download mapRow(ResultSet rs, int rowNum)
              throws SQLException {
            Download download = super.mapRow(rs, rowNum);
            download.setName(rs.getString("name"));
View Full Code Here

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

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

    }else if(group.equals("year")){
      sql += " GROUP BY YEAR(tmp.date_added)";
    }
    sql += " ORDER BY tmp.date_added DESC";
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new SaleOrderRptRowMapper());
  }
View Full Code Here

    }else if(group.equals("month")){
      sql += " GROUP BY ot.title, MONTH(o.date_added)";
    }else if(group.equals("year")){
      sql += " GROUP BY ot.title, YEAR(o.date_added)";
    }
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new SaleOrderByTitleRptRowMapper());
  }
View Full Code Here

      sql += " GROUP BY MONTH(r.date_added)";
    }else if(group.equals("year")){
      sql += " GROUP BY YEAR(r.date_added)";
    }
   
    QueryBean query = createPaginationQuery(sql, pageParam);
    params.add(query.getStart());
    params.add(query.getLimit());
   
    return getJdbcOperations().query(query.getSql(),
        params.toArray(), new SaleReturnRptRowMapper());
  }
View Full Code Here

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

      sql += "AND c.date_added <= ?";
      params.add(filter.getDateEnd());
    }
    sql += " GROUP BY ch.coupon_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 SaleCouponRptRowMapper());
  }
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.