本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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("订单不存在");
}
示例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);
}
示例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);
}
示例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);
}
示例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("订单不存在");
}
示例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);
}
示例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);
}