com.github.pagehelper.PageHelper.startPage()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(503)

本文整理了Java中com.github.pagehelper.PageHelper.startPage()方法的一些代码示例,展示了PageHelper.startPage()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PageHelper.startPage()方法的具体详情如下:
包路径:com.github.pagehelper.PageHelper
类名称:PageHelper
方法名:startPage

PageHelper.startPage介绍

暂无

代码示例

代码示例来源:origin: macrozheng/mall

@Override
public List<SmsFlashPromotionProduct> list(Long flashPromotionId, Long flashPromotionSessionId, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum,pageSize);
  return relationDao.getList(flashPromotionId,flashPromotionSessionId);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<OmsOrder> list(OmsOrderQueryParam queryParam, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum, pageSize);
  return orderDao.getList(queryParam);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<OmsOrderReturnApply> list(OmsReturnApplyQueryParam queryParam, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum,pageSize);
  return returnApplyDao.getList(queryParam);
}

代码示例来源:origin: shuzheng/zheng

@Override
public List<Record> selectByExampleForStartPage(Example example, Integer pageNum, Integer pageSize) {
  try {
    DynamicDataSource.setDataSource(DataSourceEnum.SLAVE.getName());
    Method selectByExample = mapper.getClass().getDeclaredMethod("selectByExample", example.getClass());
    PageHelper.startPage(pageNum, pageSize, false);
    Object result = selectByExample.invoke(mapper, example);
    return (List<Record>) result;
  } catch (IllegalAccessException e) {
    e.printStackTrace();
  } catch (InvocationTargetException e) {
    e.printStackTrace();
  } catch (NoSuchMethodException e) {
    e.printStackTrace();
  }
  DynamicDataSource.clearDataSource();
  return null;
}

代码示例来源:origin: shuzheng/zheng

@Override
public List<Record> selectByExampleWithBLOBsForStartPage(Example example, Integer pageNum, Integer pageSize) {
  try {
    DynamicDataSource.setDataSource(DataSourceEnum.SLAVE.getName());
    Method selectByExampleWithBLOBs = mapper.getClass().getDeclaredMethod("selectByExampleWithBLOBs", example.getClass());
    PageHelper.startPage(pageNum, pageSize, false);
    Object result = selectByExampleWithBLOBs.invoke(mapper, example);
    return (List<Record>) result;
  } catch (IllegalAccessException e) {
    e.printStackTrace();
  } catch (InvocationTargetException e) {
    e.printStackTrace();
  } catch (NoSuchMethodException e) {
    e.printStackTrace();
  }
  DynamicDataSource.clearDataSource();
  return null;
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsBrand> listBrand(int pageNum, int pageSize) {
  PageHelper.startPage(pageNum, pageSize);
  return brandMapper.selectByExample(new PmsBrandExample());
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsProductAttributeCategory> getList(Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum,pageSize);
  return productAttributeCategoryMapper.selectByExample(new PmsProductAttributeCategoryExample());
}

代码示例来源:origin: macrozheng/mall

@Override
  public List<SmsFlashPromotion> list(String keyword, Integer pageSize, Integer pageNum) {
    PageHelper.startPage(pageNum, pageSize);
    SmsFlashPromotionExample example = new SmsFlashPromotionExample();
    if (!StringUtils.isEmpty(keyword)) {
      example.createCriteria().andTitleLike("%" + keyword + "%");
    }
    return flashPromotionMapper.selectByExample(example);
  }
}

代码示例来源:origin: macrozheng/mall

@Override
  public List<CmsSubject> list(String keyword, Integer pageNum, Integer pageSize) {
    PageHelper.startPage(pageNum, pageSize);
    CmsSubjectExample example = new CmsSubjectExample();
    CmsSubjectExample.Criteria criteria = example.createCriteria();
    if (!StringUtils.isEmpty(keyword)) {
      criteria.andTitleLike("%" + keyword + "%");
    }
    return subjectMapper.selectByExample(example);
  }
}

代码示例来源:origin: macrozheng/mall

@Override
public List<OmsOrderReturnReason> list(Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum,pageSize);
  OmsOrderReturnReasonExample example = new OmsOrderReturnReasonExample();
  example.setOrderByClause("sort desc");
  return returnReasonMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsBrand> listBrand(String keyword, int pageNum, int pageSize) {
  PageHelper.startPage(pageNum, pageSize);
  PmsBrandExample pmsBrandExample = new PmsBrandExample();
  pmsBrandExample.setOrderByClause("sort desc");
  PmsBrandExample.Criteria criteria = pmsBrandExample.createCriteria();
  if (!StringUtils.isEmpty(keyword)) {
    criteria.andNameLike("%" + keyword + "%");
  }
  return brandMapper.selectByExample(pmsBrandExample);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<SmsCoupon> list(String name, Integer type, Integer pageSize, Integer pageNum) {
  SmsCouponExample example = new SmsCouponExample();
  SmsCouponExample.Criteria criteria = example.createCriteria();
  if(!StringUtils.isEmpty(name)){
    criteria.andNameLike("%"+name+"%");
  }
  if(type!=null){
    criteria.andTypeEqualTo(type);
  }
  PageHelper.startPage(pageNum,pageSize);
  return couponMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<CmsSubject> getSubjectList(Long cateId, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum,pageSize);
  CmsSubjectExample example = new CmsSubjectExample();
  CmsSubjectExample.Criteria criteria = example.createCriteria();
  criteria.andShowStatusEqualTo(1);
  if(cateId!=null){
    criteria.andCategoryIdEqualTo(cateId);
  }
  return subjectMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<UmsAdmin> list(String name, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum, pageSize);
  UmsAdminExample example = new UmsAdminExample();
  UmsAdminExample.Criteria criteria = example.createCriteria();
  if (!StringUtils.isEmpty(name)) {
    criteria.andUsernameLike("%" + name + "%");
    example.or(example.createCriteria().andNickNameLike("%" + name + "%"));
  }
  return adminMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsProduct> recommendProductList(Integer pageSize, Integer pageNum) {
  // TODO: 2019/1/29 暂时默认推荐所有商品
  PageHelper.startPage(pageNum,pageSize);
  PmsProductExample example = new PmsProductExample();
  example.createCriteria()
      .andDeleteStatusEqualTo(0)
      .andPublishStatusEqualTo(1);
  return productMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsProductCategory> getList(Long parentId, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum, pageSize);
  PmsProductCategoryExample example = new PmsProductCategoryExample();
  example.setOrderByClause("sort desc");
  example.createCriteria().andParentIdEqualTo(parentId);
  return productCategoryMapper.selectByExample(example);
}

代码示例来源:origin: linlinjava/litemall

public List<LitemallBrand> queryVO(int offset, int limit) {
  LitemallBrandExample example = new LitemallBrandExample();
  example.or().andDeletedEqualTo(false);
  example.setOrderByClause("add_time desc");
  PageHelper.startPage(offset, limit);
  return brandMapper.selectByExampleSelective(example, columns);
}

代码示例来源:origin: linlinjava/litemall

public List<LitemallCategory> queryL1(int offset, int limit) {
  LitemallCategoryExample example = new LitemallCategoryExample();
  example.or().andLevelEqualTo("L1").andDeletedEqualTo(false);
  PageHelper.startPage(offset, limit);
  return categoryMapper.selectByExample(example);
}

代码示例来源:origin: macrozheng/mall

@Override
public List<PmsProductAttribute> getList(Long cid, Integer type, Integer pageSize, Integer pageNum) {
  PageHelper.startPage(pageNum, pageSize);
  PmsProductAttributeExample example = new PmsProductAttributeExample();
  example.setOrderByClause("sort desc");
  example.createCriteria().andProductAttributeCategoryIdEqualTo(cid).andTypeEqualTo(type);
  return productAttributeMapper.selectByExample(example);
}

代码示例来源:origin: linlinjava/litemall

public List<LitemallFootprint> queryByAddTime(Integer userId, Integer page, Integer size) {
  LitemallFootprintExample example = new LitemallFootprintExample();
  example.or().andUserIdEqualTo(userId).andDeletedEqualTo(false);
  example.setOrderByClause(LitemallFootprint.Column.addTime.desc());
  PageHelper.startPage(page, size);
  return footprintMapper.selectByExample(example);
}

相关文章