From ef510f94787f8f29eb833ad293bb447fde2b03aa Mon Sep 17 00:00:00 2001 From: YunaiV Date: Sat, 11 Mar 2023 18:23:07 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=20mybatis=20plus=20join=20?= =?UTF-8?q?=E9=9B=86=E6=88=90=E7=9A=84=E4=BF=AE=E6=94=B9=E5=BB=BA=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../framework/mybatis/config/MybatisPlusJoinConfiguration.java | 1 + .../yudao/framework/mybatis/core/mapper/BaseMapperX.java | 2 ++ .../cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java | 1 + 3 files changed, 4 insertions(+) diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/MybatisPlusJoinConfiguration.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/MybatisPlusJoinConfiguration.java index 3321a0212..63529ca20 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/MybatisPlusJoinConfiguration.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/config/MybatisPlusJoinConfiguration.java @@ -7,6 +7,7 @@ import org.springframework.context.annotation.Configuration; import java.util.List; +// TODO @升平:是不是作为 YudaoMybatisAutoConfiguration 的 bean 即可呀?然后 getMethodList 不用重写 @Configuration public class MybatisPlusJoinConfiguration extends JoinDefaultSqlInjector { diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java index 56e1deb05..2a7a828df 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/mapper/BaseMapperX.java @@ -17,6 +17,8 @@ import java.util.List; /** * 在 MyBatis Plus 的 BaseMapper 的基础上拓展,提供更多的能力 + * + * 为什么继承 JoinBaseMapper 接口?支持 MyBatis Plus 多表 Join 的能力。 */ public interface BaseMapperX extends JoinBaseMapper { diff --git a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java index 1b16ba0d1..fc29a1b78 100644 --- a/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java +++ b/yudao-framework/yudao-spring-boot-starter-test/src/main/java/cn/iocoder/yudao/framework/test/core/ut/BaseDbUnitTest.java @@ -38,6 +38,7 @@ public class BaseDbUnitTest { YudaoMybatisAutoConfiguration.class, // 自己的 MyBatis 配置类 MybatisPlusAutoConfiguration.class, // MyBatis 的自动配置类 MybatisPlusJoinConfiguration.class, // MyBatis 的自动配置类 + // TODO @升平:看看有没可能去掉下面两个类 JoinInterceptor.class, // MyBatis 的Join配置类 JoinInterceptorConfig.class, // MyBatis 的Join配置类 })