diff --git a/db/2pigxx.sql b/db/2pigxx.sql index 216cda91d..b08b855f7 100644 --- a/db/2pigxx.sql +++ b/db/2pigxx.sql @@ -237,6 +237,7 @@ INSERT INTO `sys_dict_item` VALUES (88, 27, 'oracle', 'oracle', 'ds_type', 'orac INSERT INTO `sys_dict_item` VALUES (89, 27, 'mssql', 'mssql', 'ds_type', 'mssql', 3, 'admin', ' ', '2023-03-12 09:58:42', NULL, NULL, '0', 1); INSERT INTO `sys_dict_item` VALUES (90, 27, 'db2', 'db2', 'ds_type', 'db2', 4, 'admin', ' ', '2023-03-12 09:58:53', NULL, NULL, '0', 1); INSERT INTO `sys_dict_item` VALUES (91, 27, 'dm', '达梦', 'ds_type', '达梦', 5, 'admin', ' ', '2023-03-12 09:59:07', NULL, NULL, '0', 1); +INSERT INTO `sys_dict_item` VALUES (92, 27, 'highgo', '瀚高', 'ds_type', '瀚高数据库', 5, 'admin', ' ', '2023-03-12 09:59:07', NULL, NULL, '0', 1); COMMIT; -- ---------------------------- diff --git a/pigx-common/pigx-common-bom/pom.xml b/pigx-common/pigx-common-bom/pom.xml index 7f278a5a5..5e4dd782e 100644 --- a/pigx-common/pigx-common-bom/pom.xml +++ b/pigx-common/pigx-common-bom/pom.xml @@ -26,6 +26,7 @@ 21.3.0.0 8.4.1.jre8 8.1.2.79 + 6.2.0 3.0.3 2.2.0 1.6.9 @@ -225,6 +226,11 @@ DmJdbcDriver18 ${dm.version} + + com.highgo + HgdbJdbc + ${highgo.version} + com.alibaba diff --git a/pigx-common/pigx-common-datasource/src/main/java/com/pig4cloud/pigx/common/datasource/util/DsJdbcUrlEnum.java b/pigx-common/pigx-common-datasource/src/main/java/com/pig4cloud/pigx/common/datasource/util/DsJdbcUrlEnum.java index b6b677e21..0a9e8f498 100644 --- a/pigx-common/pigx-common-datasource/src/main/java/com/pig4cloud/pigx/common/datasource/util/DsJdbcUrlEnum.java +++ b/pigx-common/pigx-common-datasource/src/main/java/com/pig4cloud/pigx/common/datasource/util/DsJdbcUrlEnum.java @@ -47,7 +47,12 @@ public enum DsJdbcUrlEnum { /** * 达梦 */ - DM("dm", "jdbc:dm://%s:%s/%s", "select 1 from dual", "达梦连接"); + DM("dm", "jdbc:dm://%s:%s/%s", "select 1 from dual", "达梦连接"), + + /** + * pg 数据库 + */ + HIGHGO("highgo", "jdbc:highgo://%s:%s/%s", "select 1", "highgo 链接"); private final String dbName; diff --git a/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/HighGoSqlProvider.java b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/HighGoSqlProvider.java new file mode 100644 index 000000000..25570ab70 --- /dev/null +++ b/pigx-common/pigx-common-sequence/src/main/java/com/pig4cloud/pigx/common/sequence/range/impl/db/provider/HighGoSqlProvider.java @@ -0,0 +1,31 @@ +package com.pig4cloud.pigx.common.sequence.range.impl.db.provider; + +import com.baomidou.mybatisplus.annotation.DbType; +import org.springframework.stereotype.Component; + +/** + * 瀚高数据源 + * + * @author lengleng + * @date 2023-04-26 + */ +@Component +public class HighGoSqlProvider implements SqlProvider { + + /** + * 获取建表语句 + * @return + */ + @Override + public String getCreateTableSql() { + return "CREATE TABLE IF NOT EXISTS #tableName (ID int8 PRIMARY KEY NOT NULL" + + ",VALUE int8 NOT NULL,NAME VARCHAR (266) NOT NULL,gmt_create TIMESTAMP (6) NOT NULL" + + ",gmt_modified TIMESTAMP (6) NOT NULL)"; + } + + @Override + public Boolean support(DbType dbType) { + return DbType.HIGH_GO.equals(dbType); + } + +} diff --git a/pigx-visual/pigx-codegen/pom.xml b/pigx-visual/pigx-codegen/pom.xml index f786ac28b..2d852c291 100755 --- a/pigx-visual/pigx-codegen/pom.xml +++ b/pigx-visual/pigx-codegen/pom.xml @@ -72,6 +72,11 @@ jcc ${db2.version} + + + com.highgo + HgdbJdbc + com.dameng diff --git a/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/mapper/GeneratorHighGoMapper.java b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/mapper/GeneratorHighGoMapper.java new file mode 100755 index 000000000..a94b154d0 --- /dev/null +++ b/pigx-visual/pigx-codegen/src/main/java/com/pig4cloud/pigx/codegen/mapper/GeneratorHighGoMapper.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018-2025, lengleng All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * Neither the name of the pig4cloud.com developer nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * Author: lengleng (wangiegie@gmail.com) + */ + +package com.pig4cloud.pigx.codegen.mapper; + +import org.apache.ibatis.annotations.Mapper; + +/** + * 支持 瀚高数据库 代码生成器 + * + * @author lengleng + * @date 2023-04-26 + */ +@Mapper +public interface GeneratorHighGoMapper extends GeneratorMapper { + +} diff --git a/pigx-visual/pigx-codegen/src/main/resources/mapper/GeneratorHighGoMapper.xml b/pigx-visual/pigx-codegen/src/main/resources/mapper/GeneratorHighGoMapper.xml new file mode 100755 index 000000000..95f9321db --- /dev/null +++ b/pigx-visual/pigx-codegen/src/main/resources/mapper/GeneratorHighGoMapper.xml @@ -0,0 +1,65 @@ + + + + + + + + + + SELECT + 'highgo' AS "dbType", + pa.attname AS "columnName", + pg_type.typname AS "columnType", + pg_type.typname AS "dataType", + col_description ( pa.attrelid, pa.attnum ) AS "comments", + ( + CASE + pcon.contype + WHEN 'p' THEN + 'PRI' ELSE'' + END + ) AS "columnKey" + FROM + pg_class AS pc, + pg_attribute AS pa + INNER JOIN pg_type ON pg_type.oid = pa.atttypid + LEFT JOIN pg_constraint pcon ON pa.attnum = pcon.conkey[1] + AND pa.attrelid = pcon.conrelid + WHERE + pc.relname = #{ tableName } + AND pa.attrelid = pc.oid + AND pa.attnum > 0 + + + + + +