分页插件使用
1、引入分页插件
@Configuration
public class DataBaseConfiguration {
/**
* 分页插件
*/
@Bean
@ConditionalOnMissingBean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}
2、reqdto实体继承extends Page<T>,T是DO,通常dto为controller传入的实体。
3、 Service extends IService<GroupDO>
4、ServiceImpl extends ServiceImpl<GroupMapper, GroupDO> implements GroupService
09-09
4万+

06-27
4628

06-21
3465

01-26
3427

06-07