<dependency>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
<version>3.4.0</version>
</dependency>
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
return interceptor;
}
IPage<User> getList(Page<Object> page);
<select id="getList" resultMap="getUserDate">
select * from user
<!-- select * from user 最初不能增加; 号 -->
</select>
@Test
void Test01(){Page<Object> page = new Page<>(0, 2);
List<User> records = userMapper.getList(page).getRecords();
records.forEach(item->System.out.println(item));
}