From e1b32c6895ab790a4c2405c70a0b0914d514e354 Mon Sep 17 00:00:00 2001 From: taojinlong Date: Wed, 15 Sep 2021 18:20:31 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=94=AF=E6=8C=81=E7=9B=B4=E8=BF=9E?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=EF=BC=88ch=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/pom.xml | 10 +- .../io/dataease/base/domain/Datasource.java | 21 +- .../base/domain/DatasourceExample.java | 70 ++ .../dataease/base/mapper/DatasourceMapper.xml | 31 +- .../base/mapper/ext/ExtDataSourceMapper.xml | 4 +- .../datasource/constants/DatasourceTypes.java | 1 + .../datasource/dto/CHConfigration.java | 19 + .../datasource/provider/JdbcProvider.java | 33 +- .../datasource/provider/ProviderFactory.java | 2 + .../io/dataease/provider/ch/CHConstants.java | 41 + .../dataease/provider/ch/CHQueryProvider.java | 1002 +++++++++++++++++ .../resources/db/migration/V26__de1.3.sql | 2 + .../src/main/resources/generatorConfig.xml | 2 +- frontend/src/lang/en.js | 2 + frontend/src/lang/tw.js | 2 + frontend/src/lang/zh.js | 9 +- frontend/src/views/dataset/add/AddDB.vue | 12 +- frontend/src/views/dataset/add/AddSQL.vue | 18 +- .../src/views/system/datasource/DsTree.vue | 4 + frontend/src/views/system/datasource/form.vue | 36 +- 20 files changed, 1278 insertions(+), 43 deletions(-) create mode 100644 backend/src/main/java/io/dataease/datasource/dto/CHConfigration.java create mode 100644 backend/src/main/java/io/dataease/provider/ch/CHConstants.java create mode 100644 backend/src/main/java/io/dataease/provider/ch/CHQueryProvider.java diff --git a/backend/pom.xml b/backend/pom.xml index 2bb2b6b50d..c4bda7ce63 100644 --- a/backend/pom.xml +++ b/backend/pom.xml @@ -342,11 +342,11 @@ spring-boot-starter-data-ldap - + + ru.yandex.clickhouse + clickhouse-jdbc + 0.3.1 + diff --git a/backend/src/main/java/io/dataease/base/domain/Datasource.java b/backend/src/main/java/io/dataease/base/domain/Datasource.java index 86b2bca643..d8a2f6c4ac 100644 --- a/backend/src/main/java/io/dataease/base/domain/Datasource.java +++ b/backend/src/main/java/io/dataease/base/domain/Datasource.java @@ -1,29 +1,28 @@ package io.dataease.base.domain; import java.io.Serializable; - -import io.swagger.annotations.ApiModelProperty; import lombok.Data; @Data public class Datasource implements Serializable { - @ApiModelProperty("ID") private String id; - @ApiModelProperty("名称") + private String name; - @ApiModelProperty("描述") + private String desc; - @ApiModelProperty("类型") + private String type; - @ApiModelProperty("创建时间") + private Long createTime; - @ApiModelProperty("更新时间") + private Long updateTime; - @ApiModelProperty("创建者") + private String createBy; - @ApiModelProperty("状态") + private String status; - @ApiModelProperty("配置") + + private String computeType; + private String configuration; private static final long serialVersionUID = 1L; diff --git a/backend/src/main/java/io/dataease/base/domain/DatasourceExample.java b/backend/src/main/java/io/dataease/base/domain/DatasourceExample.java index c59e358431..c0fe88e1a8 100644 --- a/backend/src/main/java/io/dataease/base/domain/DatasourceExample.java +++ b/backend/src/main/java/io/dataease/base/domain/DatasourceExample.java @@ -643,6 +643,76 @@ public class DatasourceExample { addCriterion("`status` not between", value1, value2, "status"); return (Criteria) this; } + + public Criteria andComputeTypeIsNull() { + addCriterion("compute_type is null"); + return (Criteria) this; + } + + public Criteria andComputeTypeIsNotNull() { + addCriterion("compute_type is not null"); + return (Criteria) this; + } + + public Criteria andComputeTypeEqualTo(String value) { + addCriterion("compute_type =", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeNotEqualTo(String value) { + addCriterion("compute_type <>", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeGreaterThan(String value) { + addCriterion("compute_type >", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeGreaterThanOrEqualTo(String value) { + addCriterion("compute_type >=", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeLessThan(String value) { + addCriterion("compute_type <", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeLessThanOrEqualTo(String value) { + addCriterion("compute_type <=", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeLike(String value) { + addCriterion("compute_type like", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeNotLike(String value) { + addCriterion("compute_type not like", value, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeIn(List values) { + addCriterion("compute_type in", values, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeNotIn(List values) { + addCriterion("compute_type not in", values, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeBetween(String value1, String value2) { + addCriterion("compute_type between", value1, value2, "computeType"); + return (Criteria) this; + } + + public Criteria andComputeTypeNotBetween(String value1, String value2) { + addCriterion("compute_type not between", value1, value2, "computeType"); + return (Criteria) this; + } } public static class Criteria extends GeneratedCriteria { diff --git a/backend/src/main/java/io/dataease/base/mapper/DatasourceMapper.xml b/backend/src/main/java/io/dataease/base/mapper/DatasourceMapper.xml index 67713c420f..29abb1dcfb 100644 --- a/backend/src/main/java/io/dataease/base/mapper/DatasourceMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/DatasourceMapper.xml @@ -10,6 +10,7 @@ + @@ -73,7 +74,7 @@ - id, `name`, `desc`, `type`, create_time, update_time, create_by, `status` + id, `name`, `desc`, `type`, create_time, update_time, create_by, `status`, compute_type configuration @@ -129,12 +130,12 @@ insert into datasource (id, `name`, `desc`, `type`, create_time, update_time, - create_by, `status`, configuration - ) + create_by, `status`, compute_type, + configuration) values (#{id,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{desc,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}, - #{createBy,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{configuration,jdbcType=LONGVARCHAR} - ) + #{createBy,jdbcType=VARCHAR}, #{status,jdbcType=VARCHAR}, #{computeType,jdbcType=VARCHAR}, + #{configuration,jdbcType=LONGVARCHAR}) insert into datasource @@ -163,6 +164,9 @@ `status`, + + compute_type, + configuration, @@ -192,6 +196,9 @@ #{status,jdbcType=VARCHAR}, + + #{computeType,jdbcType=VARCHAR}, + #{configuration,jdbcType=LONGVARCHAR}, @@ -230,6 +237,9 @@ `status` = #{record.status,jdbcType=VARCHAR}, + + compute_type = #{record.computeType,jdbcType=VARCHAR}, + configuration = #{record.configuration,jdbcType=LONGVARCHAR}, @@ -248,6 +258,7 @@ update_time = #{record.updateTime,jdbcType=BIGINT}, create_by = #{record.createBy,jdbcType=VARCHAR}, `status` = #{record.status,jdbcType=VARCHAR}, + compute_type = #{record.computeType,jdbcType=VARCHAR}, configuration = #{record.configuration,jdbcType=LONGVARCHAR} @@ -262,7 +273,8 @@ create_time = #{record.createTime,jdbcType=BIGINT}, update_time = #{record.updateTime,jdbcType=BIGINT}, create_by = #{record.createBy,jdbcType=VARCHAR}, - `status` = #{record.status,jdbcType=VARCHAR} + `status` = #{record.status,jdbcType=VARCHAR}, + compute_type = #{record.computeType,jdbcType=VARCHAR} @@ -291,6 +303,9 @@ `status` = #{status,jdbcType=VARCHAR}, + + compute_type = #{computeType,jdbcType=VARCHAR}, + configuration = #{configuration,jdbcType=LONGVARCHAR}, @@ -306,6 +321,7 @@ update_time = #{updateTime,jdbcType=BIGINT}, create_by = #{createBy,jdbcType=VARCHAR}, `status` = #{status,jdbcType=VARCHAR}, + compute_type = #{computeType,jdbcType=VARCHAR}, configuration = #{configuration,jdbcType=LONGVARCHAR} where id = #{id,jdbcType=VARCHAR} @@ -317,7 +333,8 @@ create_time = #{createTime,jdbcType=BIGINT}, update_time = #{updateTime,jdbcType=BIGINT}, create_by = #{createBy,jdbcType=VARCHAR}, - `status` = #{status,jdbcType=VARCHAR} + `status` = #{status,jdbcType=VARCHAR}, + compute_type = #{computeType,jdbcType=VARCHAR} where id = #{id,jdbcType=VARCHAR} \ No newline at end of file diff --git a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml index d2dd06d0b8..0c994290b9 100644 --- a/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml +++ b/backend/src/main/java/io/dataease/base/mapper/ext/ExtDataSourceMapper.xml @@ -8,7 +8,7 @@