import com.github.pagehelper.PageInterceptor;
import org.mybatis.spring.SqlSessionFactoryBean;
//分页插件
SqlSessionFactoryBean bean = new SqlSessionFactoryBean();
PageInterceptor interceptor = new PageInterceptor();
Properties properties = new Properties();
properties.setProperty("helperDialect", "sqlserver");
properties.setProperty("reasonable", "true");
properties.setProperty("supportMethodsArguments", "true");
properties.setProperty("count", "countSql");
interceptor.setProperties(properties);
bean.setPlugins(new PageInterceptor[] {
interceptor});
If prompted found more pagination plug-in system, check system configuration!
Initiating class excluded PageHelperAutoConfiguration
import com.github.pagehelper.autoconfigure.PageHelperAutoConfiguration;
@SpringBootApplication(exclude=
PageHelperAutoConfiguration.class
})