Commit 1514dafc by 袁伟铭

1.0.0

parent 6365dcac
...@@ -19,7 +19,15 @@ public class MybatisConfig { ...@@ -19,7 +19,15 @@ public class MybatisConfig {
@Bean @Bean
public MybatisPlusInterceptor mybatisPlusInterceptor() { public MybatisPlusInterceptor mybatisPlusInterceptor() {
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.H2));
// 分页插件
// 其他:
// 生成 countSql 会在 left join 的表不参与 where 条件的情况下,把 left join 优化掉
// 所以建议任何带有 left join 的sql,都写标准sql,即给于表一个别名,字段也要 别名.字段
PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
paginationInnerInterceptor.setDbType(DbType.MYSQL);
interceptor.addInnerInterceptor(paginationInnerInterceptor);
return interceptor; return interceptor;
} }
...@@ -35,7 +43,11 @@ public class MybatisConfig { ...@@ -35,7 +43,11 @@ public class MybatisConfig {
return configuration -> configuration.setUseDeprecatedExecutor(false); return configuration -> configuration.setUseDeprecatedExecutor(false);
} }
// pagehelper分页插件 /**
* pagehelper分页插件
*
* @return
*/
@Bean @Bean
public PageInterceptor pageInterceptor() { public PageInterceptor pageInterceptor() {
PageInterceptor pageInterceptor = new PageInterceptor(); PageInterceptor pageInterceptor = new PageInterceptor();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment