diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java index 3b55d783b..974986fca 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/enums/DbTypeEnum.java @@ -11,10 +11,13 @@ import java.util.Optional; import java.util.function.Function; import java.util.stream.Collectors; - +/** + * 针对 MyBatis Plus 的 {@link DbType} 增强,补充更多信息 + */ @Getter @AllArgsConstructor public enum DbTypeEnum { + /** * MySQL */ @@ -27,6 +30,8 @@ public enum DbTypeEnum { /** * PostgreSQL + * + * 华为 openGauss 使用 ProductName 与 PostgreSQL 相同 */ POSTGRE_SQL(DbType.POSTGRE_SQL,"PostgreSQL", "POSITION('#{value}' IN #{column}) <> 0"), @@ -44,8 +49,6 @@ public enum DbTypeEnum { * 人大金仓 */ KINGBASE_ES(DbType.KINGBASE_ES, "KingbaseES", "POSITION('#{value}' IN #{column}) <> 0"), - - // 华为openGauss 使用ProductName 与 PostgreSQL相同 ; public static final Map MAP_BY_NAME = Arrays.stream(values()) @@ -54,9 +57,17 @@ public enum DbTypeEnum { public static final Map MAP_BY_MP = Arrays.stream(values()) .collect(Collectors.toMap(DbTypeEnum::getMpDbType, Function.identity())); - + /** + * MyBatis Plus 类型 + */ private final DbType mpDbType; + /** + * 数据库产品名 + */ private final String productName; + /** + * SQL FIND_IN_SET 模板 + */ private final String findInSetTemplate; public static DbType find(String databaseProductName) { diff --git a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java index 384b49d9a..611b71565 100644 --- a/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java +++ b/yudao-framework/yudao-spring-boot-starter-mybatis/src/main/java/cn/iocoder/yudao/framework/mybatis/core/util/MyBatisUtils.java @@ -102,4 +102,5 @@ public class MyBatisUtils { .replace("#{column}", column) .replace("#{value}", StrUtil.toString(value)); } + }