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


Java PageHelper.startPage方法代码示例

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


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

示例1: getItemSearchList

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
@Override
public DataTablesResult getItemSearchList(int draw, int start, int length,int cid, String search,
                                          String minDate, String maxDate, String orderCol, String orderDir) {

    DataTablesResult result=new DataTablesResult();

    //分页执行查询返回结果
    PageHelper.startPage(start/length+1,length);
    List<TbItem> list = tbItemMapper.selectItemByMultiCondition(cid,"%"+search+"%",minDate,maxDate,orderCol,orderDir);
    PageInfo<TbItem> pageInfo=new PageInfo<>(list);
    result.setRecordsFiltered((int)pageInfo.getTotal());
    result.setRecordsTotal(getAllItemCount().getRecordsTotal());

    result.setDraw(draw);
    result.setData(list);

    return result;
}
 
开发者ID:Exrick,项目名称:xmall,代码行数:19,代码来源:ItemServiceImpl.java

示例2: getSearchCategorySecondaryList

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
@Override
public Map<String, Object> getSearchCategorySecondaryList(String sSearch, Integer sEcho, Integer iDisplayStart, Integer iDisplayLength) {

    HashMap<String, Object> map = new HashMap<>();
    int pageNum = iDisplayStart / iDisplayLength + 1;
    //System.out.println(pageNum);
    PageHelper.startPage(pageNum, iDisplayLength);

    TbCategorySecondaryExample example = new TbCategorySecondaryExample();
    TbCategorySecondaryExample.Criteria criteria = example.createCriteria();
    criteria.andNameLike("%" + sSearch + "%");

    List<TbCategorySecondary> list = categorySecondaryMapper.selectByExample(example);
    //System.out.println(list.size());
    PageInfo<TbCategorySecondary> pageInfo = new PageInfo<>(list);

    map.put("sEcho", sEcho + 1);
    map.put("iTotalRecords", pageInfo.getTotal());//数据总条数
    map.put("iTotalDisplayRecords", pageInfo.getTotal());//显示的条数
    map.put("aData", list);//数据集合

    return map;
}
 
开发者ID:xubinux,项目名称:xbin-store,代码行数:24,代码来源:ContentServiceImpl.java

示例3: pageSearch_historyorder

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 订单查询(点击页面中的用户订单)
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/pageSearch_historyorder")
public PageData pageSearch_historyorder(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = orderManagementMapper.listPagehistoryorder(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:AgencyOrderManagementRestful.java

示例4: assignToExpertAndAccompany

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 代理商未分派给陪诊人员,也没有分派给专家
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/assignToExpertAndAccompany")
public PageData assignToExpertAndAccompany(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = orderManagementMapper.assignToExpertAndAccompany(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:AgencyOrderManagementRestful.java

示例5: manageSearch

import com.github.pagehelper.PageHelper; //导入方法依赖的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.createByErrorMessage("订单不存在!");
}
 
开发者ID:Liweimin0512,项目名称:MMall_JAVA,代码行数:14,代码来源:OrderServiceImpl.java

示例6: onumDesc

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 订单查询中的订单详细信息
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/onumDesc")
public PageData onumDesc(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = hospitalGuideMapper.onumDesc(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:HospitalGuideRestful.java

示例7: manageProductList

import com.github.pagehelper.PageHelper; //导入方法依赖的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

示例8: spDesc

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 订单查询中的代理商信息
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/spDesc")
public PageData spDesc(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = orderManagementMapper.spDesc(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:OperatorOrderManagementRestful.java

示例9: pageSearch

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 
 * @Description: 分页查询
 * @param pd
 * @return
 * @throws Exception    
 * @return PageData    
 * @throws
 */
@RequestMapping(value = "/pageSearch")
public PageData pageSearch(@RequestBody PageData pd) throws Exception{
	List<PageData> buttonList = null;
	if (pd.getPageNumber()!=0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	buttonList = buttonMapper.buttonlistPage(pd);;
	//分页
	pd=this.getPagingPd(buttonList);
	//结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:22,代码来源:ButtonRestful.java

示例10: getAll

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
public List<User> getAll(String type, String value, int page) {
    Example example = new Example(User.class);
    Example.Criteria criteria = example.createCriteria();
    criteria.andLike(type, "%" + value + "%");
    PageHelper.startPage(page, Constant.PAGE_SIZE);
    return userMapper.selectByExample(example);
}
 
开发者ID:ustcwudi,项目名称:springboot-seed,代码行数:8,代码来源:UserService.java

示例11: evallevelDesc

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 订单查询中的评价星级信息
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/evallevelDesc")
public PageData evallevelDesc(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = orderManagementMapper.evallevelDesc(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:AgencyOrderManagementRestful.java

示例12: getCitysByPage

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
@Override
public List<City> getCitysByPage(Integer rows, Integer page) {
	PageHelper.startPage(page, rows);
	CityExample example = new CityExample();
	List<City> list = cityMapper.selectByExample(example);
	if (list.isEmpty()) {
		return new ArrayList<City>();
	}
	return list;
}
 
开发者ID:puhaiyang,项目名称:springBoot-swagger-mybatis-shardbatis,代码行数:11,代码来源:CityServiceImpl.java

示例13: pageSearch

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 分页查询
 * 
 * @param pd
 *            查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/pageSearch")
public PageData pageSearch(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = activeGroupRelateMapper.listPage(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:21,代码来源:ActiveGroupRelateRestful.java

示例14: pageSearch_all

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
/**
 * 订单查询(全部订单)
 * 
 * @param pd 查询、分页条件
 * @return
 * @throws Exception
 */
@RequestMapping(value = "/pageSearch_all")
public PageData pageSearch_all(@RequestBody PageData pd) throws Exception {
	List<PageData> lists = null;
	if (pd.getPageNumber() != 0) {
		PageHelper.startPage(pd.getPageNumber(), pd.getPageSize());
	}
	lists = orderManagementMapper.listPageAll(pd);
	// 分页
	pd = this.getPagingPd(lists);
	// 结果集封装
	return WebResult.requestSuccess(pd);
}
 
开发者ID:noseparte,项目名称:Spring-Boot-Server,代码行数:20,代码来源:AgencyOrderManagementRestful.java

示例15: getRemoveMemberList

import com.github.pagehelper.PageHelper; //导入方法依赖的package包/类
@Override
public DataTablesResult getRemoveMemberList(int draw, int start, int length, String search,
                                            String minDate, String maxDate, String orderCol, String orderDir) {

    DataTablesResult result=new DataTablesResult();

    try{
        //分页执行查询返回结果
        PageHelper.startPage(start/length+1,length);
        List<TbMember> list = tbMemberMapper.selectByRemoveMemberInfo("%"+search+"%",minDate,maxDate,orderCol,orderDir);
        PageInfo<TbMember> pageInfo=new PageInfo<>(list);

        for(TbMember tbMember:list){
            tbMember.setPassword("");
        }

        result.setRecordsFiltered((int)pageInfo.getTotal());
        result.setRecordsTotal(getRemoveMemberCount().getRecordsTotal());

        result.setDraw(draw);
        result.setData(list);
    }catch (Exception e){
        throw new XmallException("加载删除用户列表失败");
    }

    return result;
}
 
开发者ID:Exrick,项目名称:xmall,代码行数:28,代码来源:MemberServiceImpl.java


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