其他分享
首页 > 其他分享> > Mybatis-plus 分页插件

Mybatis-plus 分页插件

作者:互联网

去官网

分页插件:新建类复制即可



import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class mybatisPlusInterceptor {
/**
* 分页插件(官网最新)
*/
@Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
return interceptor;
}
}

 

标签:插件,mybatisplus,MybatisPlusInterceptor,baomidou,plus,Mybatis,import,interceptor
来源: https://www.cnblogs.com/dfdg/p/16692708.html