<dependency>
<groupId>com.github.pagehelper</groupId>
<artifactId>pagehelper-spring-boot-starter</artifactId>
<version>1.2.5</version>
<exclusions>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
</exclusion>
<exclusion>
<groupId>org.mybatis</groupId>
<artifactId>mybatis-spring</artifactId>
</exclusion>
</exclusions>
</dependency>
PageHelper.startPage(userRequestDto.getPageNum(), userRequestDto.getPageSize());
PageInfo<UserListResponseDto> pageUser = new PageInfo<>(userMapper.list(userRequestDto));
RequestPageDto
import lombok.Getter;
import lombok.Setter;
import java.io.Serializable;
/**
* @author hongyuanzhang
* @date 2019/8/13
*/
@Getter
@Setter
public class RequestPageDto implements Serializable {
private static final long serialVersionUID = 6131025070200904730L;
private int pageNum;
private int pageSize;
}