|
|
|
@ -0,0 +1,33 @@ |
|
|
|
package com.example.gb.service.impl; |
|
|
|
|
|
|
|
import com.example.gb.bean.vo.LiveOrderVO; |
|
|
|
import com.example.gb.dao.GoldbeanConsumeMapper; |
|
|
|
import com.example.gb.service.GoldbeanConsumeService; |
|
|
|
import com.example.gb.util.Page; |
|
|
|
import com.example.gb.util.Result; |
|
|
|
import com.github.pagehelper.PageHelper; |
|
|
|
import com.github.pagehelper.PageInfo; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
@Service |
|
|
|
public class GoldbeanConsumeServiceImpl implements GoldbeanConsumeService { |
|
|
|
private GoldbeanConsumeMapper goldbeanConsumeMapper; |
|
|
|
@Autowired |
|
|
|
public void setGoldbeanConsumeMapper(GoldbeanConsumeMapper goldbeanConsumeMapper) { |
|
|
|
this.goldbeanConsumeMapper = goldbeanConsumeMapper; |
|
|
|
} |
|
|
|
@Override |
|
|
|
public Result getLiveConsumeList(Page page) { |
|
|
|
System.out.println("currentPage:"+ page.getCurrentPage()+ "pageSize:"+page.getPageSize()); |
|
|
|
int currentPage = page.getCurrentPage() != null ? page.getCurrentPage() : 1; |
|
|
|
int pageSize = page.getPageSize() != null ? page.getPageSize() : 10; |
|
|
|
PageHelper.startPage(currentPage,pageSize); |
|
|
|
List<LiveOrderVO> list = goldbeanConsumeMapper.getLiveConsumeList(); |
|
|
|
PageInfo<LiveOrderVO> pageInfo = new PageInfo<>(list); |
|
|
|
System.out.println("实际查询结果总数:" + pageInfo.getTotal() + ",当前页数据条数:" + pageInfo.getSize()); |
|
|
|
return Result.success(pageInfo); |
|
|
|
} |
|
|
|
} |