diff --git a/README.md b/README.md index 361550f..683d097 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # mybatis-plus-join * 支持连表查询的[mybatis-plus](https://gitee.com/baomidou/mybatis-plus) - 只做增强,不做修改,可以使用原生mybatis-plus全部的功能 + * [演示示例](https://gitee.com/best_handsome/mybatis-plus-join-demo) ## 使用方法 @@ -14,39 +14,44 @@ ### 安装 -1. 在项目中添加依赖,依赖已经包含了mybatis-plus-boot-starter<3.4.2>
- 依赖后无需再次引入mybatis-plus +1. 在项目中添加依赖 ```xml com.github.yulichang mybatis-plus-join - 1.0.9 + 1.1.0 ``` 或者clone代码到本地,执行mvn install,再引入以上依赖

-2. 配置插件,添加MPJInterceptor +2. 添加配置文件 - ```java - @Configuration - public class MybatisPlusConfig { - /** - * 启用连表拦截器 - */ - @Bean - public MybatisPlusInterceptor paginationInterceptor() { - MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); - //分页插件 - interceptor.addInnerInterceptor(new PaginationInnerInterceptor()); - //连表插件 - interceptor.addInnerInterceptor(new MPJInterceptor()); - //多租户,垃圾sql拦截插件...... - return interceptor; - } +```java + +@Configuration +public class MybatisPlusConfig { + /** + * 启用连表拦截器 + */ + @Bean + public MybatisPlusInterceptor paginationInterceptor() { + MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor(); + //连表插件 + interceptor.addInnerInterceptor(new MPJInterceptor()); + return interceptor; } - ``` + + /** + * sql注入器 + */ + @Bean + public MPJSqlInjector mySqlInjector() { + return new MPJSqlInjector(); + } +} +``` ### 使用 diff --git a/pom.xml b/pom.xml index b60c6b3..0282c74 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 com.github.yulichang mybatis-plus-join - 1.0.9 + 1.1.0 mybatis-plus-join An enhanced toolkit of Mybatis-Plus to simplify development. https://github.com/yulichang/mybatis-plus-join @@ -39,7 +39,7 @@ com.baomidou mybatis-plus-boot-starter 3.4.2 - compile + provided diff --git a/src/main/java/com/github/yulichang/MybatisPlusConfiguration.java b/src/main/java/com/github/yulichang/MybatisPlusConfiguration.java deleted file mode 100644 index 767b0b8..0000000 --- a/src/main/java/com/github/yulichang/MybatisPlusConfiguration.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.github.yulichang; - -import com.github.yulichang.injector.MPJSqlInjector; -import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; -import org.springframework.context.annotation.Bean; -import org.springframework.context.annotation.Configuration; - -/** - * @author yulichang - */ -@Configuration -public class MybatisPlusConfiguration { - - @Bean - @ConditionalOnMissingBean(MPJSqlInjector.class) - public MPJSqlInjector mySqlInjector() { - return new MPJSqlInjector(); - } - -} diff --git a/src/main/resources/META-INF/spring.factories b/src/main/resources/META-INF/spring.factories deleted file mode 100644 index d0f8f3c..0000000 --- a/src/main/resources/META-INF/spring.factories +++ /dev/null @@ -1,2 +0,0 @@ -org.springframework.boot.autoconfigure.EnableAutoConfiguration=\ - com.github.yulichang.MybatisPlusConfiguration