當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。