当前位置: 首页>>代码示例>>Java>>正文


Java PageInfo.setList方法代码示例

本文整理汇总了Java中com.github.pagehelper.PageInfo.setList方法的典型用法代码示例。如果您正苦于以下问题:Java PageInfo.setList方法的具体用法?Java PageInfo.setList怎么用?Java PageInfo.setList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.github.pagehelper.PageInfo的用法示例。


在下文中一共展示了PageInfo.setList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getOrderList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> getOrderList(Integer userId, int pageNum, int pageSize){
    PageHelper.startPage(pageNum,pageSize);
    List<Order> orderList = orderMapper.selectByUserId(userId);
    List<OrderVo> orderVoList = assembleOrderVoList(orderList,userId);
    PageInfo pageResult = new PageInfo(orderList);
    pageResult.setList(orderVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:wangshufu,项目名称:mmall,代码行数:9,代码来源:OrderServiceImpl.java

示例2: getProductList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> getProductList(int pageNum, int pageSize) {
    //startPage--start
    //填充自己的sql查询逻辑
    //pageHelper-收尾
    PageHelper.startPage(pageNum, pageSize);
    List<Product> productList = productMapper.selectList();

    List<ProductListVo> productListVoList = Lists.newArrayList();
    for (Product productItem : productList) {
        ProductListVo productListVo = assembleProductListVo(productItem);
        productListVoList.add(productListVo);
    }
    PageInfo pageResult = new PageInfo(productList);
    pageResult.setList(productListVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:18,代码来源:ProductServiceImpl.java

示例3: searchProduct

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> searchProduct(String productName, Integer productId, int pageNum, int pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    if (StringUtils.isNotBlank(productName)) {
        productName = new StringBuilder().append("%").append(productName).append("%").toString();
    }
    List<Product> productList = productMapper.selectByNameAndProductId(productName, productId);
    List<ProductListVo> productListVoList = Lists.newArrayList();
    for (Product productItem : productList) {
        ProductListVo productListVo = assembleProductListVo(productItem);
        productListVoList.add(productListVo);
    }
    PageInfo pageResult = new PageInfo(productList);
    pageResult.setList(productListVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:17,代码来源:ProductServiceImpl.java

示例4: getOrderList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> getOrderList(Integer userId, int pageNum, int pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    List<Order> orderList = orderMapper.selectByUserId(userId);
    List<OrderVo> orderVoList = assembleOrderVoList(orderList, userId);
    PageInfo pageResult = new PageInfo(orderList);
    pageResult.setList(orderVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:10,代码来源:OrderServiceImpl.java

示例5: getComments

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public PageInfo<CommentBo> getComments(Integer cid, int page, int limit) {

    if (null != cid) {
        PageHelper.startPage(page, limit);
        CommentVoExample commentVoExample = new CommentVoExample();
        commentVoExample.createCriteria().andCidEqualTo(cid).andParentEqualTo(0).andStatusIsNotNull().andStatusEqualTo("approved");
        commentVoExample.setOrderByClause("coid desc");
        List<CommentVo> parents = commentDao.selectByExampleWithBLOBs(commentVoExample);
        PageInfo<CommentVo> commentPaginator = new PageInfo<>(parents);
        PageInfo<CommentBo> returnBo = copyPageInfo(commentPaginator);
        if (parents.size() != 0) {
            List<CommentBo> comments = new ArrayList<>(parents.size());
            parents.forEach(parent -> {
                CommentBo comment = new CommentBo(parent);
                comments.add(comment);
            });
            returnBo.setList(comments);
        }
        return returnBo;
    }
    return null;
}
 
开发者ID:ZHENFENG13,项目名称:My-Blog,代码行数:24,代码来源:CommentServiceImpl.java

示例6: getProductList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> getProductList(int pageNum,int pageSize){
    //startPage--start
    //填充自己的sql查询逻辑
    //pageHelper-收尾
    PageHelper.startPage(pageNum,pageSize);
    List<Product> productList = productMapper.selectList();

    List<ProductListVo> productListVoList = Lists.newArrayList();
    for(Product productItem : productList){
        ProductListVo productListVo = assembleProductListVo(productItem);
        productListVoList.add(productListVo);
    }
    PageInfo pageResult = new PageInfo(productList);
    pageResult.setList(productListVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:Liweimin0512,项目名称:MMall_JAVA,代码行数:17,代码来源:ProductServiceImpl.java

示例7: searchProduct

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> searchProduct(String productName, Integer productId, int pageNum, int pageSize) {
    PageHelper.startPage(pageNum,pageSize);
    if(StringUtils.isNotBlank(productName)){
        productName = new StringBuilder().append("%").append(productName).append("%").toString();
    }
    List<Product> productList = productMapper.selectByNameAndProductId(productName,productId);
    List<ProductListVo> productListVoList = Lists.newArrayList();
    for(Product productItem : productList){
        ProductListVo productListVo = assembleProductListVo(productItem);
        productListVoList.add(productListVo);
    }
    PageInfo pageResult = new PageInfo(productList);
    pageResult.setList(productListVoList);
    return ServerResponse.success(pageResult);
}
 
开发者ID:prb8025236,项目名称:CheapStore,代码行数:17,代码来源:ProductServiceImpl.java

示例8: manageList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> manageList(int pageNum, int pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    List<Order> orderList = orderMapper.selectAllOrder();
    List<OrderVo> orderVoList = this.assembleOrderVoList(orderList, null);
    PageInfo pageResult = new PageInfo();
    pageResult.setList(orderVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:10,代码来源:OrderServiceImpl.java

示例9: manageSearch

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
@Override
public ServerResponse<PageInfo> manageSearch(Long orderNo, int pageNum, int pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    Order order = orderMapper.selectByOrderNo(orderNo);
    if (order != null) {
        List<OrderItem> orderItemList = orderItemMapper.getByOrderNo(orderNo);
        OrderVo orderVo = assembleOrderVo(order, orderItemList);

        PageInfo pageResult = new PageInfo(Lists.newArrayList(order));
        pageResult.setList(Lists.newArrayList(orderVo));
        return ServerResponse.createBySuccess(pageResult);
    }
    return ServerResponse.createByErrorMessage("订单不存在");
}
 
开发者ID:jeikerxiao,项目名称:X-mall,代码行数:15,代码来源:OrderServiceImpl.java

示例10: manageProductList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
/**
 * 获取商品集合
 * @param pageNum 第几页
 * @param pageSize 每页多少个
 * @return
 */
public ServerResponse<PageInfo> manageProductList(Integer pageNum,Integer pageSize){
    PageHelper.startPage(pageNum,pageSize);
    List<Product> products = productMapper.selectList();
    List<ProductListVo> productListVos = Lists.newArrayList();
    for (Product productItem : products){
        productListVos.add(assembleProductListVo(productItem));
    }
    PageInfo pageInfo = new PageInfo(products);
    pageInfo.setList(productListVos);
    return ServerResponse.createBySuccess(pageInfo);
}
 
开发者ID:wangshufu,项目名称:mmall,代码行数:18,代码来源:ProductServiceImpl.java

示例11: productSearch

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
/**
 * 根据商品名或者id来搜索商品,返回商品集合
 * @param productName
 * @param productId
 * @param pageNum
 * @param pageSize
 * @return
 */
public ServerResponse<PageInfo> productSearch(String productName,int productId,int pageNum,int pageSize){
    PageHelper.startPage(pageNum,pageSize);
    List<Product> products = productMapper.selectByNameAndProductId(productName,productId);
    List<ProductListVo> productListVos = Lists.newArrayList();
    for (Product productItem : products){
        productListVos.add(assembleProductListVo(productItem));
    }
    PageInfo pageInfo = new PageInfo(products);
    pageInfo.setList(productListVos);
    return ServerResponse.createBySuccess(pageInfo);
}
 
开发者ID:wangshufu,项目名称:mmall,代码行数:20,代码来源:ProductServiceImpl.java

示例12: manageList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> manageList(int pageNum,int pageSize){
    PageHelper.startPage(pageNum,pageSize);
    List<Order> orderList = orderMapper.selectAllOrder();
    List<OrderVo> orderVoList = this.assembleOrderVoList(orderList,null);
    PageInfo pageResult = new PageInfo(orderList);
    pageResult.setList(orderVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:wangshufu,项目名称:mmall,代码行数:9,代码来源:OrderServiceImpl.java

示例13: manageSearch

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> manageSearch(Long orderNo,int pageNum,int pageSize){
    PageHelper.startPage(pageNum,pageSize);
    Order order = orderMapper.selectByOrderNo(orderNo);
    if(order != null){
        List<OrderItem> orderItemList = orderItemMapper.getByOrderNo(orderNo);
        OrderVo orderVo = assembleOrderVo(order,orderItemList);

        PageInfo pageResult = new PageInfo(Lists.newArrayList(order));
        pageResult.setList(Lists.newArrayList(orderVo));
        return ServerResponse.createBySuccess(pageResult);
    }
    return ServerResponse.createByError("订单不存在");
}
 
开发者ID:wangshufu,项目名称:mmall,代码行数:14,代码来源:OrderServiceImpl.java

示例14: searchProduct

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> searchProduct(String productName,Integer productId,int pageNum,int pageSize){
    PageHelper.startPage(pageNum,pageSize);
    if(StringUtils.isNotBlank(productName)){
        productName = new StringBuilder().append("%").append(productName).append("%").toString();
    }
    List<Product> productList = productMapper.selectByNameAndProductId(productName,productId);
    List<ProductListVo> productListVoList = Lists.newArrayList();
    for(Product productItem : productList){
        ProductListVo productListVo = assembleProductListVo(productItem);
        productListVoList.add(productListVo);
    }
    PageInfo pageResult = new PageInfo(productList);
    pageResult.setList(productListVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:Liweimin0512,项目名称:MMall_JAVA,代码行数:16,代码来源:ProductServiceImpl.java

示例15: getOrderList

import com.github.pagehelper.PageInfo; //导入方法依赖的package包/类
public ServerResponse<PageInfo> getOrderList(Integer userId, int pageNum, int pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    List<Order> orderList = orderMapper.selectByUserId(userId);

    List<OrderVo> orderVoList = assembleOrderVoList(orderList, userId);
    PageInfo pageResult = new PageInfo(orderList);
    pageResult.setList(orderVoList);
    return ServerResponse.createBySuccess(pageResult);
}
 
开发者ID:Liweimin0512,项目名称:MMall_JAVA,代码行数:10,代码来源:OrderServiceImpl.java


注:本文中的com.github.pagehelper.PageInfo.setList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。