Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
cloud-backend
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
framework
cloud-backend
Commits
1514dafc
Commit
1514dafc
authored
Jun 19, 2021
by
袁伟铭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.0.0
parent
6365dcac
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
common-utils/src/main/java/com/zq/common/config/mybatis/MybatisConfig.java
+14
-2
No files found.
common-utils/src/main/java/com/zq/common/config/mybatis/MybatisConfig.java
View file @
1514dafc
...
...
@@ -19,7 +19,15 @@ public class MybatisConfig {
@Bean
public
MybatisPlusInterceptor
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
;
}
...
...
@@ -35,7 +43,11 @@ public class MybatisConfig {
return
configuration
->
configuration
.
setUseDeprecatedExecutor
(
false
);
}
// pagehelper分页插件
/**
* pagehelper分页插件
*
* @return
*/
@Bean
public
PageInterceptor
pageInterceptor
()
{
PageInterceptor
pageInterceptor
=
new
PageInterceptor
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment