|
@@ -0,0 +1,28 @@
|
|
|
+package edu.travel.config;
|
|
|
+
|
|
|
+import com.baomidou.mybatisplus.annotation.DbType;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
|
|
+import com.mysql.cj.jdbc.Driver;
|
|
|
+import edu.travel.datasource.ProjectInterceptor;
|
|
|
+import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
|
|
|
+import org.springframework.context.annotation.Bean;
|
|
|
+import org.springframework.context.annotation.Configuration;
|
|
|
+
|
|
|
+
|
|
|
+ * 处理mysql兼容问题
|
|
|
+ * @Anthor 处理mysql兼容问题
|
|
|
+ */
|
|
|
+@Configuration
|
|
|
+@ConditionalOnClass(Driver.class)
|
|
|
+public class MysqlConfig {
|
|
|
+ @Bean
|
|
|
+ @ConditionalOnClass(Driver.class)
|
|
|
+ public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
|
|
+
|
|
|
+ MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
|
|
+ interceptor.addInnerInterceptor(new ProjectInterceptor());
|
|
|
+ interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
|
|
+ return interceptor;
|
|
|
+ }
|
|
|
+}
|