<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
</dependency>
PageHelper.startPage(page,size);
orders = orderMapper.selectByExample(example);
PageInfo<Order> orderPageInfo = new PageInfo<>(orders);
long total = orderPageInfo.getTotal();