File tree Expand file tree Collapse file tree
java/top/cadecode/uniboot
framework/src/main/java/top/cadecode/uniboot/framework/config Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package top .cadecode .uniboot ;
22
3+ import org .mybatis .spring .annotation .MapperScan ;
34import org .springframework .boot .SpringApplication ;
45import org .springframework .boot .autoconfigure .SpringBootApplication ;
56import org .springframework .boot .autoconfigure .jdbc .DataSourceAutoConfiguration ;
67import org .springframework .boot .builder .SpringApplicationBuilder ;
78import org .springframework .boot .web .servlet .support .SpringBootServletInitializer ;
8- import org .springframework .context .annotation .ComponentScan ;
99import org .springframework .context .annotation .EnableAspectJAutoProxy ;
1010
1111/**
1212 *
1313 */
14- @ ComponentScan ("top.cadecode " )
14+ @ MapperScan ("top.decode.**.mapper " )
1515@ EnableAspectJAutoProxy (exposeProxy = true )
1616@ SpringBootApplication (exclude = DataSourceAutoConfiguration .class )
1717public class UniBootApplication extends SpringBootServletInitializer {
Original file line number Diff line number Diff line change @@ -47,6 +47,14 @@ spring:
4747 config :
4848 multi-statement-allow : true
4949
50+ # pagehelper
51+ pagehelper :
52+ reasonable : true
53+ supportMethodsArguments : true
54+ params : count=countSql
55+ auto-dialect : true
56+ auto-runtime-dialect : true
57+
5058# mybatis plus 配置
5159mybatis-plus :
5260 mapper-locations : classpath*:mapper/**/*.xml
Original file line number Diff line number Diff line change 6262 <groupId >org.mybatis.spring.boot</groupId >
6363 <artifactId >mybatis-spring-boot-starter</artifactId >
6464 </dependency >
65+ <!-- pagehelper-->
66+ <dependency >
67+ <groupId >com.github.pagehelper</groupId >
68+ <artifactId >pagehelper-spring-boot-starter</artifactId >
69+ </dependency >
6570 <!-- mybatis plus-->
6671 <dependency >
6772 <groupId >com.baomidou</groupId >
Original file line number Diff line number Diff line change 11package top .cadecode .uniboot .framework .config ;
22
3- import com .baomidou .mybatisplus .annotation .DbType ;
43import com .baomidou .mybatisplus .extension .plugins .MybatisPlusInterceptor ;
54import com .baomidou .mybatisplus .extension .plugins .inner .PaginationInnerInterceptor ;
6- import org .mybatis .spring .annotation .MapperScan ;
75import org .springframework .context .annotation .Bean ;
86import org .springframework .context .annotation .Configuration ;
97
1412 * @date 2022/2/16
1513 */
1614@ Configuration
17- @ MapperScan ("top.cadecode.**.mapper" )
1815public class MybatisConfig {
1916 /**
2017 * Mybatis Plus 插件配置
2118 */
2219 @ Bean
2320 public MybatisPlusInterceptor mybatisPlusInterceptor () {
2421 MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor ();
25- interceptor .addInnerInterceptor (new PaginationInnerInterceptor (DbType . MYSQL ));
22+ interceptor .addInnerInterceptor (new PaginationInnerInterceptor ());
2623 return interceptor ;
2724 }
2825}
Original file line number Diff line number Diff line change 3737 <vavr .vsersion>1.0.0-alpha-4</vavr .vsersion>
3838 <knife4j .version>2.0.5</knife4j .version>
3939 <mybatis .version>2.2.0</mybatis .version>
40+ <pagehelper .version>1.4.0</pagehelper .version>
4041 <mybatis-plus .version>3.5.1</mybatis-plus .version>
4142 <p6spy .version>3.8.1</p6spy .version>
4243 <jasypt .version>2.1.1</jasypt .version>
124125 <artifactId >mybatis-spring-boot-starter</artifactId >
125126 <version >${mybatis.version} </version >
126127 </dependency >
128+ <!-- pagehelper-->
129+ <dependency >
130+ <groupId >com.github.pagehelper</groupId >
131+ <artifactId >pagehelper-spring-boot-starter</artifactId >
132+ <version >${pagehelper.version} </version >
133+ </dependency >
127134 <!-- mybatis plus-->
128135 <dependency >
129136 <groupId >com.baomidou</groupId >
You can’t perform that action at this time.
0 commit comments