mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-15 22:46:49 +00:00
first commit
This commit is contained in:
74
semantic/api/pom.xml
Normal file
74
semantic/api/pom.xml
Normal file
@@ -0,0 +1,74 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<artifactId>semantic</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>semantic-api</artifactId>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>ru.yandex.clickhouse</groupId>
|
||||
<artifactId>clickhouse-jdbc</artifactId>
|
||||
<version>${clickhouse.jdbc.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>${lombok.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>jakarta.validation</groupId>
|
||||
<artifactId>jakarta.validation-api</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-core</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.google.guava</groupId>
|
||||
<artifactId>guava</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>fastjson</artifactId>
|
||||
<version>${fastjson.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-codec</groupId>
|
||||
<artifactId>commons-codec</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<version>${spring.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<artifactId>common</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<artifactId>auth-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,109 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.constant.Constants;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public enum DataTypeEnum {
|
||||
|
||||
MYSQL("mysql", "mysql", "com.mysql.cj.jdbc.Driver", "`", "`", "'", "'"),
|
||||
|
||||
HIVE2("hive2", "hive", "org.apache.hive.jdbc.HiveDriver", "`", "`", "`", "`"),
|
||||
|
||||
ORACLE("oracle", "oracle", "oracle.jdbc.driver.OracleDriver", "\"", "\"", "\"", "\""),
|
||||
|
||||
SQLSERVER("sqlserver", "sqlserver", "com.microsoft.sqlserver.jdbc.SQLServerDriver", "\"", "\"", "\"", "\""),
|
||||
|
||||
H2("h2", "h2", "org.h2.Driver", "`", "`", "\"", "\""),
|
||||
|
||||
PHOENIX("phoenix", "hbase phoenix", "org.apache.phoenix.jdbc.PhoenixDriver", "", "", "\"", "\""),
|
||||
|
||||
MONGODB("mongo", "mongodb", "mongodb.jdbc.MongoDriver", "`", "`", "\"", "\""),
|
||||
|
||||
ELASTICSEARCH("elasticsearch", "elasticsearch", "com.amazon.opendistroforelasticsearch.jdbc.Driver", "", "", "'",
|
||||
"'"),
|
||||
|
||||
PRESTO("presto", "presto", "com.facebook.presto.jdbc.PrestoDriver", "\"", "\"", "\"", "\""),
|
||||
|
||||
MOONBOX("moonbox", "moonbox", "moonbox.jdbc.MbDriver", "`", "`", "`", "`"),
|
||||
|
||||
CASSANDRA("cassandra", "cassandra", "com.github.adejanovski.cassandra.jdbc.CassandraDriver", "", "", "'", "'"),
|
||||
|
||||
CLICKHOUSE("clickhouse", "clickhouse", "ru.yandex.clickhouse.ClickHouseDriver", "", "", "\"", "\""),
|
||||
|
||||
KYLIN("kylin", "kylin", "org.apache.kylin.jdbc.Driver", "\"", "\"", "\"", "\""),
|
||||
|
||||
VERTICA("vertica", "vertica", "com.vertica.jdbc.Driver", "", "", "'", "'"),
|
||||
|
||||
HANA("sap", "sap hana", "com.sap.db.jdbc.Driver", "", "", "'", "'"),
|
||||
|
||||
IMPALA("impala", "impala", "com.cloudera.impala.jdbc41.Driver", "", "", "'", "'"),
|
||||
|
||||
TDENGINE("TAOS", "TAOS", "com.taosdata.jdbc.TSDBDriver", "'", "'", "\"", "\"");
|
||||
|
||||
private String feature;
|
||||
private String desc;
|
||||
private String driver;
|
||||
private String keywordPrefix;
|
||||
private String keywordSuffix;
|
||||
private String aliasPrefix;
|
||||
private String aliasSuffix;
|
||||
|
||||
DataTypeEnum(String feature, String desc, String driver, String keywordPrefix, String keywordSuffix,
|
||||
String aliasPrefix, String aliasSuffix) {
|
||||
this.feature = feature;
|
||||
this.desc = desc;
|
||||
this.driver = driver;
|
||||
this.keywordPrefix = keywordPrefix;
|
||||
this.keywordSuffix = keywordSuffix;
|
||||
this.aliasPrefix = aliasPrefix;
|
||||
this.aliasSuffix = aliasSuffix;
|
||||
}
|
||||
|
||||
public static DataTypeEnum urlOf(String jdbcUrl) throws RuntimeException {
|
||||
String url = jdbcUrl.toLowerCase().trim();
|
||||
for (DataTypeEnum dataTypeEnum : values()) {
|
||||
if (url.startsWith(String.format(Constants.JDBC_PREFIX_FORMATTER, dataTypeEnum.feature))) {
|
||||
return dataTypeEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static Set<String> getAllSupportedDatasourceNameSet() {
|
||||
Set<String> datasourceSet = new HashSet<>();
|
||||
for (DataTypeEnum datasource : values()) {
|
||||
datasourceSet.add(datasource.getFeature());
|
||||
}
|
||||
return datasourceSet;
|
||||
}
|
||||
|
||||
public String getFeature() {
|
||||
return feature;
|
||||
}
|
||||
|
||||
public String getDesc() {
|
||||
return desc;
|
||||
}
|
||||
|
||||
public String getDriver() {
|
||||
return driver;
|
||||
}
|
||||
|
||||
public String getKeywordPrefix() {
|
||||
return keywordPrefix;
|
||||
}
|
||||
|
||||
public String getKeywordSuffix() {
|
||||
return keywordSuffix;
|
||||
}
|
||||
|
||||
public String getAliasPrefix() {
|
||||
return aliasPrefix;
|
||||
}
|
||||
|
||||
public String getAliasSuffix() {
|
||||
return aliasSuffix;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
|
||||
public enum DimensionTypeEnum {
|
||||
|
||||
categorical,
|
||||
time
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
|
||||
public enum MetricTypeEnum {
|
||||
|
||||
EXPR("expr");
|
||||
|
||||
private String name;
|
||||
|
||||
MetricTypeEnum(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
public enum OperatorEnum {
|
||||
|
||||
MAX("MAX"),
|
||||
|
||||
MIN("MIN"),
|
||||
|
||||
AVG("AVG"),
|
||||
|
||||
SUM("SUM"),
|
||||
|
||||
DISTINCT("DISTINCT"),
|
||||
|
||||
TOPN("TOPN"),
|
||||
|
||||
PERCENTILE("PERCENTILE"),
|
||||
|
||||
UNKNOWN("UNKNOWN");
|
||||
|
||||
|
||||
OperatorEnum(String operator) {
|
||||
this.operator = operator;
|
||||
}
|
||||
|
||||
private String operator;
|
||||
|
||||
public String getOperator() {
|
||||
return operator;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
|
||||
public enum QueryTypeBackEnum {
|
||||
NORMAL("NORMAL", 0),
|
||||
|
||||
PRE_FLUSH("PRE_FLUSH", 1);
|
||||
|
||||
private String value;
|
||||
private Integer state;
|
||||
|
||||
QueryTypeBackEnum(String value, Integer state) {
|
||||
this.value = value;
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Integer getState() {
|
||||
return state;
|
||||
}
|
||||
|
||||
public static QueryTypeBackEnum of(String src) {
|
||||
for (QueryTypeBackEnum operatorEnum : QueryTypeBackEnum.values()) {
|
||||
if (src.toUpperCase().contains(operatorEnum.value)) {
|
||||
return operatorEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
|
||||
public enum QueryTypeEnum {
|
||||
SQL("SQL"),
|
||||
|
||||
STRUCT("STRUCT");
|
||||
|
||||
private String value;
|
||||
|
||||
QueryTypeEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public static QueryTypeEnum of(String src) {
|
||||
for (QueryTypeEnum operatorEnum : QueryTypeEnum.values()) {
|
||||
if (src.toUpperCase().contains(operatorEnum.value)) {
|
||||
return operatorEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tencent.supersonic.semantic.api.core.enums;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
|
||||
public enum TimeDimensionEnum {
|
||||
|
||||
DAY("sys_imp_date"),
|
||||
WEEK("sys_imp_week"),
|
||||
|
||||
MONTH("sys_imp_month");
|
||||
|
||||
private String name;
|
||||
|
||||
TimeDimensionEnum(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public static List<String> getNameList() {
|
||||
return Arrays.stream(TimeDimensionEnum.values()).map(TimeDimensionEnum::getName).collect(Collectors.toList());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DataFormat {
|
||||
|
||||
private boolean needMultiply100;
|
||||
|
||||
private Integer decimalPlaces;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DatasourceDetail {
|
||||
|
||||
private String queryType;
|
||||
|
||||
private String sqlQuery;
|
||||
|
||||
private String tableQuery;
|
||||
|
||||
private List<Identify> identifiers;
|
||||
|
||||
private List<Dim> dimensions;
|
||||
|
||||
private List<Measure> measures;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import com.tencent.supersonic.common.constant.Constants;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DatasourceType {
|
||||
|
||||
private String name;
|
||||
private String prefix;
|
||||
private List<String> versions;
|
||||
|
||||
public DatasourceType(String name, List<String> versions) {
|
||||
this.name = name;
|
||||
this.prefix = String.format(Constants.JDBC_PREFIX_FORMATTER, name);
|
||||
this.versions = versions;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import com.tencent.supersonic.common.constant.Constants;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Dim {
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private String expr;
|
||||
|
||||
private String dateFormat = Constants.DAY_FORMAT;
|
||||
|
||||
private DimensionTimeTypeParams typeParams;
|
||||
|
||||
private Integer isCreateDimension = 0;
|
||||
|
||||
private String bizName;
|
||||
|
||||
public static Dim getDefault() {
|
||||
return new Dim("日期", "time", "2023-05-28",
|
||||
Constants.DAY_FORMAT,
|
||||
new DimensionTimeTypeParams("true", "day"),
|
||||
0, "imp_date"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DimensionTimeTypeParams {
|
||||
|
||||
private String isPrimary;
|
||||
|
||||
private String timeGranularity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Identify {
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* like primary, foreign
|
||||
*/
|
||||
private String type;
|
||||
|
||||
private String bizName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class ItemDateFilter {
|
||||
|
||||
private List<Long> itemIds;
|
||||
@NonNull
|
||||
private String type;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Measure {
|
||||
|
||||
|
||||
private String name;
|
||||
|
||||
private String agg;
|
||||
|
||||
private String expr;
|
||||
|
||||
private String constraint;
|
||||
|
||||
private String alias;
|
||||
|
||||
private String createMetric;
|
||||
|
||||
private String bizName;
|
||||
|
||||
private Integer isCreateMetric = 0;
|
||||
|
||||
private Long datasourceId;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricTypeParams {
|
||||
|
||||
private List<Measure> measures;
|
||||
|
||||
private String expr;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Data
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
public class QueryAuthorization {
|
||||
|
||||
private String domainName;
|
||||
private List<String> dimensionFilters;
|
||||
private List<String> dimensionFiltersDesc;
|
||||
private String message;
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class QueryColumn {
|
||||
|
||||
private String name;
|
||||
private String type;
|
||||
private String nameEn;
|
||||
private String showType;
|
||||
private Boolean authorized = true;
|
||||
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type;
|
||||
}
|
||||
|
||||
public QueryColumn(String nameEn, String type) {
|
||||
this.type = type;
|
||||
this.nameEn = nameEn;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QueryResult<T> implements Serializable {
|
||||
|
||||
private int pageNo = -1;
|
||||
private int pageSize = -1;
|
||||
private long totalCount = -1;
|
||||
private List<T> resultList = new ArrayList<T>();
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QueryStat {
|
||||
|
||||
private Long id;
|
||||
private String traceId;
|
||||
private Long domainId;
|
||||
private String user;
|
||||
private String createdAt;
|
||||
/**
|
||||
* corresponding type, such as sql, struct, etc
|
||||
*/
|
||||
private String queryType;
|
||||
/**
|
||||
* NORMAL, PRE_FLUSH
|
||||
*/
|
||||
private Integer queryTypeBack;
|
||||
private String querySqlCmd;
|
||||
private String querySqlCmdMd5;
|
||||
private String queryStructCmd;
|
||||
private String queryStructCmdMd5;
|
||||
private String sql;
|
||||
private String sqlMd5;
|
||||
private String queryEngine;
|
||||
private Long startTime;
|
||||
private Long elapsedMs;
|
||||
private String queryState;
|
||||
private Boolean nativeQuery;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private String dimensions;
|
||||
private String metrics;
|
||||
private String selectCols;
|
||||
private String aggCols;
|
||||
private String filterCols;
|
||||
private String groupByCols;
|
||||
private String orderByCols;
|
||||
private Boolean useResultCache;
|
||||
private Boolean useSqlCache;
|
||||
private String sqlCacheKey;
|
||||
private String resultCacheKey;
|
||||
|
||||
public QueryStat setQuerySqlCmdMd5(String querySqlCmdMd5) {
|
||||
this.querySqlCmdMd5 = querySqlCmdMd5;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryStructCmdMd5(String queryStructCmdMd5) {
|
||||
this.queryStructCmdMd5 = queryStructCmdMd5;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setStartTime(Long startTime) {
|
||||
this.startTime = startTime;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryTypeBack(Integer queryTypeBack) {
|
||||
this.queryTypeBack = queryTypeBack;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setNativeQuery(Boolean nativeQuery) {
|
||||
this.nativeQuery = nativeQuery;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setTraceId(String traceId) {
|
||||
this.traceId = traceId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setClassId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setUser(String user) {
|
||||
this.user = user;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryType(String queryType) {
|
||||
this.queryType = queryType;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQuerySqlCmd(String querySqlCmd) {
|
||||
this.querySqlCmd = querySqlCmd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryStructCmd(String queryStructCmd) {
|
||||
this.queryStructCmd = queryStructCmd;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setSql(String sql) {
|
||||
this.sql = sql;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setSqlMd5(String sqlMd5) {
|
||||
this.sqlMd5 = sqlMd5;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryEngine(String queryEngine) {
|
||||
this.queryEngine = queryEngine;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setElapsedMs(Long elapsedMs) {
|
||||
this.elapsedMs = elapsedMs;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setQueryState(String queryState) {
|
||||
this.queryState = queryState;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setStartDate(String startDate) {
|
||||
this.startDate = startDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setEndDate(String endDate) {
|
||||
this.endDate = endDate;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setDimensions(String dimensions) {
|
||||
this.dimensions = dimensions;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setMetrics(String metrics) {
|
||||
this.metrics = metrics;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setSelectCols(String selectCols) {
|
||||
this.selectCols = selectCols;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setAggCols(String aggCols) {
|
||||
this.aggCols = aggCols;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setFilterCols(String filterCols) {
|
||||
this.filterCols = filterCols;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setGroupByCols(String groupByCols) {
|
||||
this.groupByCols = groupByCols;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setOrderByCols(String orderByCols) {
|
||||
this.orderByCols = orderByCols;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setUseResultCache(Boolean useResultCache) {
|
||||
this.useResultCache = useResultCache;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setUseSqlCache(Boolean useSqlCache) {
|
||||
this.useSqlCache = useSqlCache;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setSqlCacheKey(String sqlCacheKey) {
|
||||
this.sqlCacheKey = sqlCacheKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setResultCacheKey(String resultCacheKey) {
|
||||
this.resultCacheKey = resultCacheKey;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setId(Long id) {
|
||||
this.id = id;
|
||||
return this;
|
||||
}
|
||||
|
||||
public QueryStat setCreatedAt(String createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
return this;
|
||||
}
|
||||
|
||||
public List<String> getMetricListBizName() {
|
||||
if (Objects.isNull(metrics)) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return JSONObject.parseArray(metrics, String.class);
|
||||
}
|
||||
|
||||
|
||||
public List<String> getDimensionListBizName() {
|
||||
return JSONObject.parseArray(dimensions, String.class);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
public class RecordInfo {
|
||||
|
||||
|
||||
private String createdBy;
|
||||
|
||||
private String updatedBy;
|
||||
|
||||
private Date createdAt;
|
||||
|
||||
private Date updatedAt;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DatasourceYamlTpl {
|
||||
|
||||
private String name;
|
||||
|
||||
private Long sourceId;
|
||||
|
||||
private String sqlQuery;
|
||||
|
||||
private String tableQuery;
|
||||
|
||||
private List<IdentifyYamlTpl> identifiers;
|
||||
|
||||
private List<DimensionYamlTpl> dimensions;
|
||||
|
||||
private List<MeasureYamlTpl> measures;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DimensionTimeTypeParamsTpl {
|
||||
|
||||
private String isPrimary;
|
||||
|
||||
private String timeGranularity;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DimensionYamlTpl {
|
||||
|
||||
private String name;
|
||||
|
||||
private String owners;
|
||||
|
||||
private String type;
|
||||
|
||||
private String expr;
|
||||
|
||||
private DimensionTimeTypeParamsTpl typeParams;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class IdentifyYamlTpl {
|
||||
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 主键 primary 外键 foreign
|
||||
*/
|
||||
private String type;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MeasureYamlTpl {
|
||||
|
||||
private String name;
|
||||
|
||||
private String agg;
|
||||
|
||||
private String expr;
|
||||
|
||||
private String constraint;
|
||||
|
||||
private String alias;
|
||||
|
||||
private String createMetric;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricTypeParamsYamlTpl {
|
||||
|
||||
private List<MeasureYamlTpl> measures;
|
||||
|
||||
private String expr;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.api.core.pojo.yaml;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class MetricYamlTpl {
|
||||
|
||||
private String name;
|
||||
|
||||
private List<String> owners;
|
||||
|
||||
private String type;
|
||||
|
||||
private MetricTypeParamsYamlTpl typeParams;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
|
||||
@Data
|
||||
public class DatabaseReq {
|
||||
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private String host;
|
||||
|
||||
private String port;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String database;
|
||||
|
||||
private String description;
|
||||
|
||||
private String url;
|
||||
|
||||
public String getUrl() {
|
||||
if (StringUtils.isNotBlank(url)) {
|
||||
return url;
|
||||
}
|
||||
return String.format("jdbc:%s://%s:%s", type, host, port);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DatasourceRelaReq {
|
||||
|
||||
private Long id;
|
||||
|
||||
@NotNull(message = "class id cat not be null")
|
||||
private Long domainId;
|
||||
|
||||
@NotNull(message = "datasource id cat not be null")
|
||||
private Long datasourceFrom;
|
||||
|
||||
@NotNull(message = "datasource id cat not be null")
|
||||
private Long datasourceTo;
|
||||
|
||||
@NotNull(message = "join key cat not be null")
|
||||
private String joinKey;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Dim;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Identify;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Measure;
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DatasourceReq extends SchemaItem {
|
||||
|
||||
private Long databaseId;
|
||||
|
||||
private String queryType;
|
||||
|
||||
private String sqlQuery;
|
||||
|
||||
private String sqlTable;
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private List<Identify> identifiers;
|
||||
|
||||
private List<Dim> dimensions;
|
||||
|
||||
private List<Measure> measures;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DateInfoReq {
|
||||
|
||||
private String type;
|
||||
private Long itemId;
|
||||
private String dateFormat;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private List<String> unavailableDateList = new ArrayList<>();
|
||||
|
||||
public DateInfoReq(String type, Long itemId, String dateFormat, String startDate, String endDate) {
|
||||
this.type = type;
|
||||
this.itemId = itemId;
|
||||
this.dateFormat = dateFormat;
|
||||
this.startDate = startDate;
|
||||
this.endDate = endDate;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DimensionReq extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String type;
|
||||
|
||||
@NotNull(message = "expr can not be null")
|
||||
private String expr;
|
||||
|
||||
|
||||
private Long datasourceId;
|
||||
|
||||
//DATE ID CATEGORY
|
||||
private String semanticType = "CATEGORY";
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DomainReq extends SchemaItem {
|
||||
|
||||
private Long parentId = 0L;
|
||||
|
||||
private Integer isOpen = 0;
|
||||
|
||||
private List<String> viewers = new ArrayList<>();
|
||||
|
||||
private List<String> viewOrgs = new ArrayList<>();
|
||||
|
||||
private List<String> admins = new ArrayList<>();
|
||||
|
||||
private List<String> adminOrgs = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DomainSchemaFilterReq {
|
||||
|
||||
/**
|
||||
* if domainIds is empty, get all domain info
|
||||
*/
|
||||
private List<Long> domainIds;
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DomainUpdateReq extends DomainReq {
|
||||
|
||||
private Long id;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class MetricBaseReq extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.MetricTypeParams;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricReq extends MetricBaseReq {
|
||||
|
||||
private MetricTypeParams typeParams;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class PageDimensionReq extends PageSchemaItemReq {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class PageMetricReq extends PageSchemaItemReq {
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import com.tencent.supersonic.common.request.PageBaseReq;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PageSchemaItemReq extends PageBaseReq {
|
||||
|
||||
private Long id;
|
||||
private String name;
|
||||
private String bizName;
|
||||
private String createdBy;
|
||||
private Long domainId;
|
||||
private Integer sensitiveLevel;
|
||||
private Integer status;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SqlExecuteReq {
|
||||
|
||||
|
||||
@NotNull(message = "domainId can not be null")
|
||||
private Long domainId;
|
||||
|
||||
@NotBlank(message = "sql can not be blank")
|
||||
private String sql;
|
||||
|
||||
public String getSql() {
|
||||
return String.format(" select * from ( %s ) a limit 1000 ", sql);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package com.tencent.supersonic.semantic.api.core.request;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ViewInfoReq {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String type;
|
||||
|
||||
private Date createdAt;
|
||||
|
||||
private String createdBy;
|
||||
|
||||
private Date updatedAt;
|
||||
|
||||
private String updatedBy;
|
||||
|
||||
private String config;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
@Builder
|
||||
public class DatabaseResp {
|
||||
|
||||
private Long id;
|
||||
|
||||
private String name;
|
||||
|
||||
private String type;
|
||||
|
||||
private String url;
|
||||
|
||||
private String username;
|
||||
|
||||
private String password;
|
||||
|
||||
private String database;
|
||||
|
||||
public String getHost() {
|
||||
Pattern p = Pattern.compile("jdbc:(?<db>\\w+):.*((//)|@)(?<host>.+):(?<port>\\d+).*");
|
||||
Matcher m = p.matcher(url);
|
||||
if (m.find()) {
|
||||
return m.group("host");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
public String getPort() {
|
||||
Pattern p = Pattern.compile("jdbc:(?<db>\\w+):.*((//)|@)(?<host>.+):(?<port>\\d+).*");
|
||||
Matcher m = p.matcher(url);
|
||||
if (m.find()) {
|
||||
return m.group("port");
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import java.util.Date;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DatasourceRelaResp {
|
||||
|
||||
private Long id;
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private Long datasourceFrom;
|
||||
|
||||
private Long datasourceTo;
|
||||
|
||||
private String joinKey;
|
||||
|
||||
private Date createdAt;
|
||||
|
||||
private String createdBy;
|
||||
|
||||
private Date updatedAt;
|
||||
|
||||
private String updatedBy;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.DatasourceDetail;
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DatasourceResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private Long databaseId;
|
||||
|
||||
private DatasourceDetail datasourceDetail;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DimSchemaResp extends DimensionResp {
|
||||
|
||||
private Long useCnt = 0L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class DimensionResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String type;
|
||||
|
||||
private String expr;
|
||||
|
||||
private String fullPath;
|
||||
|
||||
private Long datasourceId;
|
||||
|
||||
private String datasourceName;
|
||||
|
||||
private String datasourceBizName;
|
||||
//DATE ID CATEGORY
|
||||
private String semanticType;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class DomainResp extends SchemaItem {
|
||||
|
||||
private Long parentId;
|
||||
|
||||
private String fullPath;
|
||||
|
||||
private List<String> viewers;
|
||||
|
||||
private List<String> viewOrgs;
|
||||
|
||||
private List<String> admins;
|
||||
|
||||
private List<String> adminOrgs;
|
||||
|
||||
private Integer isOpen = 0;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DomainSchemaRelaResp {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private DatasourceResp datasource;
|
||||
|
||||
private List<MetricResp> metrics;
|
||||
|
||||
private List<DimensionResp> dimensions;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class DomainSchemaResp extends DomainResp {
|
||||
|
||||
private List<String> entityNames;
|
||||
private List<MetricSchemaResp> metrics;
|
||||
private List<DimSchemaResp> dimensions;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
/**
|
||||
* @author: kanedai
|
||||
* @date: 2023/3/29
|
||||
*/
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@ToString
|
||||
public class ItemDateResp {
|
||||
|
||||
private String dateFormat;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private List<String> unavailableDateList = new ArrayList<>();
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class MeasureResp {
|
||||
|
||||
private String name;
|
||||
|
||||
//sum max min avg count distinct
|
||||
private String agg;
|
||||
|
||||
private String expr;
|
||||
|
||||
private String constraint;
|
||||
|
||||
private String alias;
|
||||
|
||||
private Long datasourceId;
|
||||
|
||||
private String datasourceName;
|
||||
|
||||
private String datasourceBizName;
|
||||
|
||||
private String bizName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.DataFormat;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.common.pojo.SchemaItem;
|
||||
import lombok.Data;
|
||||
|
||||
|
||||
@Data
|
||||
public class MetricResp extends SchemaItem {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String domainName;
|
||||
|
||||
//measure_proxy ratio expr cumulative derived
|
||||
private String type;
|
||||
|
||||
private MetricTypeParams typeParams;
|
||||
|
||||
private String fullPath;
|
||||
|
||||
|
||||
private String dataFormatType;
|
||||
|
||||
private DataFormat dataFormat;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricSchemaResp extends MetricResp {
|
||||
|
||||
private Long useCnt = 0L;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.QueryAuthorization;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.QueryColumn;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.QueryResult;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QueryResultWithSchemaResp extends QueryResult<Map<String, Object>> {
|
||||
|
||||
List<QueryColumn> columns;
|
||||
String sql;
|
||||
QueryAuthorization queryAuthorization;
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package com.tencent.supersonic.semantic.api.core.response;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class SqlParserResp {
|
||||
|
||||
private String sql = "";
|
||||
private String sourceId = "";
|
||||
private String errMsg = "";
|
||||
private Boolean ok;
|
||||
|
||||
public boolean isOk() {
|
||||
this.ok = "".equals(errMsg) && !"".equals(sql);
|
||||
return ok;
|
||||
}
|
||||
|
||||
public SqlParserResp error(String msg) {
|
||||
this.setErrMsg(msg);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
package com.tencent.supersonic.semantic.api.query.enums;
|
||||
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
public enum FilterOperatorEnum {
|
||||
IN("IN"),
|
||||
NOT_IN("NOT_IN"),
|
||||
EQUALS("="),
|
||||
BETWEEN("BETWEEN"),
|
||||
GREATER_THAN(">"),
|
||||
GREATER_THAN_EQUALS(">="),
|
||||
IS_NULL("IS_NULL"),
|
||||
IS_NOT_NULL("IS_NOT_NULL"),
|
||||
LIKE("LIKE"),
|
||||
MINOR_THAN("<"),
|
||||
MINOR_THAN_EQUALS("<="),
|
||||
NOT_EQUALS("!="),
|
||||
SQL_PART("SQL_PART"),
|
||||
EXISTS("EXISTS");
|
||||
|
||||
private String value;
|
||||
|
||||
FilterOperatorEnum(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@JsonValue
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static FilterOperatorEnum getSqlOperator(String type) {
|
||||
for (FilterOperatorEnum operatorEnum : FilterOperatorEnum.values()) {
|
||||
if (operatorEnum.value.equalsIgnoreCase(type) || operatorEnum.name().equalsIgnoreCase(type)) {
|
||||
return operatorEnum;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Cache {
|
||||
|
||||
private Boolean cache = true;
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"cache\":")
|
||||
.append(cache);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.enums.FilterOperatorEnum;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Criterion {
|
||||
|
||||
private String column;
|
||||
|
||||
private FilterOperatorEnum operator;
|
||||
|
||||
private Object value;
|
||||
|
||||
private List<Object> values;
|
||||
|
||||
private String dataType;
|
||||
|
||||
public enum NumericDataType {
|
||||
TINYINT("TINYINT"),
|
||||
SMALLINT("SMALLINT"),
|
||||
MEDIUMINT("MEDIUMINT"),
|
||||
INT("INT"),
|
||||
INTEGER("INTEGER"),
|
||||
BIGINT("BIGINT"),
|
||||
FLOAT("FLOAT"),
|
||||
DOUBLE("DOUBLE"),
|
||||
DECIMAL("DECIMAL"),
|
||||
NUMERIC("NUMERIC"),
|
||||
;
|
||||
private String type;
|
||||
|
||||
NumericDataType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
public enum StringDataType {
|
||||
VARCHAR("VARCHAR"),
|
||||
STRING("STRING"),
|
||||
;
|
||||
private String type;
|
||||
|
||||
StringDataType(String type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Criterion(String column, FilterOperatorEnum operator, Object value, String dataType) {
|
||||
super();
|
||||
this.column = column;
|
||||
this.operator = operator;
|
||||
this.value = value;
|
||||
this.dataType = dataType;
|
||||
|
||||
if (FilterOperatorEnum.BETWEEN.name().equals(operator) || FilterOperatorEnum.IN.name().equals(operator)
|
||||
|| FilterOperatorEnum.NOT_IN.name().equals(operator)) {
|
||||
this.values = (List) value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public boolean isNeedApostrophe() {
|
||||
return Arrays.stream(StringDataType.values())
|
||||
.filter(value -> this.dataType.equalsIgnoreCase(value.getType())).findFirst()
|
||||
.isPresent();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.enums.FilterOperatorEnum;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Filter {
|
||||
|
||||
public enum Relation {
|
||||
FILTER, OR, AND
|
||||
}
|
||||
|
||||
private Relation relation = Relation.FILTER;
|
||||
private String bizName;
|
||||
|
||||
private String name;
|
||||
|
||||
private FilterOperatorEnum operator;
|
||||
|
||||
private Object value;
|
||||
|
||||
private List<Filter> children;
|
||||
|
||||
public Filter(String bizName, FilterOperatorEnum operator, Object value) {
|
||||
this.bizName = bizName;
|
||||
this.operator = operator;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
|
||||
public Filter(Relation relation, String bizName, FilterOperatorEnum operator, Object value) {
|
||||
this.relation = relation;
|
||||
this.bizName = bizName;
|
||||
this.operator = operator;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"relation\":")
|
||||
.append(relation);
|
||||
sb.append(",\"bizName\":\"")
|
||||
.append(bizName).append('\"');
|
||||
sb.append(",\"name\":\"")
|
||||
.append(name).append('\"');
|
||||
sb.append(",\"operator\":")
|
||||
.append(operator);
|
||||
sb.append(",\"value\":")
|
||||
.append(value);
|
||||
sb.append(",\"children\":")
|
||||
.append(children);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Materialization {
|
||||
|
||||
private String name;
|
||||
private String destination;
|
||||
private String destinationType;
|
||||
private List<String> depends;
|
||||
private List<String> metrics;
|
||||
private List<String> dimensions;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricTable {
|
||||
|
||||
private String alias;
|
||||
private List<String> metrics;
|
||||
private List<String> dimensions;
|
||||
private String where;
|
||||
private boolean isAgg = false;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.tencent.supersonic.semantic.api.query.pojo;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Param {
|
||||
|
||||
@NotBlank(message = "Invald parameter name")
|
||||
private String name;
|
||||
|
||||
@NotBlank(message = "Invalid parameter value")
|
||||
private String value;
|
||||
|
||||
public Param() {
|
||||
}
|
||||
|
||||
public Param(String name, String value) {
|
||||
this.name = name;
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"name\":\"")
|
||||
.append(name).append('\"');
|
||||
sb.append(",\"value\":\"")
|
||||
.append(value).append('\"');
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
@NoArgsConstructor
|
||||
public class ItemUseReq {
|
||||
|
||||
private String startTime;
|
||||
private Long domainId;
|
||||
private Boolean cacheEnable = true;
|
||||
private String metric;
|
||||
|
||||
public ItemUseReq(String startTime, Long domainId) {
|
||||
this.startTime = startTime;
|
||||
this.domainId = domainId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.ColumnOrder;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class MetricReq {
|
||||
|
||||
private List<String> metrics;
|
||||
private List<String> dimensions;
|
||||
private String rootPath = "";
|
||||
private Map<String, String> variables;
|
||||
private String where;
|
||||
private Long limit;
|
||||
private List<ColumnOrder> order;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.MetricTable;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ParseSqlReq {
|
||||
|
||||
private String rootPath = "";
|
||||
private Map<String, String> variables;
|
||||
private String sql;
|
||||
private List<MetricTable> tables;
|
||||
|
||||
public Map<String, String> getVariables() {
|
||||
if (variables == null) {
|
||||
variables = new HashMap<>();
|
||||
}
|
||||
return variables;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QueryMultiStructReq {
|
||||
|
||||
|
||||
List<QueryStructReq> queryStructCmds;
|
||||
|
||||
|
||||
public String toCustomizedString() {
|
||||
return JSONObject.toJSONString(queryStructCmds);
|
||||
}
|
||||
|
||||
public String generateCommandMd5() {
|
||||
return DigestUtils.md5Hex(this.toCustomizedString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import java.util.Map;
|
||||
import lombok.Data;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@ToString
|
||||
public class QuerySqlReq {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private String sql;
|
||||
|
||||
private Map<String, String> variables;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,132 @@
|
||||
package com.tencent.supersonic.semantic.api.query.request;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Cache;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Filter;
|
||||
import com.tencent.supersonic.semantic.api.query.pojo.Param;
|
||||
import com.tencent.supersonic.common.pojo.Aggregator;
|
||||
import com.tencent.supersonic.common.pojo.DateConf;
|
||||
import com.tencent.supersonic.common.pojo.Order;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.Data;
|
||||
import org.apache.commons.codec.digest.DigestUtils;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@Data
|
||||
public class QueryStructReq {
|
||||
|
||||
private Long domainId;
|
||||
|
||||
private List<String> groups = new ArrayList<>();
|
||||
private List<Aggregator> aggregators = new ArrayList<>();
|
||||
private List<Order> orders = new ArrayList<>();
|
||||
private List<Filter> dimensionFilters = new ArrayList<>();
|
||||
private List<Filter> metricFilters = new ArrayList<>();
|
||||
private List<Param> params = new ArrayList<>();
|
||||
private DateConf dateInfo;
|
||||
private Long limit = 2000L;
|
||||
private Boolean nativeQuery = false;
|
||||
private Cache cacheInfo;
|
||||
|
||||
public List<String> getGroups() {
|
||||
if (!CollectionUtils.isEmpty(this.groups)) {
|
||||
this.groups = groups.stream().filter(group -> !Strings.isEmpty(group)).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
if (CollectionUtils.isEmpty(this.groups)) {
|
||||
this.groups = Lists.newArrayList();
|
||||
}
|
||||
|
||||
return this.groups;
|
||||
}
|
||||
|
||||
public List<String> getMetrics() {
|
||||
List<String> metrics = Lists.newArrayList();
|
||||
if (!CollectionUtils.isEmpty(this.aggregators)) {
|
||||
metrics = aggregators.stream().map(Aggregator::getColumn).collect(Collectors.toList());
|
||||
}
|
||||
return metrics;
|
||||
}
|
||||
|
||||
public List<Order> getOrders() {
|
||||
if (orders == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return orders;
|
||||
}
|
||||
|
||||
public List<Param> getParams() {
|
||||
if (params == null) {
|
||||
return Lists.newArrayList();
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
public String toCustomizedString() {
|
||||
StringBuilder stringBuilder = new StringBuilder("{");
|
||||
stringBuilder.append("\"domainId\":")
|
||||
.append(domainId);
|
||||
stringBuilder.append(",\"groups\":")
|
||||
.append(groups);
|
||||
stringBuilder.append(",\"aggregators\":")
|
||||
.append(aggregators);
|
||||
stringBuilder.append(",\"orders\":")
|
||||
.append(orders);
|
||||
stringBuilder.append(",\"filters\":")
|
||||
.append(dimensionFilters);
|
||||
stringBuilder.append(",\"dateInfo\":")
|
||||
.append(dateInfo);
|
||||
stringBuilder.append(",\"params\":")
|
||||
.append(params);
|
||||
stringBuilder.append(",\"limit\":")
|
||||
.append(limit);
|
||||
stringBuilder.append(",\"nativeQuery\":")
|
||||
.append(nativeQuery);
|
||||
stringBuilder.append('}');
|
||||
return stringBuilder.toString();
|
||||
}
|
||||
|
||||
|
||||
public String generateCommandMd5() {
|
||||
return DigestUtils.md5Hex(this.toCustomizedString());
|
||||
}
|
||||
|
||||
public List<Filter> getOriginalFilter() {
|
||||
return dimensionFilters;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
final StringBuilder sb = new StringBuilder("{");
|
||||
sb.append("\"domainId\":")
|
||||
.append(domainId);
|
||||
sb.append(",\"groups\":")
|
||||
.append(groups);
|
||||
sb.append(",\"aggregators\":")
|
||||
.append(aggregators);
|
||||
sb.append(",\"orders\":")
|
||||
.append(orders);
|
||||
sb.append(",\"dimensionFilters\":")
|
||||
.append(dimensionFilters);
|
||||
sb.append(",\"metricFilters\":")
|
||||
.append(metricFilters);
|
||||
sb.append(",\"params\":")
|
||||
.append(params);
|
||||
sb.append(",\"dateInfo\":")
|
||||
.append(dateInfo);
|
||||
sb.append(",\"limit\":")
|
||||
.append(limit);
|
||||
sb.append(",\"nativeQuery\":")
|
||||
.append(nativeQuery);
|
||||
sb.append(",\"cacheInfo\":")
|
||||
.append(cacheInfo);
|
||||
sb.append('}');
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.tencent.supersonic.semantic.api.query.response;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
@ToString
|
||||
public class ItemUseResp {
|
||||
|
||||
private Long domainId;
|
||||
private String type;
|
||||
private Long itemId;
|
||||
private String bizName;
|
||||
private Long useCnt;
|
||||
|
||||
public ItemUseResp(Long domainId, String type, String bizName, Long useCnt) {
|
||||
this.domainId = domainId;
|
||||
this.type = type;
|
||||
this.bizName = bizName;
|
||||
this.useCnt = useCnt;
|
||||
}
|
||||
}
|
||||
98
semantic/core/pom.xml
Normal file
98
semantic/core/pom.xml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<parent>
|
||||
<artifactId>semantic</artifactId>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
</parent>
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<artifactId>semantic-core</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.tencent.supersonic</groupId>
|
||||
<artifactId>semantic-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.alibaba</groupId>
|
||||
<artifactId>druid</artifactId>
|
||||
<version>${alibaba.druid.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mybatis</groupId>
|
||||
<artifactId>mybatis-spring</artifactId>
|
||||
<version>${mybatis-spring.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.github.pagehelper</groupId>
|
||||
<artifactId>pagehelper</artifactId>
|
||||
<version>${pagehelper.version}</version>
|
||||
<scope>compile</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
<version>${org.testng.version}</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.h2database</groupId>
|
||||
<artifactId>h2</artifactId>
|
||||
<version>${h2.version}</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
@@ -0,0 +1,105 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatabaseReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.SqlParserResp;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DatabaseDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.DatabaseRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.DatabaseConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.JdbcDataSourceUtils;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.SqlUtils;
|
||||
import com.tencent.supersonic.semantic.core.domain.DatabaseService;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.Database;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@Service
|
||||
public class DatabaseServiceImpl implements DatabaseService {
|
||||
|
||||
private DatabaseRepository databaseRepository;
|
||||
|
||||
private final SqlUtils sqlUtils;
|
||||
|
||||
public DatabaseServiceImpl(DatabaseRepository databaseRepository, SqlUtils sqlUtils) {
|
||||
this.databaseRepository = databaseRepository;
|
||||
this.sqlUtils = sqlUtils;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean testConnect(DatabaseReq databaseReq, User user) {
|
||||
Database database = DatabaseConverter.convert(databaseReq, user);
|
||||
return JdbcDataSourceUtils.testDatabase(database);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseResp createOrUpdateDatabase(DatabaseReq databaseReq, User user) {
|
||||
Database database = DatabaseConverter.convert(databaseReq, user);
|
||||
Optional<DatabaseDO> databaseDOOptional = getDatabaseDO(databaseReq.getDomainId());
|
||||
if (databaseDOOptional.isPresent()) {
|
||||
DatabaseDO databaseDO = DatabaseConverter.convert(database, databaseDOOptional.get());
|
||||
databaseRepository.updateDatabase(databaseDO);
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
DatabaseDO databaseDO = DatabaseConverter.convert(database);
|
||||
databaseRepository.createDatabase(databaseDO);
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseResp getDatabase(Long id) {
|
||||
DatabaseDO databaseDO = databaseRepository.getDatabase(id);
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
// one domain only has one database
|
||||
public DatabaseResp getDatabaseByDomainId(Long domainId) {
|
||||
Optional<DatabaseDO> databaseDO = getDatabaseDO(domainId);
|
||||
return databaseDO.map(DatabaseConverter::convert).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryResultWithSchemaResp executeSql(String sql, Long domainId) {
|
||||
DatabaseResp databaseResp = getDatabaseByDomainId(domainId);
|
||||
return executeSql(sql, databaseResp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryResultWithSchemaResp executeSql(String sql, DatabaseResp databaseResp) {
|
||||
|
||||
SqlUtils sqlUtils = this.sqlUtils.init(databaseResp);
|
||||
return queryWithColumns(sql, databaseResp);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryResultWithSchemaResp queryWithColumns(SqlParserResp sqlParser) {
|
||||
if (Strings.isEmpty(sqlParser.getSourceId())) {
|
||||
log.warn("data base id is empty");
|
||||
return null;
|
||||
}
|
||||
DatabaseResp databaseResp = getDatabase(Long.parseLong(sqlParser.getSourceId()));
|
||||
log.info("database info:{}", databaseResp);
|
||||
return queryWithColumns(sqlParser.getSql(), databaseResp);
|
||||
}
|
||||
|
||||
private QueryResultWithSchemaResp queryWithColumns(String sql, DatabaseResp databaseResp) {
|
||||
QueryResultWithSchemaResp queryResultWithColumns = new QueryResultWithSchemaResp();
|
||||
SqlUtils sqlUtils = this.sqlUtils.init(databaseResp);
|
||||
sqlUtils.queryInternal(sql, queryResultWithColumns);
|
||||
return queryResultWithColumns;
|
||||
}
|
||||
|
||||
private Optional<DatabaseDO> getDatabaseDO(Long domainId) {
|
||||
List<DatabaseDO> databaseDOS = databaseRepository.getDatabaseByDomainId(domainId);
|
||||
return databaseDOS.stream().findFirst();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,397 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.DatasourceDetail;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Dim;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatasourceRelaReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatasourceReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DateInfoReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.ItemDateResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MeasureResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricResp;
|
||||
import com.tencent.supersonic.common.util.json.JsonUtil;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DatasourceDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DatasourceRelaDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DateInfoDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.manager.DatasourceYamlManager;
|
||||
import com.tencent.supersonic.semantic.core.domain.manager.DimensionYamlManager;
|
||||
import com.tencent.supersonic.semantic.core.domain.manager.MetricYamlManager;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.DatasourceRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.DateInfoRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.DatasourceConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.DimensionConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.MetricConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.DatabaseService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DimensionService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DomainService;
|
||||
import com.tencent.supersonic.semantic.core.domain.MetricService;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.Datasource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DatasourceServiceImpl implements DatasourceService {
|
||||
|
||||
private DatasourceRepository datasourceRepository;
|
||||
|
||||
private DatasourceYamlManager datasourceYamlManager;
|
||||
|
||||
private DatabaseService databaseService;
|
||||
|
||||
private DimensionService dimensionService;
|
||||
|
||||
private MetricService metricService;
|
||||
|
||||
private DateInfoRepository dateInfoRepository;
|
||||
|
||||
private DomainService domainService;
|
||||
|
||||
|
||||
public DatasourceServiceImpl(DatasourceRepository datasourceRepository,
|
||||
DatasourceYamlManager datasourceYamlManager,
|
||||
DomainService domainService,
|
||||
DatabaseService databaseService,
|
||||
@Lazy DimensionService dimensionService,
|
||||
@Lazy MetricService metricService,
|
||||
DateInfoRepository dateInfoRepository) {
|
||||
this.domainService = domainService;
|
||||
this.datasourceRepository = datasourceRepository;
|
||||
this.datasourceYamlManager = datasourceYamlManager;
|
||||
this.databaseService = databaseService;
|
||||
this.dimensionService = dimensionService;
|
||||
this.metricService = metricService;
|
||||
this.dateInfoRepository = dateInfoRepository;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatasourceResp createDatasource(DatasourceReq datasourceReq, User user) throws Exception {
|
||||
preCheck(datasourceReq);
|
||||
Datasource datasource = DatasourceConverter.convert(datasourceReq);
|
||||
log.info("[create datasource] object:{}", JSONObject.toJSONString(datasource));
|
||||
saveDatasource(datasource, user);
|
||||
Optional<DatasourceResp> datasourceDescOptional = getDatasource(datasourceReq.getDomainId(),
|
||||
datasourceReq.getBizName());
|
||||
if (!datasourceDescOptional.isPresent()) {
|
||||
throw new RuntimeException("create datasource failed");
|
||||
}
|
||||
DatasourceResp datasourceDesc = datasourceDescOptional.get();
|
||||
datasource.setId(datasourceDesc.getId());
|
||||
batchCreateDimension(datasource, user);
|
||||
batchCreateMetric(datasource, user);
|
||||
List<DimensionResp> dimensionDescsExist = dimensionService.getDimensionsByDatasource(datasource.getId());
|
||||
DatabaseResp databaseResp = databaseService.getDatabase(datasource.getDatabaseId());
|
||||
datasourceYamlManager.generateYamlFile(datasource, databaseResp,
|
||||
domainService.getDomainFullPath(datasource.getDomainId()), dimensionDescsExist);
|
||||
return datasourceDesc;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DatasourceResp updateDatasource(DatasourceReq datasourceReq, User user) throws Exception {
|
||||
preCheck(datasourceReq);
|
||||
Datasource datasource = DatasourceConverter.convert(datasourceReq);
|
||||
|
||||
log.info("[update datasource] object:{}", JSONObject.toJSONString(datasource));
|
||||
|
||||
batchCreateDimension(datasource, user);
|
||||
batchCreateMetric(datasource, user);
|
||||
List<DimensionResp> dimensionDescsExist = dimensionService.getDimensionsByDatasource(datasource.getId());
|
||||
DatabaseResp databaseResp = databaseService.getDatabase(datasource.getDatabaseId());
|
||||
datasourceYamlManager.generateYamlFile(datasource, databaseResp,
|
||||
domainService.getDomainFullPath(datasource.getDomainId()), dimensionDescsExist);
|
||||
DatasourceDO datasourceDO = updateDatasource(datasource, user);
|
||||
return DatasourceConverter.convert(datasourceDO);
|
||||
}
|
||||
|
||||
private DatasourceDO updateDatasource(Datasource datasource, User user) {
|
||||
DatasourceDO datasourceDO = datasourceRepository.getDatasourceById(datasource.getId());
|
||||
datasource.updatedBy(user.getName());
|
||||
datasourceRepository.updateDatasource(DatasourceConverter.convert(datasourceDO, datasource));
|
||||
return datasourceDO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getSourceBizNameById(Long id) {
|
||||
DatasourceDO datasourceDO = getDatasourceById(id);
|
||||
if (datasourceDO == null) {
|
||||
String message = String.format("datasource with id:%s not exsit", id);
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
return datasourceDO.getBizName();
|
||||
}
|
||||
|
||||
|
||||
private DatasourceDO getDatasourceById(Long id) {
|
||||
return datasourceRepository.getDatasourceById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MeasureResp> getMeasureListOfDomain(Long domainId) {
|
||||
List<DatasourceResp> datasourceDescs = getDatasourceList(domainId);
|
||||
List<MeasureResp> measureDescs = Lists.newArrayList();
|
||||
if (!CollectionUtils.isEmpty(datasourceDescs)) {
|
||||
for (DatasourceResp datasourceDesc : datasourceDescs) {
|
||||
DatasourceDetail datasourceDetail = datasourceDesc.getDatasourceDetail();
|
||||
List<Measure> measures = datasourceDetail.getMeasures();
|
||||
if (!CollectionUtils.isEmpty(measures)) {
|
||||
measureDescs.addAll(
|
||||
measures.stream().map(measure -> DatasourceConverter.convert(measure, datasourceDesc))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return measureDescs;
|
||||
}
|
||||
|
||||
|
||||
private void batchCreateDimension(Datasource datasource, User user) throws Exception {
|
||||
List<DimensionReq> dimensionReqs = DatasourceConverter.convertDimensionList(datasource);
|
||||
dimensionService.createDimensionBatch(dimensionReqs, user);
|
||||
}
|
||||
|
||||
private void batchCreateMetric(Datasource datasource, User user) throws Exception {
|
||||
List<MetricReq> exprMetricReqs = DatasourceConverter.convertMetricList(datasource);
|
||||
metricService.createMetricBatch(exprMetricReqs, user);
|
||||
}
|
||||
|
||||
|
||||
private Optional<DatasourceResp> getDatasource(Long domainId, String bizName) {
|
||||
List<DatasourceResp> datasourceDescs = getDatasourceList(domainId);
|
||||
if (CollectionUtils.isEmpty(datasourceDescs)) {
|
||||
return Optional.empty();
|
||||
}
|
||||
for (DatasourceResp datasourceDesc : datasourceDescs) {
|
||||
if (datasourceDesc.getBizName().equals(bizName)) {
|
||||
return Optional.of(datasourceDesc);
|
||||
}
|
||||
}
|
||||
return Optional.empty();
|
||||
}
|
||||
|
||||
//保存并获取自增ID
|
||||
private void saveDatasource(Datasource datasource, User user) {
|
||||
DatasourceDO datasourceDO = DatasourceConverter.convert(datasource, user);
|
||||
log.info("[save datasource] datasourceDO:{}", JSONObject.toJSONString(datasourceDO));
|
||||
datasourceRepository.createDatasource(datasourceDO);
|
||||
datasource.setId(datasourceDO.getId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void preCheck(DatasourceReq datasourceReq) {
|
||||
List<Dim> dims = datasourceReq.getDimensions();
|
||||
if (CollectionUtils.isEmpty(dims)) {
|
||||
throw new RuntimeException("lack of dimension");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceResp> getDatasourceList(Long domainId) {
|
||||
return DatasourceConverter.convertList(datasourceRepository.getDatasourceList(domainId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceResp> getDatasourceList() {
|
||||
return DatasourceConverter.convertList(datasourceRepository.getDatasourceList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long domainId) {
|
||||
List<DatasourceResp> datasourceResps = getDatasourceList(domainId);
|
||||
for (DatasourceResp datasourceResp : datasourceResps) {
|
||||
if (!CollectionUtils.isEmpty(datasourceResp.getDatasourceDetail().getMeasures())) {
|
||||
for (Measure measure : datasourceResp.getDatasourceDetail().getMeasures()) {
|
||||
measure.setBizName(Optional.ofNullable(measure.getBizName()).orElse("")
|
||||
.replace(getDatasourcePrefix(datasourceResp.getBizName()), ""));
|
||||
}
|
||||
}
|
||||
}
|
||||
return datasourceResps;
|
||||
}
|
||||
|
||||
private String getDatasourcePrefix(String datasourceBizName) {
|
||||
return String.format("%s_", datasourceBizName);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Long, DatasourceResp> getDatasourceMap() {
|
||||
Map<Long, DatasourceResp> map = new HashMap<>();
|
||||
List<DatasourceResp> datasourceDescs = getDatasourceList();
|
||||
if (CollectionUtils.isEmpty(datasourceDescs)) {
|
||||
return map;
|
||||
}
|
||||
return datasourceDescs.stream().collect(Collectors.toMap(DatasourceResp::getId, a -> a, (k1, k2) -> k1));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteDatasource(Long id) throws Exception {
|
||||
DatasourceDO datasourceDO = datasourceRepository.getDatasourceById(id);
|
||||
if (datasourceDO == null) {
|
||||
return;
|
||||
}
|
||||
datasourceRepository.deleteDatasource(id);
|
||||
datasourceYamlManager.deleteYamlFile(datasourceDO.getBizName(),
|
||||
domainService.getDomainFullPath(datasourceDO.getDomainId()));
|
||||
}
|
||||
|
||||
|
||||
private List<DatasourceRelaResp> convertDatasourceRelaList(List<DatasourceRelaDO> datasourceRelaDOS) {
|
||||
List<DatasourceRelaResp> datasourceRelaResps = Lists.newArrayList();
|
||||
if (CollectionUtils.isEmpty(datasourceRelaDOS)) {
|
||||
return datasourceRelaResps;
|
||||
}
|
||||
return datasourceRelaDOS.stream().map(DatasourceConverter::convert).collect(Collectors.toList());
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
public DatasourceRelaResp createOrUpdateDatasourceRela(DatasourceRelaReq datasourceRelaReq, User user) {
|
||||
if (datasourceRelaReq.getId() == null) {
|
||||
DatasourceRelaDO datasourceRelaDO = new DatasourceRelaDO();
|
||||
BeanUtils.copyProperties(datasourceRelaReq, datasourceRelaDO);
|
||||
datasourceRelaDO.setCreatedAt(new Date());
|
||||
datasourceRelaDO.setCreatedBy(user.getName());
|
||||
datasourceRelaDO.setUpdatedAt(new Date());
|
||||
datasourceRelaDO.setUpdatedBy(user.getName());
|
||||
datasourceRepository.createDatasourceRela(datasourceRelaDO);
|
||||
return DatasourceConverter.convert(datasourceRelaDO);
|
||||
}
|
||||
Long id = datasourceRelaReq.getId();
|
||||
DatasourceRelaDO datasourceRelaDO = datasourceRepository.getDatasourceRelaById(id);
|
||||
BeanUtils.copyProperties(datasourceRelaDO, datasourceRelaReq);
|
||||
datasourceRelaDO.setUpdatedAt(new Date());
|
||||
datasourceRelaDO.setUpdatedBy(user.getName());
|
||||
datasourceRepository.updateDatasourceRela(datasourceRelaDO);
|
||||
return DatasourceConverter.convert(datasourceRelaDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceRelaResp> getDatasourceRelaList(Long domainId) {
|
||||
return convertDatasourceRelaList(datasourceRepository.getDatasourceRelaList(domainId));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteDatasourceRela(Long id) {
|
||||
datasourceRepository.deleteDatasourceRela(id);
|
||||
}
|
||||
|
||||
|
||||
public ItemDateResp getDateDate(ItemDateFilter dimension, ItemDateFilter metric) {
|
||||
List<DateInfoReq> itemDates = new ArrayList<>();
|
||||
List<DateInfoDO> dimensions = dateInfoRepository.getDateInfos(dimension);
|
||||
List<DateInfoDO> metrics = dateInfoRepository.getDateInfos(metric);
|
||||
|
||||
log.info("getDateDate, dimension:{}, dimensions dateInfo:{}", dimension, dimensions);
|
||||
log.info("getDateDate, metric:{}, metrics dateInfo:{}", metric, metrics);
|
||||
itemDates.addAll(convert(dimensions));
|
||||
itemDates.addAll(convert(metrics));
|
||||
|
||||
ItemDateResp itemDateDescriptor = calculateDateInternal(itemDates);
|
||||
log.info("itemDateDescriptor:{}", itemDateDescriptor);
|
||||
|
||||
return itemDateDescriptor;
|
||||
}
|
||||
|
||||
private List<DateInfoReq> convert(List<DateInfoDO> dateInfoDOList) {
|
||||
List<DateInfoReq> dateInfoCommendList = new ArrayList<>();
|
||||
dateInfoDOList.stream().forEach(dateInfoDO -> {
|
||||
DateInfoReq dateInfoCommend = new DateInfoReq();
|
||||
BeanUtils.copyProperties(dateInfoDO, dateInfoCommend);
|
||||
dateInfoCommend.setUnavailableDateList(JsonUtil.toList(dateInfoDO.getUnavailableDateList(), String.class));
|
||||
dateInfoCommendList.add(dateInfoCommend);
|
||||
});
|
||||
return dateInfoCommendList;
|
||||
}
|
||||
|
||||
private ItemDateResp calculateDateInternal(List<DateInfoReq> itemDates) {
|
||||
if (CollectionUtils.isEmpty(itemDates)) {
|
||||
log.warn("itemDates is empty!");
|
||||
return null;
|
||||
}
|
||||
String dateFormat = itemDates.get(0).getDateFormat();
|
||||
String startDate = itemDates.get(0).getStartDate();
|
||||
String endDate = itemDates.get(0).getEndDate();
|
||||
List<String> unavailableDateList = itemDates.get(0).getUnavailableDateList();
|
||||
for (DateInfoReq item : itemDates) {
|
||||
String startDate1 = item.getStartDate();
|
||||
String endDate1 = item.getEndDate();
|
||||
List<String> unavailableDateList1 = item.getUnavailableDateList();
|
||||
if (Strings.isNotEmpty(startDate1) && startDate1.compareTo(startDate) < 0) {
|
||||
startDate = startDate1;
|
||||
}
|
||||
if (Strings.isNotEmpty(endDate1) && startDate1.compareTo(endDate1) > 0) {
|
||||
endDate = endDate1;
|
||||
}
|
||||
if (!CollectionUtils.isEmpty(unavailableDateList1)) {
|
||||
unavailableDateList.addAll(unavailableDateList1);
|
||||
}
|
||||
}
|
||||
|
||||
return new ItemDateResp(dateFormat, startDate, endDate, unavailableDateList);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
|
||||
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList) {
|
||||
for (Long domainId : domainIds) {
|
||||
List<DatasourceResp> datasourceResps = getDatasourceList(domainId);
|
||||
List<MetricResp> metricResps = metricService.getMetrics(domainId);
|
||||
metricYamlTplList.addAll(MetricYamlManager.convert2YamlObj(MetricConverter.metricInfo2Metric(metricResps)));
|
||||
DatabaseResp databaseResp = databaseService.getDatabaseByDomainId(domainId);
|
||||
List<DimensionResp> dimensionResps = dimensionService.getDimensions(domainId);
|
||||
for (DatasourceResp datasourceResp : datasourceResps) {
|
||||
datasourceYamlTplList.add(DatasourceYamlManager.convert2YamlObj(
|
||||
DatasourceConverter.datasourceInfo2Datasource(datasourceResp), databaseResp));
|
||||
if (!dimensionYamlMap.containsKey(datasourceResp.getBizName())) {
|
||||
dimensionYamlMap.put(datasourceResp.getBizName(), new ArrayList<>());
|
||||
}
|
||||
List<DimensionResp> dimensionRespList = dimensionResps.stream()
|
||||
.filter(d -> d.getDatasourceBizName().equalsIgnoreCase(datasourceResp.getBizName()))
|
||||
.collect(Collectors.toList());
|
||||
dimensionYamlMap.get(datasourceResp.getBizName()).addAll(DimensionYamlManager.convert2DimensionYaml(
|
||||
DimensionConverter.dimensionInfo2Dimension(dimensionRespList)));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.PageDimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimensionResp;
|
||||
import com.tencent.supersonic.common.enums.SensitiveLevelEnum;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DimensionDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.manager.DimensionYamlManager;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.DimensionRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.DimensionConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DimensionService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DomainService;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.Dimension;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.DimensionFilter;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DimensionServiceImpl implements DimensionService {
|
||||
|
||||
|
||||
private DimensionRepository dimensionRepository;
|
||||
|
||||
private DimensionYamlManager dimensionYamlManager;
|
||||
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
private DomainService domainService;
|
||||
|
||||
|
||||
public DimensionServiceImpl(DimensionRepository dimensionRepository,
|
||||
DimensionYamlManager dimensionYamlManager,
|
||||
DomainService domainService,
|
||||
DatasourceService datasourceService) {
|
||||
this.domainService = domainService;
|
||||
this.dimensionRepository = dimensionRepository;
|
||||
this.dimensionYamlManager = dimensionYamlManager;
|
||||
this.datasourceService = datasourceService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createDimension(DimensionReq dimensionReq, User user) throws Exception {
|
||||
checkExist(Lists.newArrayList(dimensionReq));
|
||||
Dimension dimension = DimensionConverter.convert(dimensionReq);
|
||||
log.info("[create dimension] object:{}", JSONObject.toJSONString(dimension));
|
||||
saveDimensionAndGenerateYaml(dimension, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createDimensionBatch(List<DimensionReq> dimensionReqs, User user) throws Exception {
|
||||
if (CollectionUtils.isEmpty(dimensionReqs)) {
|
||||
return;
|
||||
}
|
||||
Long domainId = dimensionReqs.get(0).getDomainId();
|
||||
List<DimensionResp> dimensionDescs = getDimensions(domainId);
|
||||
Map<String, DimensionResp> dimensionDescMap = dimensionDescs.stream()
|
||||
.collect(Collectors.toMap(DimensionResp::getBizName, a -> a, (k1, k2) -> k1));
|
||||
List<Dimension> dimensions = dimensionReqs.stream().map(DimensionConverter::convert)
|
||||
.collect(Collectors.toList());
|
||||
List<Dimension> dimensionToInsert = dimensions.stream()
|
||||
.filter(dimension -> !dimensionDescMap.containsKey(dimension.getBizName()))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
log.info("[create dimension] object:{}", JSONObject.toJSONString(dimensions));
|
||||
saveDimensionBatch(dimensionToInsert, user);
|
||||
generateYamlFile(dimensions.get(0).getDatasourceId(), dimensions.get(0).getDomainId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateDimension(DimensionReq dimensionReq, User user) throws Exception {
|
||||
Dimension dimension = DimensionConverter.convert(dimensionReq);
|
||||
dimension.updatedBy(user.getName());
|
||||
log.info("[update dimension] object:{}", JSONObject.toJSONString(dimension));
|
||||
updateDimension(dimension);
|
||||
generateYamlFile(dimension.getDatasourceId(), dimension.getDomainId());
|
||||
}
|
||||
|
||||
protected void updateDimension(Dimension dimension) {
|
||||
DimensionDO dimensionDO = dimensionRepository.getDimensionById(dimension.getId());
|
||||
dimensionRepository.updateDimension(DimensionConverter.convert(dimensionDO, dimension));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DimensionResp getDimension(String bizName, Long domainId) {
|
||||
List<DimensionResp> dimensionDescs = getDimensions(domainId);
|
||||
if (CollectionUtils.isEmpty(dimensionDescs)) {
|
||||
return null;
|
||||
}
|
||||
for (DimensionResp dimensionDesc : dimensionDescs) {
|
||||
if (dimensionDesc.getBizName().equalsIgnoreCase(bizName)) {
|
||||
return dimensionDesc;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<DimensionResp> queryDimension(PageDimensionReq pageDimensionReq) {
|
||||
DimensionFilter dimensionFilter = new DimensionFilter();
|
||||
BeanUtils.copyProperties(pageDimensionReq, dimensionFilter);
|
||||
PageInfo<DimensionDO> dimensionDOPageInfo = PageHelper.startPage(pageDimensionReq.getCurrent(),
|
||||
pageDimensionReq.getPageSize())
|
||||
.doSelectPageInfo(() -> queryDimension(dimensionFilter));
|
||||
PageInfo<DimensionResp> pageInfo = new PageInfo<>();
|
||||
BeanUtils.copyProperties(dimensionDOPageInfo, pageInfo);
|
||||
pageInfo.setList(convertList(dimensionDOPageInfo.getList(), datasourceService.getDatasourceMap()));
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
private List<DimensionDO> queryDimension(DimensionFilter dimensionFilter) {
|
||||
return dimensionRepository.getDimension(dimensionFilter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DimensionResp> getDimensions(List<Long> ids) {
|
||||
List<DimensionResp> dimensionDescs = Lists.newArrayList();
|
||||
List<DimensionDO> dimensionDOS = dimensionRepository.getDimensionListByIds(ids);
|
||||
Map<Long, String> fullDomainPathMap = domainService.getDomainFullPath();
|
||||
if (!CollectionUtils.isEmpty(dimensionDOS)) {
|
||||
dimensionDescs = dimensionDOS.stream()
|
||||
.map(dimensionDO -> DimensionConverter.convert2DimensionDesc(dimensionDO, fullDomainPathMap,
|
||||
new HashMap<>()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return dimensionDescs;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DimensionResp> getDimensions(Long domainId) {
|
||||
return convertList(getDimensionDOS(domainId), datasourceService.getDatasourceMap());
|
||||
}
|
||||
|
||||
|
||||
public List<Dimension> getDimensionList(Long datasourceId) {
|
||||
List<Dimension> dimensions = Lists.newArrayList();
|
||||
List<DimensionDO> dimensionDOS = dimensionRepository.getDimensionListOfDatasource(datasourceId);
|
||||
if (!CollectionUtils.isEmpty(dimensionDOS)) {
|
||||
dimensions = dimensionDOS.stream().map(DimensionConverter::convert2Dimension).collect(Collectors.toList());
|
||||
}
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DimensionResp> getDimensionsByDatasource(Long datasourceId) {
|
||||
List<DimensionResp> dimensionDescs = Lists.newArrayList();
|
||||
List<DimensionDO> dimensionDOS = dimensionRepository.getDimensionListOfDatasource(datasourceId);
|
||||
if (!CollectionUtils.isEmpty(dimensionDOS)) {
|
||||
dimensionDescs = dimensionDOS.stream()
|
||||
.map(dimensionDO -> DimensionConverter.convert2DimensionDesc(dimensionDO, new HashMap<>(),
|
||||
new HashMap<>()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return dimensionDescs;
|
||||
}
|
||||
|
||||
private List<DimensionResp> convertList(List<DimensionDO> dimensionDOS,
|
||||
Map<Long, DatasourceResp> datasourceDescMap) {
|
||||
List<DimensionResp> dimensionDescs = Lists.newArrayList();
|
||||
Map<Long, String> fullDomainPathMap = domainService.getDomainFullPath();
|
||||
if (!CollectionUtils.isEmpty(dimensionDOS)) {
|
||||
dimensionDescs = dimensionDOS.stream()
|
||||
.map(dimensionDO -> DimensionConverter.convert2DimensionDesc(dimensionDO, fullDomainPathMap,
|
||||
datasourceDescMap))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return dimensionDescs;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public List<DimensionResp> getHighSensitiveDimension(Long domainId) {
|
||||
List<DimensionResp> dimensionDescs = getDimensions(domainId);
|
||||
if (CollectionUtils.isEmpty(dimensionDescs)) {
|
||||
return dimensionDescs;
|
||||
}
|
||||
return dimensionDescs.stream()
|
||||
.filter(dimensionDesc -> SensitiveLevelEnum.HIGH.getCode().equals(dimensionDesc.getSensitiveLevel()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
protected List<DimensionDO> getDimensionDOS(Long domainId) {
|
||||
return dimensionRepository.getDimensionListOfDomain(domainId);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DimensionResp> getAllHighSensitiveDimension() {
|
||||
List<DimensionResp> dimensionDescs = Lists.newArrayList();
|
||||
List<DimensionDO> dimensionDOS = dimensionRepository.getAllDimensionList();
|
||||
if (CollectionUtils.isEmpty(dimensionDOS)) {
|
||||
return dimensionDescs;
|
||||
}
|
||||
return convertList(dimensionDOS.stream()
|
||||
.filter(dimensionDO -> SensitiveLevelEnum.HIGH.getCode().equals(dimensionDO.getSensitiveLevel()))
|
||||
.collect(Collectors.toList()), new HashMap<>());
|
||||
}
|
||||
|
||||
|
||||
//保存并获取自增ID
|
||||
private void saveDimension(Dimension dimension) {
|
||||
DimensionDO dimensionDO = DimensionConverter.convert2DimensionDO(dimension);
|
||||
log.info("[save dimension] dimensionDO:{}", JSONObject.toJSONString(dimensionDO));
|
||||
dimensionRepository.createDimension(dimensionDO);
|
||||
dimension.setId(dimensionDO.getId());
|
||||
}
|
||||
|
||||
private void saveDimensionBatch(List<Dimension> dimensions, User user) {
|
||||
if (CollectionUtils.isEmpty(dimensions)) {
|
||||
return;
|
||||
}
|
||||
dimensions = dimensions.stream().peek(dimension -> dimension.createdBy(user.getName()))
|
||||
.collect(Collectors.toList());
|
||||
List<DimensionDO> dimensionDOS = dimensions.stream()
|
||||
.map(DimensionConverter::convert2DimensionDO).collect(Collectors.toList());
|
||||
log.info("[save dimension] dimensionDO:{}", JSONObject.toJSONString(dimensionDOS));
|
||||
dimensionRepository.createDimensionBatch(dimensionDOS);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public void deleteDimension(Long id) throws Exception {
|
||||
DimensionDO dimensionDO = dimensionRepository.getDimensionById(id);
|
||||
if (dimensionDO == null) {
|
||||
throw new RuntimeException(String.format("the dimension %s not exist", id));
|
||||
}
|
||||
dimensionRepository.deleteDimension(id);
|
||||
generateYamlFile(dimensionDO.getDatasourceId(), dimensionDO.getDomainId());
|
||||
}
|
||||
|
||||
protected void generateYamlFile(Long datasourceId, Long domainId) throws Exception {
|
||||
String datasourceBizName = datasourceService.getSourceBizNameById(datasourceId);
|
||||
List<Dimension> dimensionList = getDimensionList(datasourceId);
|
||||
String fullPath = domainService.getDomainFullPath(domainId);
|
||||
dimensionYamlManager.generateYamlFile(dimensionList, fullPath, datasourceBizName);
|
||||
}
|
||||
|
||||
|
||||
private void checkExist(List<DimensionReq> dimensionReqs) {
|
||||
Long domainId = dimensionReqs.get(0).getDomainId();
|
||||
List<DimensionResp> dimensionDescs = getDimensions(domainId);
|
||||
for (DimensionReq dimensionReq : dimensionReqs) {
|
||||
for (DimensionResp dimensionDesc : dimensionDescs) {
|
||||
if (dimensionDesc.getName().equalsIgnoreCase(dimensionReq.getBizName())) {
|
||||
throw new RuntimeException(String.format("exist same dimension name:%s", dimensionReq.getName()));
|
||||
}
|
||||
if (dimensionDesc.getBizName().equalsIgnoreCase(dimensionReq.getBizName())) {
|
||||
throw new RuntimeException(
|
||||
String.format("exist same dimension bizName:%s", dimensionReq.getBizName()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
private void saveDimensionAndGenerateYaml(Dimension dimension, User user) throws Exception {
|
||||
dimension.createdBy(user.getName());
|
||||
saveDimension(dimension);
|
||||
generateYamlFile(dimension.getDatasourceId(), dimension.getDomainId());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,306 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainSchemaFilterReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainUpdateReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimSchemaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainSchemaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricSchemaResp;
|
||||
import com.tencent.supersonic.common.util.mapper.BeanMapper;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.DomainDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.DomainRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.DomainConvert;
|
||||
import com.tencent.supersonic.semantic.core.domain.DimensionService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DomainService;
|
||||
import com.tencent.supersonic.semantic.core.domain.MetricService;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.Domain;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class DomainServiceImpl implements DomainService {
|
||||
|
||||
private final DomainRepository domainRepository;
|
||||
private final MetricService metricService;
|
||||
private final DimensionService dimensionService;
|
||||
|
||||
|
||||
public DomainServiceImpl(DomainRepository domainRepository,
|
||||
@Lazy MetricService metricService,
|
||||
@Lazy DimensionService dimensionService) {
|
||||
this.domainRepository = domainRepository;
|
||||
this.metricService = metricService;
|
||||
this.dimensionService = dimensionService;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void createDomain(DomainReq domainReq, User user) {
|
||||
log.info("[create domain] cmd : {}", JSONObject.toJSONString(domainReq));
|
||||
Domain domain = DomainConvert.convert(domainReq);
|
||||
log.info("[create domain] object:{}", JSONObject.toJSONString(domainReq));
|
||||
|
||||
saveDomain(domain, user);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateDomain(DomainUpdateReq domainUpdateReq, User user) {
|
||||
DomainDO domainDO = getDomainDO(domainUpdateReq.getId());
|
||||
domainDO.setUpdatedAt(new Date());
|
||||
domainDO.setUpdatedBy(user.getName());
|
||||
BeanMapper.mapper(domainUpdateReq, domainDO);
|
||||
domainDO.setAdmin(String.join(",", domainUpdateReq.getAdmins()));
|
||||
domainDO.setAdminOrg(String.join(",", domainUpdateReq.getAdminOrgs()));
|
||||
domainDO.setViewer(String.join(",", domainUpdateReq.getViewers()));
|
||||
domainDO.setViewOrg(String.join(",", domainUpdateReq.getViewOrgs()));
|
||||
domainRepository.updateDomain(domainDO);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
|
||||
public void deleteDomain(Long id) {
|
||||
domainRepository.deleteDomain(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDomainBizName(Long id) {
|
||||
if (id == null) {
|
||||
return "";
|
||||
}
|
||||
DomainDO domainDO = getDomainDO(id);
|
||||
if (domainDO == null) {
|
||||
String message = String.format("domain with id:%s not exist", id);
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
return domainDO.getBizName();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DomainResp> getDomainList() {
|
||||
return convertList(domainRepository.getDomainList());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<DomainResp> getDomainList(List<Long> domainIds) {
|
||||
return getDomainList().stream()
|
||||
.filter(domainDO -> domainIds.contains(domainDO.getId()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainResp> getDomainListForAdmin(String userName) {
|
||||
List<DomainDO> domainDOS = domainRepository.getDomainList();
|
||||
List<String> orgIds = Lists.newArrayList();
|
||||
log.info("orgIds:{},userName:{}", orgIds, userName);
|
||||
return convertList(domainDOS).stream()
|
||||
.filter(domainDesc -> checkAdminPermission(orgIds, userName, domainDesc))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DomainResp> getDomainListForViewer(String userName) {
|
||||
List<DomainDO> domainDOS = domainRepository.getDomainList();
|
||||
List<String> orgIds = Lists.newArrayList();
|
||||
log.info("orgIds:{},userName:{}", orgIds, userName);
|
||||
return convertList(domainDOS).stream()
|
||||
.filter(domainDesc -> checkViewerPermission(orgIds, userName, domainDesc))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public DomainResp getDomain(Long id) {
|
||||
Map<Long, String> fullDomainPathMap = getDomainFullPathMap();
|
||||
return DomainConvert.convert(getDomainDO(id), fullDomainPathMap);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getDomainFullPath(Long domainId) {
|
||||
if (domainId == null) {
|
||||
return "";
|
||||
}
|
||||
Map<Long, String> map = getDomainFullPathMap();
|
||||
return map.get(domainId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Long, String> getDomainFullPath() {
|
||||
return getDomainFullPathMap();
|
||||
}
|
||||
|
||||
//保存并获取自增ID
|
||||
private void saveDomain(Domain domain, User user) {
|
||||
DomainDO domainDO = DomainConvert.convert(domain, user);
|
||||
domainRepository.createDomain(domainDO);
|
||||
domain.setId(domainDO.getId());
|
||||
}
|
||||
|
||||
|
||||
private List<DomainResp> convertList(List<DomainDO> domainDOS) {
|
||||
List<DomainResp> domainDescs = Lists.newArrayList();
|
||||
if (CollectionUtils.isEmpty(domainDOS)) {
|
||||
return domainDescs;
|
||||
}
|
||||
Map<Long, String> fullDomainPathMap = getDomainFullPath();
|
||||
return domainDOS.stream()
|
||||
.map(domainDO -> DomainConvert.convert(domainDO, fullDomainPathMap))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Map<Long, DomainResp> getDomainMap() {
|
||||
|
||||
return getDomainList().stream().collect(Collectors.toMap(DomainResp::getId, a -> a, (k1, k2) -> k1));
|
||||
}
|
||||
|
||||
|
||||
public Map<Long, String> getDomainFullPathMap() {
|
||||
Map<Long, String> domainFullPathMap = new HashMap<>();
|
||||
List<DomainDO> domainDOList = domainRepository.getDomainList();
|
||||
Map<Long, DomainDO> domainDOMap = domainDOList.stream()
|
||||
.collect(Collectors.toMap(DomainDO::getId, a -> a, (k1, k2) -> k1));
|
||||
for (DomainDO domainDO : domainDOList) {
|
||||
final Long domainId = domainDO.getId();
|
||||
StringBuilder fullPath = new StringBuilder(domainDO.getBizName() + "/");
|
||||
Long parentId = domainDO.getParentId();
|
||||
while (parentId != null && parentId > 0) {
|
||||
domainDO = domainDOMap.get(parentId);
|
||||
if (domainDO == null) {
|
||||
String message = String.format("get domain : %s failed", parentId);
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
fullPath.insert(0, domainDO.getBizName() + "/");
|
||||
parentId = domainDO.getParentId();
|
||||
}
|
||||
domainFullPathMap.put(domainId, fullPath.toString());
|
||||
}
|
||||
return domainFullPathMap;
|
||||
}
|
||||
|
||||
public List<DomainSchemaResp> fetchDomainSchema(DomainSchemaFilterReq filter, User user) {
|
||||
List<DomainSchemaResp> domainSchemaDescList = new ArrayList<>();
|
||||
List<Long> domainIdsReq = generateDomainIdsReq(filter);
|
||||
List<DomainResp> getDomainListByIds = getDomainList(domainIdsReq);
|
||||
getDomainListByIds.stream().forEach(domainDesc -> {
|
||||
domainSchemaDescList.add(fetchSingleDomainSchema(domainDesc));
|
||||
});
|
||||
return domainSchemaDescList;
|
||||
}
|
||||
|
||||
|
||||
protected DomainDO getDomainDO(Long id) {
|
||||
return domainRepository.getDomainById(id);
|
||||
}
|
||||
|
||||
|
||||
private DomainSchemaResp fetchSingleDomainSchema(DomainResp domainDesc) {
|
||||
Long domainId = domainDesc.getId();
|
||||
DomainSchemaResp domainSchemaDesc = new DomainSchemaResp();
|
||||
BeanUtils.copyProperties(domainDesc, domainSchemaDesc);
|
||||
|
||||
domainSchemaDesc.setDimensions(generateDimSchema(domainId));
|
||||
domainSchemaDesc.setMetrics(generateMetricSchema(domainId));
|
||||
return domainSchemaDesc;
|
||||
}
|
||||
|
||||
private List<MetricSchemaResp> generateMetricSchema(Long domainId) {
|
||||
List<MetricSchemaResp> metricSchemaDescList = new ArrayList<>();
|
||||
List<MetricResp> metricDescList = metricService.getMetrics(domainId);
|
||||
metricDescList.stream().forEach(metricDesc -> {
|
||||
MetricSchemaResp metricSchemaDesc = new MetricSchemaResp();
|
||||
BeanUtils.copyProperties(metricDesc, metricSchemaDesc);
|
||||
metricSchemaDesc.setUseCnt(0L);
|
||||
metricSchemaDescList.add(metricSchemaDesc);
|
||||
}
|
||||
);
|
||||
return metricSchemaDescList;
|
||||
|
||||
}
|
||||
|
||||
private List<DimSchemaResp> generateDimSchema(Long domainId) {
|
||||
List<DimSchemaResp> dimSchemaDescList = new ArrayList<>();
|
||||
List<DimensionResp> dimDescList = dimensionService.getDimensions(domainId);
|
||||
dimDescList.stream().forEach(dimDesc -> {
|
||||
DimSchemaResp dimSchemaDesc = new DimSchemaResp();
|
||||
BeanUtils.copyProperties(dimDesc, dimSchemaDesc);
|
||||
dimSchemaDesc.setUseCnt(0L);
|
||||
dimSchemaDescList.add(dimSchemaDesc);
|
||||
}
|
||||
);
|
||||
return dimSchemaDescList;
|
||||
}
|
||||
|
||||
private List<Long> generateDomainIdsReq(DomainSchemaFilterReq filter) {
|
||||
if (Objects.nonNull(filter) && !CollectionUtils.isEmpty(filter.getDomainIds())) {
|
||||
return filter.getDomainIds();
|
||||
}
|
||||
return new ArrayList<>(getDomainMap().keySet());
|
||||
}
|
||||
|
||||
|
||||
private boolean checkAdminPermission(List<String> orgIds, String userName, DomainResp domainDesc) {
|
||||
|
||||
List<String> admins = domainDesc.getAdmins();
|
||||
List<String> adminOrgs = domainDesc.getAdminOrgs();
|
||||
if (admins.contains(userName) || domainDesc.getCreatedBy().equals(userName)) {
|
||||
return true;
|
||||
}
|
||||
for (String orgId : orgIds) {
|
||||
if (adminOrgs.contains(orgId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean checkViewerPermission(List<String> orgIds, String userName, DomainResp domainDesc) {
|
||||
if (domainDesc.getIsOpen() == 1) {
|
||||
return true;
|
||||
}
|
||||
List<String> admins = domainDesc.getAdmins();
|
||||
List<String> viewers = domainDesc.getViewers();
|
||||
List<String> adminOrgs = domainDesc.getAdminOrgs();
|
||||
List<String> viewOrgs = domainDesc.getViewOrgs();
|
||||
if (admins.contains(userName) || viewers.contains(userName) || domainDesc.getCreatedBy().equals(userName)) {
|
||||
return true;
|
||||
}
|
||||
for (String orgId : orgIds) {
|
||||
if (adminOrgs.contains(orgId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (String orgId : orgIds) {
|
||||
if (viewOrgs.contains(orgId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,282 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.MetricTypeParams;
|
||||
import com.tencent.supersonic.semantic.api.core.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.PageMetricReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricResp;
|
||||
import com.tencent.supersonic.common.enums.SensitiveLevelEnum;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.MetricDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.manager.MetricYamlManager;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.MetricFilter;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.MetricRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.utils.MetricConverter;
|
||||
import com.tencent.supersonic.semantic.core.domain.DomainService;
|
||||
import com.tencent.supersonic.semantic.core.domain.MetricService;
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.Metric;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Service
|
||||
@Slf4j
|
||||
public class MetricServiceImpl implements MetricService {
|
||||
|
||||
|
||||
private MetricRepository metricRepository;
|
||||
|
||||
private MetricYamlManager metricYamlManager;
|
||||
|
||||
private DomainService domainService;
|
||||
|
||||
|
||||
public MetricServiceImpl(MetricRepository metricRepository,
|
||||
MetricYamlManager metricYamlManager,
|
||||
DomainService domainService) {
|
||||
this.domainService = domainService;
|
||||
this.metricRepository = metricRepository;
|
||||
this.metricYamlManager = metricYamlManager;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void creatExprMetric(MetricReq metricReq, User user) throws Exception {
|
||||
checkExist(Lists.newArrayList(metricReq));
|
||||
Metric metric = MetricConverter.convert(metricReq);
|
||||
metric.createdBy(user.getName());
|
||||
log.info("[create metric] object:{}", JSONObject.toJSONString(metric));
|
||||
saveMetricAndGenerateYaml(metric);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMetricBatch(List<MetricReq> metricReqs, User user) throws Exception {
|
||||
if (CollectionUtils.isEmpty(metricReqs)) {
|
||||
return;
|
||||
}
|
||||
List<Metric> metrics = metricReqs.stream().map(MetricConverter::convert).collect(Collectors.toList());
|
||||
Long domainId = metricReqs.get(0).getDomainId();
|
||||
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
|
||||
Map<String, MetricResp> metricDescMap = metricDescs.stream()
|
||||
.collect(Collectors.toMap(MetricResp::getBizName, a -> a, (k1, k2) -> k1));
|
||||
List<Metric> metricToInsert = metrics.stream()
|
||||
.filter(metric -> !metricDescMap.containsKey(metric.getBizName())).collect(Collectors.toList());
|
||||
log.info("[insert metric] object:{}", JSONObject.toJSONString(metricToInsert));
|
||||
saveMetricBatch(metricToInsert, user);
|
||||
|
||||
generateYamlFile(metrics.get(0).getDomainId());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MetricResp> getMetrics(Long domainId) {
|
||||
return convertList(metricRepository.getMetricList(domainId));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetricResp> getMetrics(Long domainId, Long datasourceId) {
|
||||
List<MetricResp> metricResps = convertList(metricRepository.getMetricList(domainId));
|
||||
return metricResps.stream().filter(metricResp -> {
|
||||
Set<Long> datasourceIdSet = metricResp.getTypeParams().getMeasures().stream()
|
||||
.map(Measure::getDatasourceId)
|
||||
.filter(Objects::nonNull).collect(Collectors.toSet());
|
||||
return !CollectionUtils.isEmpty(datasourceIdSet) && datasourceIdSet.contains(datasourceId);
|
||||
}).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public List<MetricResp> getMetrics(List<Long> ids) {
|
||||
return convertList(metricRepository.getMetricListByIds(ids));
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageInfo<MetricResp> queryMetric(PageMetricReq pageMetrricReq) {
|
||||
if (pageMetrricReq.getDomainId() == null) {
|
||||
return PageInfo.of(Lists.newArrayList());
|
||||
}
|
||||
MetricFilter metricFilter = new MetricFilter();
|
||||
BeanUtils.copyProperties(pageMetrricReq, metricFilter);
|
||||
PageInfo<MetricDO> metricDOPageInfo = PageHelper.startPage(pageMetrricReq.getCurrent(),
|
||||
pageMetrricReq.getPageSize())
|
||||
.doSelectPageInfo(() -> queryMetric(metricFilter));
|
||||
PageInfo<MetricResp> pageInfo = new PageInfo<>();
|
||||
BeanUtils.copyProperties(metricDOPageInfo, pageInfo);
|
||||
pageInfo.setList(convertList(metricDOPageInfo.getList()));
|
||||
return pageInfo;
|
||||
}
|
||||
|
||||
private List<MetricDO> queryMetric(MetricFilter metricFilter) {
|
||||
return metricRepository.getMetric(metricFilter);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public MetricResp getMetric(Long domainId, String bizName) {
|
||||
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
|
||||
MetricResp metricDesc = null;
|
||||
if (CollectionUtils.isEmpty(metricDescs)) {
|
||||
return metricDesc;
|
||||
}
|
||||
for (MetricResp metric : metricDescs) {
|
||||
if (metric.getBizName().equalsIgnoreCase(bizName)) {
|
||||
metricDesc = metric;
|
||||
}
|
||||
}
|
||||
return metricDesc;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExprMetric(MetricReq metricReq, User user) throws Exception {
|
||||
preCheckMetric(metricReq);
|
||||
Metric metric = MetricConverter.convert(metricReq);
|
||||
metric.updatedBy(user.getName());
|
||||
log.info("[update metric] object:{}", JSONObject.toJSONString(metric));
|
||||
updateMetric(metric);
|
||||
generateYamlFile(metric.getDomainId());
|
||||
}
|
||||
|
||||
|
||||
public List<Metric> getMetricList(Long domainId) {
|
||||
List<Metric> metrics = Lists.newArrayList();
|
||||
List<MetricDO> metricDOS = metricRepository.getMetricList(domainId);
|
||||
if (!CollectionUtils.isEmpty(metricDOS)) {
|
||||
metrics = metricDOS.stream().map(MetricConverter::convert2Metric).collect(Collectors.toList());
|
||||
}
|
||||
return metrics;
|
||||
}
|
||||
|
||||
|
||||
//保存并获取自增ID
|
||||
public void saveMetric(Metric metric) {
|
||||
MetricDO metricDO = MetricConverter.convert2MetricDO(metric);
|
||||
log.info("[save metric] metricDO:{}", JSONObject.toJSONString(metricDO));
|
||||
metricRepository.createMetric(metricDO);
|
||||
metric.setId(metricDO.getId());
|
||||
}
|
||||
|
||||
protected void updateMetric(Metric metric) {
|
||||
MetricDO metricDO = metricRepository.getMetricById(metric.getId());
|
||||
metricRepository.updateMetric(MetricConverter.convert(metricDO, metric));
|
||||
}
|
||||
|
||||
|
||||
public List<MetricResp> getMetricByDomainId(Long domainId) {
|
||||
return convertList(getMetricDOByDomainId(domainId));
|
||||
}
|
||||
|
||||
protected List<MetricDO> getMetricDOByDomainId(Long domainId) {
|
||||
List<MetricDO> metricDOS = metricRepository.getAllMetricList();
|
||||
return metricDOS.stream().filter(metricDO -> Objects.equals(metricDO.getDomainId(), domainId))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<MetricResp> getHighSensitiveMetric(Long domainId) {
|
||||
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
|
||||
if (CollectionUtils.isEmpty(metricDescs)) {
|
||||
return metricDescs;
|
||||
}
|
||||
return metricDescs.stream()
|
||||
.filter(metricDesc -> SensitiveLevelEnum.HIGH.getCode().equals(metricDesc.getSensitiveLevel()))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MetricResp> getAllHighSensitiveMetric() {
|
||||
List<MetricResp> metricDescs = Lists.newArrayList();
|
||||
List<MetricDO> metricDOS = metricRepository.getAllMetricList();
|
||||
if (CollectionUtils.isEmpty(metricDOS)) {
|
||||
return metricDescs;
|
||||
}
|
||||
return convertList(metricDOS.stream()
|
||||
.filter(metricDesc -> SensitiveLevelEnum.HIGH.getCode().equals(metricDesc.getSensitiveLevel()))
|
||||
.collect(Collectors.toList()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteMetric(Long id) throws Exception {
|
||||
MetricDO metricDO = metricRepository.getMetricById(id);
|
||||
if (metricDO == null) {
|
||||
throw new RuntimeException(String.format("the metric %s not exist", id));
|
||||
}
|
||||
metricRepository.deleteMetric(id);
|
||||
generateYamlFile(metricDO.getDomainId());
|
||||
}
|
||||
|
||||
protected void generateYamlFile(Long domainId) throws Exception {
|
||||
List<Metric> metrics = getMetricList(domainId);
|
||||
String fullPath = domainService.getDomainFullPath(domainId);
|
||||
String domainBizName = domainService.getDomainBizName(domainId);
|
||||
metricYamlManager.generateYamlFile(metrics, fullPath, domainBizName);
|
||||
}
|
||||
|
||||
|
||||
private void saveMetricBatch(List<Metric> metrics, User user) {
|
||||
if (CollectionUtils.isEmpty(metrics)) {
|
||||
return;
|
||||
}
|
||||
List<MetricDO> metricDOS = metrics.stream().peek(metric -> metric.createdBy(user.getName()))
|
||||
.map(MetricConverter::convert2MetricDO).collect(Collectors.toList());
|
||||
log.info("[save metric] metrics:{}", JSONObject.toJSONString(metricDOS));
|
||||
metricRepository.createMetricBatch(metricDOS);
|
||||
}
|
||||
|
||||
private void saveMetricAndGenerateYaml(Metric metric) throws Exception {
|
||||
saveMetric(metric);
|
||||
generateYamlFile(metric.getDomainId());
|
||||
}
|
||||
|
||||
|
||||
private void preCheckMetric(MetricReq exprMetricReq) {
|
||||
|
||||
MetricTypeParams typeParams = exprMetricReq.getTypeParams();
|
||||
List<Measure> measures = typeParams.getMeasures();
|
||||
if (CollectionUtils.isEmpty(measures)) {
|
||||
throw new RuntimeException("measure can not be none");
|
||||
}
|
||||
for (Measure measure : measures) {
|
||||
measure.setExpr(null);
|
||||
}
|
||||
}
|
||||
|
||||
private void checkExist(List<MetricReq> exprMetricReqList) {
|
||||
Long domainId = exprMetricReqList.get(0).getDomainId();
|
||||
List<MetricResp> metricDescs = getMetrics(domainId);
|
||||
for (MetricReq exprMetricReq : exprMetricReqList) {
|
||||
for (MetricResp metricDesc : metricDescs) {
|
||||
if (metricDesc.getName().equalsIgnoreCase(exprMetricReq.getName())) {
|
||||
throw new RuntimeException(String.format("exist same metric name:%s", metricDesc.getName()));
|
||||
}
|
||||
if (metricDesc.getBizName().equalsIgnoreCase(exprMetricReq.getBizName())) {
|
||||
throw new RuntimeException(String.format("exist same metric en name:%s", metricDesc.getName()));
|
||||
}
|
||||
preCheckMetric(exprMetricReq);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private List<MetricResp> convertList(List<MetricDO> metricDOS) {
|
||||
List<MetricResp> metricDescs = Lists.newArrayList();
|
||||
Map<Long, DomainResp> domainMap = domainService.getDomainMap();
|
||||
if (!CollectionUtils.isEmpty(metricDOS)) {
|
||||
metricDescs = metricDOS.stream()
|
||||
.map(metricDO -> MetricConverter.convert2MetricDesc(metricDO, domainMap))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
return metricDescs;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
package com.tencent.supersonic.semantic.core.application;
|
||||
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.ViewInfoReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainSchemaRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.core.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.core.domain.repository.ViewInfoRepository;
|
||||
import com.tencent.supersonic.semantic.core.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.core.domain.DimensionService;
|
||||
import com.tencent.supersonic.semantic.core.domain.MetricService;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.assertj.core.util.Lists;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@Service
|
||||
public class ViewInfoServiceImpl {
|
||||
|
||||
private ViewInfoRepository viewInfoRepository;
|
||||
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
private DimensionService dimensionService;
|
||||
|
||||
private MetricService metricService;
|
||||
|
||||
public ViewInfoServiceImpl(ViewInfoRepository viewInfoRepository, DatasourceService datasourceService,
|
||||
MetricService metricService, DimensionService dimensionService) {
|
||||
this.viewInfoRepository = viewInfoRepository;
|
||||
this.dimensionService = dimensionService;
|
||||
this.metricService = metricService;
|
||||
this.datasourceService = datasourceService;
|
||||
}
|
||||
|
||||
public List<ViewInfoDO> getViewInfoList(Long domainId) {
|
||||
return viewInfoRepository.getViewInfoList(domainId);
|
||||
}
|
||||
|
||||
public List<DomainSchemaRelaResp> getDomainSchema(Long domainId) {
|
||||
List<DomainSchemaRelaResp> domainSchemaRelaResps = Lists.newArrayList();
|
||||
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(domainId);
|
||||
for (DatasourceResp datasourceResp : datasourceResps) {
|
||||
DomainSchemaRelaResp domainSchemaRelaResp = new DomainSchemaRelaResp();
|
||||
Long datasourceId = datasourceResp.getId();
|
||||
List<MetricResp> metricResps = metricService.getMetrics(domainId, datasourceId);
|
||||
List<DimensionResp> dimensionResps = dimensionService.getDimensionsByDatasource(datasourceId);
|
||||
domainSchemaRelaResp.setDatasource(datasourceResp);
|
||||
domainSchemaRelaResp.setDimensions(dimensionResps);
|
||||
domainSchemaRelaResp.setMetrics(metricResps);
|
||||
domainSchemaRelaResp.setDomainId(domainId);
|
||||
domainSchemaRelaResps.add(domainSchemaRelaResp);
|
||||
}
|
||||
return domainSchemaRelaResps;
|
||||
}
|
||||
|
||||
|
||||
public ViewInfoDO createOrUpdateViewInfo(ViewInfoReq viewInfoReq, User user) {
|
||||
if (viewInfoReq.getId() == null) {
|
||||
ViewInfoDO viewInfoDO = new ViewInfoDO();
|
||||
BeanUtils.copyProperties(viewInfoReq, viewInfoDO);
|
||||
viewInfoDO.setCreatedAt(new Date());
|
||||
viewInfoDO.setCreatedBy(user.getName());
|
||||
viewInfoDO.setUpdatedAt(new Date());
|
||||
viewInfoDO.setUpdatedBy(user.getName());
|
||||
viewInfoRepository.createViewInfo(viewInfoDO);
|
||||
return viewInfoDO;
|
||||
}
|
||||
Long id = viewInfoReq.getId();
|
||||
ViewInfoDO viewInfoDO = viewInfoRepository.getViewInfoById(id);
|
||||
BeanUtils.copyProperties(viewInfoReq, viewInfoDO);
|
||||
viewInfoDO.setUpdatedAt(new Date());
|
||||
viewInfoDO.setUpdatedBy(user.getName());
|
||||
viewInfoRepository.updateViewInfo(viewInfoDO);
|
||||
return viewInfoDO;
|
||||
}
|
||||
|
||||
|
||||
public void deleteViewInfo(Long id) {
|
||||
viewInfoRepository.deleteViewInfo(id);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
package com.tencent.supersonic.semantic.core.domain;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatabaseReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.SqlParserResp;
|
||||
|
||||
|
||||
public interface DatabaseService {
|
||||
|
||||
QueryResultWithSchemaResp executeSql(String sql, DatabaseResp databaseResp);
|
||||
|
||||
QueryResultWithSchemaResp executeSql(String sql, Long domainId);
|
||||
|
||||
boolean testConnect(DatabaseReq databaseReq, User user);
|
||||
|
||||
DatabaseResp createOrUpdateDatabase(DatabaseReq databaseReq, User user);
|
||||
|
||||
DatabaseResp getDatabase(Long id);
|
||||
|
||||
// one domain only has one database
|
||||
DatabaseResp getDatabaseByDomainId(Long domainId);
|
||||
|
||||
QueryResultWithSchemaResp queryWithColumns(SqlParserResp sqlParser);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.tencent.supersonic.semantic.core.domain;
|
||||
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.pojo.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatasourceRelaReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DatasourceReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.ItemDateResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MeasureResp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public interface DatasourceService {
|
||||
|
||||
DatasourceResp createDatasource(DatasourceReq datasourceReq, User user) throws Exception;
|
||||
|
||||
DatasourceResp updateDatasource(DatasourceReq datasourceReq, User user) throws Exception;
|
||||
|
||||
String getSourceBizNameById(Long id);
|
||||
|
||||
List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long domainId);
|
||||
|
||||
List<DatasourceResp> getDatasourceList();
|
||||
|
||||
List<DatasourceResp> getDatasourceList(Long domainId);
|
||||
|
||||
Map<Long, DatasourceResp> getDatasourceMap();
|
||||
|
||||
void deleteDatasource(Long id) throws Exception;
|
||||
|
||||
DatasourceRelaResp createOrUpdateDatasourceRela(DatasourceRelaReq datasourceRelaReq, User user);
|
||||
|
||||
List<DatasourceRelaResp> getDatasourceRelaList(Long domainId);
|
||||
|
||||
void deleteDatasourceRela(Long id);
|
||||
|
||||
ItemDateResp getDateDate(ItemDateFilter dimension, ItemDateFilter metric);
|
||||
|
||||
List<MeasureResp> getMeasureListOfDomain(Long domainId);
|
||||
|
||||
|
||||
void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
|
||||
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tencent.supersonic.semantic.core.domain;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.PageDimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DimensionResp;
|
||||
import java.util.List;
|
||||
|
||||
public interface DimensionService {
|
||||
|
||||
List<DimensionResp> getDimensions(List<Long> ids);
|
||||
|
||||
List<DimensionResp> getDimensions(Long domainId);
|
||||
|
||||
DimensionResp getDimension(String bizName, Long domainId);
|
||||
|
||||
void createDimension(DimensionReq dimensionReq, User user) throws Exception;
|
||||
|
||||
void createDimensionBatch(List<DimensionReq> dimensionReqs, User user) throws Exception;
|
||||
|
||||
List<DimensionResp> getDimensionsByDatasource(Long datasourceId);
|
||||
|
||||
void updateDimension(DimensionReq dimensionReq, User user) throws Exception;
|
||||
|
||||
PageInfo<DimensionResp> queryDimension(PageDimensionReq pageDimensionReq);
|
||||
|
||||
List<DimensionResp> getHighSensitiveDimension(Long domainId);
|
||||
|
||||
List<DimensionResp> getAllHighSensitiveDimension();
|
||||
|
||||
void deleteDimension(Long id) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.tencent.supersonic.semantic.core.domain;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainSchemaFilterReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.DomainUpdateReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.api.core.response.DomainSchemaResp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public interface DomainService {
|
||||
|
||||
|
||||
DomainResp getDomain(Long id);
|
||||
|
||||
String getDomainFullPath(Long domainId);
|
||||
|
||||
Map<Long, String> getDomainFullPath();
|
||||
|
||||
void createDomain(DomainReq domainReq, User user);
|
||||
|
||||
void updateDomain(DomainUpdateReq domainUpdateReq, User user);
|
||||
|
||||
void deleteDomain(Long id);
|
||||
|
||||
String getDomainBizName(Long domainId);
|
||||
|
||||
List<DomainResp> getDomainList();
|
||||
|
||||
List<DomainResp> getDomainList(List<Long> domainIds);
|
||||
|
||||
Map<Long, DomainResp> getDomainMap();
|
||||
|
||||
List<DomainResp> getDomainListForAdmin(String userName);
|
||||
|
||||
List<DomainResp> getDomainListForViewer(String userName);
|
||||
|
||||
List<DomainSchemaResp> fetchDomainSchema(DomainSchemaFilterReq filter, User user);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.tencent.supersonic.semantic.core.domain;
|
||||
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.core.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.core.request.PageMetricReq;
|
||||
import com.tencent.supersonic.semantic.api.core.response.MetricResp;
|
||||
import java.util.List;
|
||||
|
||||
public interface MetricService {
|
||||
|
||||
List<MetricResp> getMetrics(List<Long> ids);
|
||||
|
||||
List<MetricResp> getMetrics(Long domainId);
|
||||
|
||||
List<MetricResp> getMetrics(Long domainId, Long datasourceId);
|
||||
|
||||
void creatExprMetric(MetricReq metricReq, User user) throws Exception;
|
||||
|
||||
void createMetricBatch(List<MetricReq> metricReqs, User user) throws Exception;
|
||||
|
||||
PageInfo<MetricResp> queryMetric(PageMetricReq pageMetrricReq);
|
||||
|
||||
MetricResp getMetric(Long domainId, String bizName);
|
||||
|
||||
List<MetricResp> getHighSensitiveMetric(Long domainId);
|
||||
|
||||
void updateExprMetric(MetricReq metricReq, User user) throws Exception;
|
||||
|
||||
List<MetricResp> getAllHighSensitiveMetric();
|
||||
|
||||
void deleteMetric(Long id) throws Exception;
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.adaptor.engineadapter;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.common.constant.Constants;
|
||||
|
||||
public class ClickHouseAdaptor extends EngineAdaptor {
|
||||
|
||||
@Override
|
||||
public String getDateFormat(String dateType, String dateFormat, String column) {
|
||||
if (dateFormat.equalsIgnoreCase(Constants.DAY_FORMAT_INT)) {
|
||||
if (TimeDimensionEnum.MONTH.name().equalsIgnoreCase(dateType)) {
|
||||
return "formatDateTime(toDate(parseDateTimeBestEffort(toString(%s))),'%Y-%m')".replace("%s", column);
|
||||
} else if (TimeDimensionEnum.WEEK.name().equalsIgnoreCase(dateType)) {
|
||||
return "toMonday(toDate(parseDateTimeBestEffort(toString(%s))))".replace("%s", column);
|
||||
} else {
|
||||
return "toDate(parseDateTimeBestEffort(toString(%s)))".replace("%s", column);
|
||||
}
|
||||
} else if (dateFormat.equalsIgnoreCase(Constants.DAY_FORMAT)) {
|
||||
if (TimeDimensionEnum.MONTH.name().equalsIgnoreCase(dateType)) {
|
||||
return "formatDateTime(toDate(%s),'%Y-%m')".replace("%s", column);
|
||||
} else if (TimeDimensionEnum.WEEK.name().equalsIgnoreCase(dateType)) {
|
||||
return "toMonday(toDate(%s))".replace("%s", column);
|
||||
} else {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
return column;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.adaptor.engineadapter;
|
||||
|
||||
|
||||
public abstract class EngineAdaptor {
|
||||
|
||||
|
||||
public abstract String getDateFormat(String dateType, String dateFormat, String column);
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.adaptor.engineadapter;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.core.domain.pojo.EngineTypeEnum;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class EngineAdaptorFactory {
|
||||
|
||||
private static Map<String, EngineAdaptor> engineAdaptorMap;
|
||||
|
||||
static {
|
||||
engineAdaptorMap = new HashMap<>();
|
||||
engineAdaptorMap.put(EngineTypeEnum.CLICKHOUSE.getName(), new ClickHouseAdaptor());
|
||||
engineAdaptorMap.put(EngineTypeEnum.MYSQL.getName(), new MysqlAdaptor());
|
||||
engineAdaptorMap.put(EngineTypeEnum.H2.getName(), new MysqlAdaptor());
|
||||
}
|
||||
|
||||
|
||||
public static EngineAdaptor getEngineAdaptor(String engineType) {
|
||||
return engineAdaptorMap.get(engineType);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.adaptor.engineadapter;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.core.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.common.constant.Constants;
|
||||
|
||||
|
||||
public class MysqlAdaptor extends EngineAdaptor {
|
||||
|
||||
|
||||
/**
|
||||
* transform YYYYMMDD to YYYY-MM-DD YYYY-MM YYYY-MM-DD(MONDAY)
|
||||
*/
|
||||
@Override
|
||||
public String getDateFormat(String dateType, String dateFormat, String column) {
|
||||
if (dateFormat.equalsIgnoreCase(Constants.DAY_FORMAT_INT)) {
|
||||
if (TimeDimensionEnum.MONTH.name().equalsIgnoreCase(dateType)) {
|
||||
return "DATE_FORMAT(%s, '%Y-%m')".replace("%s", column);
|
||||
} else if (TimeDimensionEnum.WEEK.name().equalsIgnoreCase(dateType)) {
|
||||
return "to_monday(from_unixtime(unix_timestamp(%s), 'yyyy-MM-dd'))".replace("%s", column);
|
||||
} else {
|
||||
return "from_unixtime(unix_timestamp(%s), 'yyyy-MM-dd')".replace("%s", column);
|
||||
}
|
||||
} else if (dateFormat.equalsIgnoreCase(Constants.DAY_FORMAT)) {
|
||||
if (TimeDimensionEnum.MONTH.name().equalsIgnoreCase(dateType)) {
|
||||
return "DATE_FORMAT(%s, '%Y-%m') ".replace("%s", column);
|
||||
} else if (TimeDimensionEnum.WEEK.name().equalsIgnoreCase(dateType)) {
|
||||
return "to_monday(from_unixtime(unix_timestamp(%s), 'yyyy-MM-dd'))".replace("%s", column);
|
||||
} else {
|
||||
return column;
|
||||
}
|
||||
}
|
||||
return column;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.config;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
|
||||
@Configuration
|
||||
public class YamlConfig {
|
||||
|
||||
|
||||
@Value("${model.yaml.file.dir: conf/models/}")
|
||||
private String metaYamlFileDir;
|
||||
|
||||
public String getmetaYamlFileDir() {
|
||||
return metaYamlFileDir;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,232 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DatabaseDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*/
|
||||
private Long domainId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 类型 mysql,clickhouse,tdw
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*
|
||||
* @return domain_id 主题域ID
|
||||
*/
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*
|
||||
* @param domainId 主题域ID
|
||||
*/
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @return name 名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*
|
||||
* @return description 描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*
|
||||
* @param description 描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description == null ? null : description.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型 mysql,clickhouse,tdw
|
||||
*
|
||||
* @return type 类型 mysql,clickhouse,tdw
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 类型 mysql,clickhouse,tdw
|
||||
*
|
||||
* @param type 类型 mysql,clickhouse,tdw
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @return created_at 创建时间
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @return created_by 创建人
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @param createdBy 创建人
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy == null ? null : createdBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @return updated_at 更新时间
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @return updated_by 更新人
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @param updatedBy 更新人
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*
|
||||
* @return config 配置信息
|
||||
*/
|
||||
public String getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*
|
||||
* @param config 配置信息
|
||||
*/
|
||||
public void setConfig(String config) {
|
||||
this.config = config == null ? null : config.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,883 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatabaseDOExample {
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
protected Integer limitStart;
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DatabaseDOExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_database null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNull() {
|
||||
addCriterion("domain_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNotNull() {
|
||||
addCriterion("domain_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdEqualTo(Long value) {
|
||||
addCriterion("domain_id =", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotEqualTo(Long value) {
|
||||
addCriterion("domain_id <>", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThan(Long value) {
|
||||
addCriterion("domain_id >", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id >=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThan(Long value) {
|
||||
addCriterion("domain_id <", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id <=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIn(List<Long> values) {
|
||||
addCriterion("domain_id in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotIn(List<Long> values) {
|
||||
addCriterion("domain_id not in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id not between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("type =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("type <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("type >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("type >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("type <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("type <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("type like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("type not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("type in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("type not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("type between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("type not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNull() {
|
||||
addCriterion("created_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNotNull() {
|
||||
addCriterion("created_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtEqualTo(Date value) {
|
||||
addCriterion("created_at =", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotEqualTo(Date value) {
|
||||
addCriterion("created_at <>", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThan(Date value) {
|
||||
addCriterion("created_at >", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at >=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThan(Date value) {
|
||||
addCriterion("created_at <", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at <=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIn(List<Date> values) {
|
||||
addCriterion("created_at in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotIn(List<Date> values) {
|
||||
addCriterion("created_at not in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at not between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNull() {
|
||||
addCriterion("created_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNotNull() {
|
||||
addCriterion("created_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByEqualTo(String value) {
|
||||
addCriterion("created_by =", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotEqualTo(String value) {
|
||||
addCriterion("created_by <>", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThan(String value) {
|
||||
addCriterion("created_by >", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("created_by >=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThan(String value) {
|
||||
addCriterion("created_by <", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("created_by <=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLike(String value) {
|
||||
addCriterion("created_by like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotLike(String value) {
|
||||
addCriterion("created_by not like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIn(List<String> values) {
|
||||
addCriterion("created_by in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotIn(List<String> values) {
|
||||
addCriterion("created_by not in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByBetween(String value1, String value2) {
|
||||
addCriterion("created_by between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("created_by not between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNull() {
|
||||
addCriterion("updated_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNotNull() {
|
||||
addCriterion("updated_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtEqualTo(Date value) {
|
||||
addCriterion("updated_at =", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotEqualTo(Date value) {
|
||||
addCriterion("updated_at <>", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThan(Date value) {
|
||||
addCriterion("updated_at >", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at >=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThan(Date value) {
|
||||
addCriterion("updated_at <", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at <=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIn(List<Date> values) {
|
||||
addCriterion("updated_at in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotIn(List<Date> values) {
|
||||
addCriterion("updated_at not in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at not between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNull() {
|
||||
addCriterion("updated_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNotNull() {
|
||||
addCriterion("updated_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByEqualTo(String value) {
|
||||
addCriterion("updated_by =", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotEqualTo(String value) {
|
||||
addCriterion("updated_by <>", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThan(String value) {
|
||||
addCriterion("updated_by >", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by >=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThan(String value) {
|
||||
addCriterion("updated_by <", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by <=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLike(String value) {
|
||||
addCriterion("updated_by like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotLike(String value) {
|
||||
addCriterion("updated_by not like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIn(List<String> values) {
|
||||
addCriterion("updated_by in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotIn(List<String> values) {
|
||||
addCriterion("updated_by not in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByBetween(String value1, String value2) {
|
||||
addCriterion("updated_by between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("updated_by not between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_database null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,255 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DatasourceDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*/
|
||||
private Long domainId;
|
||||
|
||||
/**
|
||||
* 数据源名称
|
||||
*/
|
||||
private String name;
|
||||
|
||||
/**
|
||||
* 内部名称
|
||||
*/
|
||||
private String bizName;
|
||||
|
||||
/**
|
||||
* 数据源描述
|
||||
*/
|
||||
private String description;
|
||||
|
||||
/**
|
||||
* 数据库实例ID
|
||||
*/
|
||||
private Long databaseId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 数据源配置
|
||||
*/
|
||||
private String datasourceDetail;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*
|
||||
* @return domain_id 主题域ID
|
||||
*/
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*
|
||||
* @param domainId 主题域ID
|
||||
*/
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源名称
|
||||
*
|
||||
* @return name 数据源名称
|
||||
*/
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源名称
|
||||
*
|
||||
* @param name 数据源名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
this.name = name == null ? null : name.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部名称
|
||||
*
|
||||
* @return biz_name 内部名称
|
||||
*/
|
||||
public String getBizName() {
|
||||
return bizName;
|
||||
}
|
||||
|
||||
/**
|
||||
* 内部名称
|
||||
*
|
||||
* @param bizName 内部名称
|
||||
*/
|
||||
public void setBizName(String bizName) {
|
||||
this.bizName = bizName == null ? null : bizName.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源描述
|
||||
*
|
||||
* @return description 数据源描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源描述
|
||||
*
|
||||
* @param description 数据源描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description == null ? null : description.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库实例ID
|
||||
*
|
||||
* @return database_id 数据库实例ID
|
||||
*/
|
||||
public Long getDatabaseId() {
|
||||
return databaseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据库实例ID
|
||||
*
|
||||
* @param databaseId 数据库实例ID
|
||||
*/
|
||||
public void setDatabaseId(Long databaseId) {
|
||||
this.databaseId = databaseId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @return created_at 创建时间
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @return created_by 创建人
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @param createdBy 创建人
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy == null ? null : createdBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @return updated_at 更新时间
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @return updated_by 更新人
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @param updatedBy 更新人
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源配置
|
||||
*
|
||||
* @return datasource_detail 数据源配置
|
||||
*/
|
||||
public String getDatasourceDetail() {
|
||||
return datasourceDetail;
|
||||
}
|
||||
|
||||
/**
|
||||
* 数据源配置
|
||||
*
|
||||
* @param datasourceDetail 数据源配置
|
||||
*/
|
||||
public void setDatasourceDetail(String datasourceDetail) {
|
||||
this.datasourceDetail = datasourceDetail == null ? null : datasourceDetail.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,943 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatasourceDOExample {
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
protected Integer limitStart;
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DatasourceDOExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNull() {
|
||||
addCriterion("domain_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNotNull() {
|
||||
addCriterion("domain_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdEqualTo(Long value) {
|
||||
addCriterion("domain_id =", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotEqualTo(Long value) {
|
||||
addCriterion("domain_id <>", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThan(Long value) {
|
||||
addCriterion("domain_id >", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id >=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThan(Long value) {
|
||||
addCriterion("domain_id <", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id <=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIn(List<Long> values) {
|
||||
addCriterion("domain_id in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotIn(List<Long> values) {
|
||||
addCriterion("domain_id not in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id not between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNull() {
|
||||
addCriterion("name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIsNotNull() {
|
||||
addCriterion("name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameEqualTo(String value) {
|
||||
addCriterion("name =", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotEqualTo(String value) {
|
||||
addCriterion("name <>", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThan(String value) {
|
||||
addCriterion("name >", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("name >=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThan(String value) {
|
||||
addCriterion("name <", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("name <=", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameLike(String value) {
|
||||
addCriterion("name like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotLike(String value) {
|
||||
addCriterion("name not like", value, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameIn(List<String> values) {
|
||||
addCriterion("name in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotIn(List<String> values) {
|
||||
addCriterion("name not in", values, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameBetween(String value1, String value2) {
|
||||
addCriterion("name between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andNameNotBetween(String value1, String value2) {
|
||||
addCriterion("name not between", value1, value2, "name");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameIsNull() {
|
||||
addCriterion("biz_name is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameIsNotNull() {
|
||||
addCriterion("biz_name is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameEqualTo(String value) {
|
||||
addCriterion("biz_name =", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameNotEqualTo(String value) {
|
||||
addCriterion("biz_name <>", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameGreaterThan(String value) {
|
||||
addCriterion("biz_name >", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("biz_name >=", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameLessThan(String value) {
|
||||
addCriterion("biz_name <", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameLessThanOrEqualTo(String value) {
|
||||
addCriterion("biz_name <=", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameLike(String value) {
|
||||
addCriterion("biz_name like", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameNotLike(String value) {
|
||||
addCriterion("biz_name not like", value, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameIn(List<String> values) {
|
||||
addCriterion("biz_name in", values, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameNotIn(List<String> values) {
|
||||
addCriterion("biz_name not in", values, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameBetween(String value1, String value2) {
|
||||
addCriterion("biz_name between", value1, value2, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andBizNameNotBetween(String value1, String value2) {
|
||||
addCriterion("biz_name not between", value1, value2, "bizName");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNull() {
|
||||
addCriterion("description is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIsNotNull() {
|
||||
addCriterion("description is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionEqualTo(String value) {
|
||||
addCriterion("description =", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotEqualTo(String value) {
|
||||
addCriterion("description <>", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThan(String value) {
|
||||
addCriterion("description >", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("description >=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThan(String value) {
|
||||
addCriterion("description <", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLessThanOrEqualTo(String value) {
|
||||
addCriterion("description <=", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionLike(String value) {
|
||||
addCriterion("description like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotLike(String value) {
|
||||
addCriterion("description not like", value, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionIn(List<String> values) {
|
||||
addCriterion("description in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotIn(List<String> values) {
|
||||
addCriterion("description not in", values, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionBetween(String value1, String value2) {
|
||||
addCriterion("description between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDescriptionNotBetween(String value1, String value2) {
|
||||
addCriterion("description not between", value1, value2, "description");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdIsNull() {
|
||||
addCriterion("database_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdIsNotNull() {
|
||||
addCriterion("database_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdEqualTo(Long value) {
|
||||
addCriterion("database_id =", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdNotEqualTo(Long value) {
|
||||
addCriterion("database_id <>", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdGreaterThan(Long value) {
|
||||
addCriterion("database_id >", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("database_id >=", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdLessThan(Long value) {
|
||||
addCriterion("database_id <", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("database_id <=", value, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdIn(List<Long> values) {
|
||||
addCriterion("database_id in", values, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdNotIn(List<Long> values) {
|
||||
addCriterion("database_id not in", values, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdBetween(Long value1, Long value2) {
|
||||
addCriterion("database_id between", value1, value2, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatabaseIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("database_id not between", value1, value2, "databaseId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNull() {
|
||||
addCriterion("created_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNotNull() {
|
||||
addCriterion("created_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtEqualTo(Date value) {
|
||||
addCriterion("created_at =", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotEqualTo(Date value) {
|
||||
addCriterion("created_at <>", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThan(Date value) {
|
||||
addCriterion("created_at >", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at >=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThan(Date value) {
|
||||
addCriterion("created_at <", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at <=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIn(List<Date> values) {
|
||||
addCriterion("created_at in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotIn(List<Date> values) {
|
||||
addCriterion("created_at not in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at not between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNull() {
|
||||
addCriterion("created_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNotNull() {
|
||||
addCriterion("created_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByEqualTo(String value) {
|
||||
addCriterion("created_by =", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotEqualTo(String value) {
|
||||
addCriterion("created_by <>", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThan(String value) {
|
||||
addCriterion("created_by >", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("created_by >=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThan(String value) {
|
||||
addCriterion("created_by <", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("created_by <=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLike(String value) {
|
||||
addCriterion("created_by like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotLike(String value) {
|
||||
addCriterion("created_by not like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIn(List<String> values) {
|
||||
addCriterion("created_by in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotIn(List<String> values) {
|
||||
addCriterion("created_by not in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByBetween(String value1, String value2) {
|
||||
addCriterion("created_by between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("created_by not between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNull() {
|
||||
addCriterion("updated_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNotNull() {
|
||||
addCriterion("updated_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtEqualTo(Date value) {
|
||||
addCriterion("updated_at =", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotEqualTo(Date value) {
|
||||
addCriterion("updated_at <>", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThan(Date value) {
|
||||
addCriterion("updated_at >", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at >=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThan(Date value) {
|
||||
addCriterion("updated_at <", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at <=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIn(List<Date> values) {
|
||||
addCriterion("updated_at in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotIn(List<Date> values) {
|
||||
addCriterion("updated_at not in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at not between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNull() {
|
||||
addCriterion("updated_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNotNull() {
|
||||
addCriterion("updated_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByEqualTo(String value) {
|
||||
addCriterion("updated_by =", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotEqualTo(String value) {
|
||||
addCriterion("updated_by <>", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThan(String value) {
|
||||
addCriterion("updated_by >", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by >=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThan(String value) {
|
||||
addCriterion("updated_by <", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by <=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLike(String value) {
|
||||
addCriterion("updated_by like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotLike(String value) {
|
||||
addCriterion("updated_by not like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIn(List<String> values) {
|
||||
addCriterion("updated_by in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotIn(List<String> values) {
|
||||
addCriterion("updated_by not in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByBetween(String value1, String value2) {
|
||||
addCriterion("updated_by between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("updated_by not between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DatasourceRelaDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long domainId;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long datasourceFrom;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long datasourceTo;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String joinKey;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return domain_id
|
||||
*/
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param domainId
|
||||
*/
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return datasource_from
|
||||
*/
|
||||
public Long getDatasourceFrom() {
|
||||
return datasourceFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param datasourceFrom
|
||||
*/
|
||||
public void setDatasourceFrom(Long datasourceFrom) {
|
||||
this.datasourceFrom = datasourceFrom;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return datasource_to
|
||||
*/
|
||||
public Long getDatasourceTo() {
|
||||
return datasourceTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param datasourceTo
|
||||
*/
|
||||
public void setDatasourceTo(Long datasourceTo) {
|
||||
this.datasourceTo = datasourceTo;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return join_key
|
||||
*/
|
||||
public String getJoinKey() {
|
||||
return joinKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param joinKey
|
||||
*/
|
||||
public void setJoinKey(String joinKey) {
|
||||
this.joinKey = joinKey == null ? null : joinKey.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return created_at
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createdAt
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return created_by
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param createdBy
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy == null ? null : createdBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return updated_at
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updatedAt
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return updated_by
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param updatedBy
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,858 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatasourceRelaDOExample {
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
protected Integer limitStart;
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DatasourceRelaDOExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource_rela null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNull() {
|
||||
addCriterion("domain_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNotNull() {
|
||||
addCriterion("domain_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdEqualTo(Long value) {
|
||||
addCriterion("domain_id =", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotEqualTo(Long value) {
|
||||
addCriterion("domain_id <>", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThan(Long value) {
|
||||
addCriterion("domain_id >", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id >=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThan(Long value) {
|
||||
addCriterion("domain_id <", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id <=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIn(List<Long> values) {
|
||||
addCriterion("domain_id in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotIn(List<Long> values) {
|
||||
addCriterion("domain_id not in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id not between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromIsNull() {
|
||||
addCriterion("datasource_from is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromIsNotNull() {
|
||||
addCriterion("datasource_from is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromEqualTo(Long value) {
|
||||
addCriterion("datasource_from =", value, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromNotEqualTo(Long value) {
|
||||
addCriterion("datasource_from <>", value, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromGreaterThan(Long value) {
|
||||
addCriterion("datasource_from >", value, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromLessThan(Long value) {
|
||||
addCriterion("datasource_from <", value, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromLessThanOrEqualTo(Long value) {
|
||||
addCriterion("datasource_from <=", value, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromIn(List<Long> values) {
|
||||
addCriterion("datasource_from in", values, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromNotIn(List<Long> values) {
|
||||
addCriterion("datasource_from not in", values, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromBetween(Long value1, Long value2) {
|
||||
addCriterion("datasource_from between", value1, value2, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceFromNotBetween(Long value1, Long value2) {
|
||||
addCriterion("datasource_from not between", value1, value2, "datasourceFrom");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToIsNull() {
|
||||
addCriterion("datasource_to is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToIsNotNull() {
|
||||
addCriterion("datasource_to is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToEqualTo(Long value) {
|
||||
addCriterion("datasource_to =", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToNotEqualTo(Long value) {
|
||||
addCriterion("datasource_to <>", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToGreaterThan(Long value) {
|
||||
addCriterion("datasource_to >", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("datasource_to >=", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToLessThan(Long value) {
|
||||
addCriterion("datasource_to <", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToLessThanOrEqualTo(Long value) {
|
||||
addCriterion("datasource_to <=", value, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToIn(List<Long> values) {
|
||||
addCriterion("datasource_to in", values, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToNotIn(List<Long> values) {
|
||||
addCriterion("datasource_to not in", values, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToBetween(Long value1, Long value2) {
|
||||
addCriterion("datasource_to between", value1, value2, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDatasourceToNotBetween(Long value1, Long value2) {
|
||||
addCriterion("datasource_to not between", value1, value2, "datasourceTo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyIsNull() {
|
||||
addCriterion("join_key is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyIsNotNull() {
|
||||
addCriterion("join_key is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyEqualTo(String value) {
|
||||
addCriterion("join_key =", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyNotEqualTo(String value) {
|
||||
addCriterion("join_key <>", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyGreaterThan(String value) {
|
||||
addCriterion("join_key >", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("join_key >=", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyLessThan(String value) {
|
||||
addCriterion("join_key <", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyLessThanOrEqualTo(String value) {
|
||||
addCriterion("join_key <=", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyLike(String value) {
|
||||
addCriterion("join_key like", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyNotLike(String value) {
|
||||
addCriterion("join_key not like", value, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyIn(List<String> values) {
|
||||
addCriterion("join_key in", values, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyNotIn(List<String> values) {
|
||||
addCriterion("join_key not in", values, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyBetween(String value1, String value2) {
|
||||
addCriterion("join_key between", value1, value2, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andJoinKeyNotBetween(String value1, String value2) {
|
||||
addCriterion("join_key not between", value1, value2, "joinKey");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNull() {
|
||||
addCriterion("created_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNotNull() {
|
||||
addCriterion("created_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtEqualTo(Date value) {
|
||||
addCriterion("created_at =", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotEqualTo(Date value) {
|
||||
addCriterion("created_at <>", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThan(Date value) {
|
||||
addCriterion("created_at >", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at >=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThan(Date value) {
|
||||
addCriterion("created_at <", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at <=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIn(List<Date> values) {
|
||||
addCriterion("created_at in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotIn(List<Date> values) {
|
||||
addCriterion("created_at not in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at not between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNull() {
|
||||
addCriterion("created_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNotNull() {
|
||||
addCriterion("created_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByEqualTo(String value) {
|
||||
addCriterion("created_by =", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotEqualTo(String value) {
|
||||
addCriterion("created_by <>", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThan(String value) {
|
||||
addCriterion("created_by >", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("created_by >=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThan(String value) {
|
||||
addCriterion("created_by <", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("created_by <=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLike(String value) {
|
||||
addCriterion("created_by like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotLike(String value) {
|
||||
addCriterion("created_by not like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIn(List<String> values) {
|
||||
addCriterion("created_by in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotIn(List<String> values) {
|
||||
addCriterion("created_by not in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByBetween(String value1, String value2) {
|
||||
addCriterion("created_by between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("created_by not between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNull() {
|
||||
addCriterion("updated_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNotNull() {
|
||||
addCriterion("updated_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtEqualTo(Date value) {
|
||||
addCriterion("updated_at =", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotEqualTo(Date value) {
|
||||
addCriterion("updated_at <>", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThan(Date value) {
|
||||
addCriterion("updated_at >", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at >=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThan(Date value) {
|
||||
addCriterion("updated_at <", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at <=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIn(List<Date> values) {
|
||||
addCriterion("updated_at in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotIn(List<Date> values) {
|
||||
addCriterion("updated_at not in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at not between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNull() {
|
||||
addCriterion("updated_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNotNull() {
|
||||
addCriterion("updated_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByEqualTo(String value) {
|
||||
addCriterion("updated_by =", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotEqualTo(String value) {
|
||||
addCriterion("updated_by <>", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThan(String value) {
|
||||
addCriterion("updated_by >", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by >=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThan(String value) {
|
||||
addCriterion("updated_by <", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by <=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLike(String value) {
|
||||
addCriterion("updated_by like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotLike(String value) {
|
||||
addCriterion("updated_by not like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIn(List<String> values) {
|
||||
addCriterion("updated_by in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotIn(List<String> values) {
|
||||
addCriterion("updated_by not in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByBetween(String value1, String value2) {
|
||||
addCriterion("updated_by between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("updated_by not between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_datasource_rela null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class DateInfoDO {
|
||||
|
||||
private Long id;
|
||||
private String type;
|
||||
private Long itemId;
|
||||
private String dateFormat;
|
||||
private String startDate;
|
||||
private String endDate;
|
||||
private String unavailableDateList;
|
||||
private String createdBy;
|
||||
private String updatedBy;
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,278 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
public class DictionaryDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 对应维度id、指标id等
|
||||
*/
|
||||
private Long itemId;
|
||||
|
||||
/**
|
||||
* 对应维度、指标等
|
||||
*/
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 1-开启写入字典,0-不开启
|
||||
*/
|
||||
private Boolean isDictInfo;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
private Date createdAt;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
private Date updatedAt;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
private String createdBy;
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
* 1-删除,0-可用
|
||||
*/
|
||||
private Boolean isDeleted;
|
||||
|
||||
/**
|
||||
* 字典黑名单
|
||||
*/
|
||||
private String blackList;
|
||||
|
||||
/**
|
||||
* 字典白名单
|
||||
*/
|
||||
private String whiteList;
|
||||
|
||||
/**
|
||||
* 字典规则
|
||||
*/
|
||||
private String ruleList;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应维度id、指标id等
|
||||
*
|
||||
* @return item_id 对应维度id、指标id等
|
||||
*/
|
||||
public Long getItemId() {
|
||||
return itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应维度id、指标id等
|
||||
*
|
||||
* @param itemId 对应维度id、指标id等
|
||||
*/
|
||||
public void setItemId(Long itemId) {
|
||||
this.itemId = itemId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应维度、指标等
|
||||
*
|
||||
* @return type 对应维度、指标等
|
||||
*/
|
||||
public String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
* 对应维度、指标等
|
||||
*
|
||||
* @param type 对应维度、指标等
|
||||
*/
|
||||
public void setType(String type) {
|
||||
this.type = type == null ? null : type.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-开启写入字典,0-不开启
|
||||
*
|
||||
* @return is_dict_Info 1-开启写入字典,0-不开启
|
||||
*/
|
||||
public Boolean getIsDictInfo() {
|
||||
return isDictInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-开启写入字典,0-不开启
|
||||
*
|
||||
* @param isDictInfo 1-开启写入字典,0-不开启
|
||||
*/
|
||||
public void setIsDictInfo(Boolean isDictInfo) {
|
||||
this.isDictInfo = isDictInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @return created_at 创建时间
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @return updated_at 更新时间
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @return created_by 创建人
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
return createdBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @param createdBy 创建人
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
this.createdBy = createdBy == null ? null : createdBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @return updated_by 更新人
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
return updatedBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @param updatedBy 更新人
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-删除,0-可用
|
||||
*
|
||||
* @return is_deleted 1-删除,0-可用
|
||||
*/
|
||||
public Boolean getIsDeleted() {
|
||||
return isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1-删除,0-可用
|
||||
*
|
||||
* @param isDeleted 1-删除,0-可用
|
||||
*/
|
||||
public void setIsDeleted(Boolean isDeleted) {
|
||||
this.isDeleted = isDeleted;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典黑名单
|
||||
*
|
||||
* @return black_list 字典黑名单
|
||||
*/
|
||||
public String getBlackList() {
|
||||
return blackList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典黑名单
|
||||
*
|
||||
* @param blackList 字典黑名单
|
||||
*/
|
||||
public void setBlackList(String blackList) {
|
||||
this.blackList = blackList == null ? null : blackList.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典白名单
|
||||
*
|
||||
* @return white_list 字典白名单
|
||||
*/
|
||||
public String getWhiteList() {
|
||||
return whiteList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典白名单
|
||||
*
|
||||
* @param whiteList 字典白名单
|
||||
*/
|
||||
public void setWhiteList(String whiteList) {
|
||||
this.whiteList = whiteList == null ? null : whiteList.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典规则
|
||||
*
|
||||
* @return rule_list 字典规则
|
||||
*/
|
||||
public String getRuleList() {
|
||||
return ruleList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 字典规则
|
||||
*
|
||||
* @param ruleList 字典规则
|
||||
*/
|
||||
public void setRuleList(String ruleList) {
|
||||
this.ruleList = ruleList == null ? null : ruleList.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,863 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DictionaryDOExample {
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
protected Integer limitStart;
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DictionaryDOExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdIsNull() {
|
||||
addCriterion("item_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdIsNotNull() {
|
||||
addCriterion("item_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdEqualTo(Long value) {
|
||||
addCriterion("item_id =", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdNotEqualTo(Long value) {
|
||||
addCriterion("item_id <>", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdGreaterThan(Long value) {
|
||||
addCriterion("item_id >", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("item_id >=", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdLessThan(Long value) {
|
||||
addCriterion("item_id <", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("item_id <=", value, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdIn(List<Long> values) {
|
||||
addCriterion("item_id in", values, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdNotIn(List<Long> values) {
|
||||
addCriterion("item_id not in", values, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdBetween(Long value1, Long value2) {
|
||||
addCriterion("item_id between", value1, value2, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andItemIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("item_id not between", value1, value2, "itemId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNull() {
|
||||
addCriterion("type is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIsNotNull() {
|
||||
addCriterion("type is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeEqualTo(String value) {
|
||||
addCriterion("type =", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotEqualTo(String value) {
|
||||
addCriterion("type <>", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThan(String value) {
|
||||
addCriterion("type >", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("type >=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThan(String value) {
|
||||
addCriterion("type <", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLessThanOrEqualTo(String value) {
|
||||
addCriterion("type <=", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeLike(String value) {
|
||||
addCriterion("type like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotLike(String value) {
|
||||
addCriterion("type not like", value, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeIn(List<String> values) {
|
||||
addCriterion("type in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotIn(List<String> values) {
|
||||
addCriterion("type not in", values, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeBetween(String value1, String value2) {
|
||||
addCriterion("type between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andTypeNotBetween(String value1, String value2) {
|
||||
addCriterion("type not between", value1, value2, "type");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoIsNull() {
|
||||
addCriterion("is_dict_Info is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoIsNotNull() {
|
||||
addCriterion("is_dict_Info is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoEqualTo(Boolean value) {
|
||||
addCriterion("is_dict_Info =", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoNotEqualTo(Boolean value) {
|
||||
addCriterion("is_dict_Info <>", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoGreaterThan(Boolean value) {
|
||||
addCriterion("is_dict_Info >", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoGreaterThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_dict_Info >=", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoLessThan(Boolean value) {
|
||||
addCriterion("is_dict_Info <", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoLessThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_dict_Info <=", value, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoIn(List<Boolean> values) {
|
||||
addCriterion("is_dict_Info in", values, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoNotIn(List<Boolean> values) {
|
||||
addCriterion("is_dict_Info not in", values, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_dict_Info between", value1, value2, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDictInfoNotBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_dict_Info not between", value1, value2, "isDictInfo");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNull() {
|
||||
addCriterion("created_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIsNotNull() {
|
||||
addCriterion("created_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtEqualTo(Date value) {
|
||||
addCriterion("created_at =", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotEqualTo(Date value) {
|
||||
addCriterion("created_at <>", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThan(Date value) {
|
||||
addCriterion("created_at >", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at >=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThan(Date value) {
|
||||
addCriterion("created_at <", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("created_at <=", value, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtIn(List<Date> values) {
|
||||
addCriterion("created_at in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotIn(List<Date> values) {
|
||||
addCriterion("created_at not in", values, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("created_at not between", value1, value2, "createdAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNull() {
|
||||
addCriterion("updated_at is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIsNotNull() {
|
||||
addCriterion("updated_at is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtEqualTo(Date value) {
|
||||
addCriterion("updated_at =", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotEqualTo(Date value) {
|
||||
addCriterion("updated_at <>", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThan(Date value) {
|
||||
addCriterion("updated_at >", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at >=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThan(Date value) {
|
||||
addCriterion("updated_at <", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
|
||||
addCriterion("updated_at <=", value, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtIn(List<Date> values) {
|
||||
addCriterion("updated_at in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotIn(List<Date> values) {
|
||||
addCriterion("updated_at not in", values, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
|
||||
addCriterion("updated_at not between", value1, value2, "updatedAt");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNull() {
|
||||
addCriterion("created_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIsNotNull() {
|
||||
addCriterion("created_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByEqualTo(String value) {
|
||||
addCriterion("created_by =", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotEqualTo(String value) {
|
||||
addCriterion("created_by <>", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThan(String value) {
|
||||
addCriterion("created_by >", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("created_by >=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThan(String value) {
|
||||
addCriterion("created_by <", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("created_by <=", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByLike(String value) {
|
||||
addCriterion("created_by like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotLike(String value) {
|
||||
addCriterion("created_by not like", value, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByIn(List<String> values) {
|
||||
addCriterion("created_by in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotIn(List<String> values) {
|
||||
addCriterion("created_by not in", values, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByBetween(String value1, String value2) {
|
||||
addCriterion("created_by between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andCreatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("created_by not between", value1, value2, "createdBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNull() {
|
||||
addCriterion("updated_by is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIsNotNull() {
|
||||
addCriterion("updated_by is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByEqualTo(String value) {
|
||||
addCriterion("updated_by =", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotEqualTo(String value) {
|
||||
addCriterion("updated_by <>", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThan(String value) {
|
||||
addCriterion("updated_by >", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by >=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThan(String value) {
|
||||
addCriterion("updated_by <", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLessThanOrEqualTo(String value) {
|
||||
addCriterion("updated_by <=", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByLike(String value) {
|
||||
addCriterion("updated_by like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotLike(String value) {
|
||||
addCriterion("updated_by not like", value, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByIn(List<String> values) {
|
||||
addCriterion("updated_by in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotIn(List<String> values) {
|
||||
addCriterion("updated_by not in", values, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByBetween(String value1, String value2) {
|
||||
addCriterion("updated_by between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andUpdatedByNotBetween(String value1, String value2) {
|
||||
addCriterion("updated_by not between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedIsNull() {
|
||||
addCriterion("is_deleted is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedIsNotNull() {
|
||||
addCriterion("is_deleted is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedEqualTo(Boolean value) {
|
||||
addCriterion("is_deleted =", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedNotEqualTo(Boolean value) {
|
||||
addCriterion("is_deleted <>", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedGreaterThan(Boolean value) {
|
||||
addCriterion("is_deleted >", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_deleted >=", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedLessThan(Boolean value) {
|
||||
addCriterion("is_deleted <", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) {
|
||||
addCriterion("is_deleted <=", value, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedIn(List<Boolean> values) {
|
||||
addCriterion("is_deleted in", values, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedNotIn(List<Boolean> values) {
|
||||
addCriterion("is_deleted not in", values, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_deleted between", value1, value2, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) {
|
||||
addCriterion("is_deleted not between", value1, value2, "isDeleted");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
public class DictionaryTaskDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主体域ID
|
||||
*/
|
||||
private Long domainId;
|
||||
|
||||
/**
|
||||
* 任务最终运行状态
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 任务耗时
|
||||
*/
|
||||
private Long elapsedMs;
|
||||
|
||||
/**
|
||||
* 查询涉及的维度
|
||||
*/
|
||||
private String dimensions;
|
||||
|
||||
/**
|
||||
* 查询涉及的指标
|
||||
*/
|
||||
private String metrics;
|
||||
|
||||
/**
|
||||
* 查询的过滤信息
|
||||
*/
|
||||
private String filters;
|
||||
|
||||
/**
|
||||
* 查询的排序信息
|
||||
*/
|
||||
private String orderBy;
|
||||
|
||||
/**
|
||||
* 查询涉及的日期信息
|
||||
*/
|
||||
private String dateInfo;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param id
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主体域ID
|
||||
*
|
||||
* @return domain_id 主体域ID
|
||||
*/
|
||||
public Long getDomainId() {
|
||||
return domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 主体域ID
|
||||
*
|
||||
* @param domainId 主体域ID
|
||||
*/
|
||||
public void setDomainId(Long domainId) {
|
||||
this.domainId = domainId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务最终运行状态
|
||||
*
|
||||
* @return status 任务最终运行状态
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务最终运行状态
|
||||
*
|
||||
* @param status 任务最终运行状态
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务耗时
|
||||
*
|
||||
* @return elapsed_ms 任务耗时
|
||||
*/
|
||||
public Long getElapsedMs() {
|
||||
return elapsedMs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 任务耗时
|
||||
*
|
||||
* @param elapsedMs 任务耗时
|
||||
*/
|
||||
public void setElapsedMs(Long elapsedMs) {
|
||||
this.elapsedMs = elapsedMs;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的维度
|
||||
*
|
||||
* @return dimensions 查询涉及的维度
|
||||
*/
|
||||
public String getDimensions() {
|
||||
return dimensions;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的维度
|
||||
*
|
||||
* @param dimensions 查询涉及的维度
|
||||
*/
|
||||
public void setDimensions(String dimensions) {
|
||||
this.dimensions = dimensions == null ? null : dimensions.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的指标
|
||||
*
|
||||
* @return metrics 查询涉及的指标
|
||||
*/
|
||||
public String getMetrics() {
|
||||
return metrics;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的指标
|
||||
*
|
||||
* @param metrics 查询涉及的指标
|
||||
*/
|
||||
public void setMetrics(String metrics) {
|
||||
this.metrics = metrics == null ? null : metrics.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询的过滤信息
|
||||
*
|
||||
* @return filters 查询的过滤信息
|
||||
*/
|
||||
public String getFilters() {
|
||||
return filters;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询的过滤信息
|
||||
*
|
||||
* @param filters 查询的过滤信息
|
||||
*/
|
||||
public void setFilters(String filters) {
|
||||
this.filters = filters == null ? null : filters.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询的排序信息
|
||||
*
|
||||
* @return order_by 查询的排序信息
|
||||
*/
|
||||
public String getOrderBy() {
|
||||
return orderBy;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询的排序信息
|
||||
*
|
||||
* @param orderBy 查询的排序信息
|
||||
*/
|
||||
public void setOrderBy(String orderBy) {
|
||||
this.orderBy = orderBy == null ? null : orderBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的日期信息
|
||||
*
|
||||
* @return date_info 查询涉及的日期信息
|
||||
*/
|
||||
public String getDateInfo() {
|
||||
return dateInfo;
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询涉及的日期信息
|
||||
*
|
||||
* @param dateInfo 查询涉及的日期信息
|
||||
*/
|
||||
public void setDateInfo(String dateInfo) {
|
||||
this.dateInfo = dateInfo == null ? null : dateInfo.trim();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,532 @@
|
||||
package com.tencent.supersonic.semantic.core.domain.dataobject;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class DictionaryTaskDOExample {
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
protected String orderByClause;
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
protected boolean distinct;
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
protected List<Criteria> oredCriteria;
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
protected Integer limitStart;
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DictionaryTaskDOExample() {
|
||||
oredCriteria = new ArrayList<Criteria>();
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
this.orderByClause = orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
return orderByClause;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
this.distinct = distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
return distinct;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
return oredCriteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
oredCriteria.add(criteria);
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
Criteria criteria = createCriteriaInternal();
|
||||
if (oredCriteria.size() == 0) {
|
||||
oredCriteria.add(criteria);
|
||||
}
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
Criteria criteria = new Criteria();
|
||||
return criteria;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
oredCriteria.clear();
|
||||
orderByClause = null;
|
||||
distinct = false;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
return limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
return limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary_task null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
super();
|
||||
criteria = new ArrayList<Criterion>();
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return criteria.size() > 0;
|
||||
}
|
||||
|
||||
public List<Criterion> getAllCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
public List<Criterion> getCriteria() {
|
||||
return criteria;
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition) {
|
||||
if (condition == null) {
|
||||
throw new RuntimeException("Value for condition cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value, String property) {
|
||||
if (value == null) {
|
||||
throw new RuntimeException("Value for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value));
|
||||
}
|
||||
|
||||
protected void addCriterion(String condition, Object value1, Object value2, String property) {
|
||||
if (value1 == null || value2 == null) {
|
||||
throw new RuntimeException("Between values for " + property + " cannot be null");
|
||||
}
|
||||
criteria.add(new Criterion(condition, value1, value2));
|
||||
}
|
||||
|
||||
public Criteria andIdIsNull() {
|
||||
addCriterion("id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIsNotNull() {
|
||||
addCriterion("id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdEqualTo(Long value) {
|
||||
addCriterion("id =", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotEqualTo(Long value) {
|
||||
addCriterion("id <>", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThan(Long value) {
|
||||
addCriterion("id >", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("id >=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThan(Long value) {
|
||||
addCriterion("id <", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("id <=", value, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdIn(List<Long> values) {
|
||||
addCriterion("id in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotIn(List<Long> values) {
|
||||
addCriterion("id not in", values, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdBetween(Long value1, Long value2) {
|
||||
addCriterion("id between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("id not between", value1, value2, "id");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNull() {
|
||||
addCriterion("domain_id is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIsNotNull() {
|
||||
addCriterion("domain_id is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdEqualTo(Long value) {
|
||||
addCriterion("domain_id =", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotEqualTo(Long value) {
|
||||
addCriterion("domain_id <>", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThan(Long value) {
|
||||
addCriterion("domain_id >", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id >=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThan(Long value) {
|
||||
addCriterion("domain_id <", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
|
||||
addCriterion("domain_id <=", value, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdIn(List<Long> values) {
|
||||
addCriterion("domain_id in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotIn(List<Long> values) {
|
||||
addCriterion("domain_id not in", values, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
|
||||
addCriterion("domain_id not between", value1, value2, "domainId");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNull() {
|
||||
addCriterion("status is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIsNotNull() {
|
||||
addCriterion("status is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusEqualTo(Integer value) {
|
||||
addCriterion("status =", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotEqualTo(Integer value) {
|
||||
addCriterion("status <>", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThan(Integer value) {
|
||||
addCriterion("status >", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
|
||||
addCriterion("status >=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThan(Integer value) {
|
||||
addCriterion("status <", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusLessThanOrEqualTo(Integer value) {
|
||||
addCriterion("status <=", value, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusIn(List<Integer> values) {
|
||||
addCriterion("status in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotIn(List<Integer> values) {
|
||||
addCriterion("status not in", values, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusBetween(Integer value1, Integer value2) {
|
||||
addCriterion("status between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
|
||||
addCriterion("status not between", value1, value2, "status");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsIsNull() {
|
||||
addCriterion("elapsed_ms is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsIsNotNull() {
|
||||
addCriterion("elapsed_ms is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsEqualTo(Long value) {
|
||||
addCriterion("elapsed_ms =", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsNotEqualTo(Long value) {
|
||||
addCriterion("elapsed_ms <>", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsGreaterThan(Long value) {
|
||||
addCriterion("elapsed_ms >", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsGreaterThanOrEqualTo(Long value) {
|
||||
addCriterion("elapsed_ms >=", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsLessThan(Long value) {
|
||||
addCriterion("elapsed_ms <", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsLessThanOrEqualTo(Long value) {
|
||||
addCriterion("elapsed_ms <=", value, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsIn(List<Long> values) {
|
||||
addCriterion("elapsed_ms in", values, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsNotIn(List<Long> values) {
|
||||
addCriterion("elapsed_ms not in", values, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsBetween(Long value1, Long value2) {
|
||||
addCriterion("elapsed_ms between", value1, value2, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andElapsedMsNotBetween(Long value1, Long value2) {
|
||||
addCriterion("elapsed_ms not between", value1, value2, "elapsedMs");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary_task
|
||||
*/
|
||||
public static class Criteria extends GeneratedCriteria {
|
||||
|
||||
protected Criteria() {
|
||||
super();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* s2_dictionary_task null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
private Object secondValue;
|
||||
|
||||
private boolean noValue;
|
||||
|
||||
private boolean singleValue;
|
||||
|
||||
private boolean betweenValue;
|
||||
|
||||
private boolean listValue;
|
||||
|
||||
private String typeHandler;
|
||||
|
||||
public String getCondition() {
|
||||
return condition;
|
||||
}
|
||||
|
||||
public Object getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public Object getSecondValue() {
|
||||
return secondValue;
|
||||
}
|
||||
|
||||
public boolean isNoValue() {
|
||||
return noValue;
|
||||
}
|
||||
|
||||
public boolean isSingleValue() {
|
||||
return singleValue;
|
||||
}
|
||||
|
||||
public boolean isBetweenValue() {
|
||||
return betweenValue;
|
||||
}
|
||||
|
||||
public boolean isListValue() {
|
||||
return listValue;
|
||||
}
|
||||
|
||||
public String getTypeHandler() {
|
||||
return typeHandler;
|
||||
}
|
||||
|
||||
protected Criterion(String condition) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.typeHandler = null;
|
||||
this.noValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.typeHandler = typeHandler;
|
||||
if (value instanceof List<?>) {
|
||||
this.listValue = true;
|
||||
} else {
|
||||
this.singleValue = true;
|
||||
}
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value) {
|
||||
this(condition, value, null);
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
|
||||
super();
|
||||
this.condition = condition;
|
||||
this.value = value;
|
||||
this.secondValue = secondValue;
|
||||
this.typeHandler = typeHandler;
|
||||
this.betweenValue = true;
|
||||
}
|
||||
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user