mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-11 12:07:42 +00:00
(improvement)(project) support for modifying filter conditions and fix group by pushdown and add windows scipt (#49)
Co-authored-by: lexluo <lexluo@tencent.com>
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
</properties>
|
||||
|
||||
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
@@ -74,6 +75,7 @@
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.testng</groupId>
|
||||
<artifactId>testng</artifactId>
|
||||
|
||||
@@ -21,6 +21,7 @@ import java.util.Map;
|
||||
import java.util.Set;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
@Slf4j
|
||||
@Component
|
||||
@@ -48,7 +49,12 @@ public class CatalogImpl implements Catalog {
|
||||
}
|
||||
|
||||
public DatabaseResp getDatabaseByModelId(Long modelId) {
|
||||
return databaseService.getDatabaseByModelId(modelId);
|
||||
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(modelId);
|
||||
if (!CollectionUtils.isEmpty(datasourceResps)) {
|
||||
Long databaseId = datasourceResps.iterator().next().getDatabaseId();
|
||||
return databaseService.getDatabase(databaseId);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,13 +2,10 @@ package com.tencent.supersonic.semantic.model.application;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatabaseReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.SqlParserResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.DomainService;
|
||||
import com.tencent.supersonic.semantic.model.domain.ModelService;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter.EngineAdaptor;
|
||||
import com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter.EngineAdaptorFactory;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO;
|
||||
@@ -19,11 +16,11 @@ import com.tencent.supersonic.semantic.model.domain.utils.SqlUtils;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatabaseService;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Database;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@@ -32,19 +29,14 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
|
||||
private final SqlUtils sqlUtils;
|
||||
private DatabaseRepository databaseRepository;
|
||||
|
||||
private DomainService domainService;
|
||||
|
||||
private ModelService modelService;
|
||||
private DatasourceService datasourceService;
|
||||
|
||||
public DatabaseServiceImpl(DatabaseRepository databaseRepository,
|
||||
SqlUtils sqlUtils,
|
||||
DomainService domainService,
|
||||
ModelService modelService) {
|
||||
@Lazy DatasourceService datasourceService) {
|
||||
this.databaseRepository = databaseRepository;
|
||||
this.sqlUtils = sqlUtils;
|
||||
this.modelService = modelService;
|
||||
this.domainService = domainService;
|
||||
this.datasourceService = datasourceService;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -56,17 +48,52 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
@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());
|
||||
DatabaseDO databaseDO = getDatabaseDO(databaseReq.getId());
|
||||
if (databaseDO != null) {
|
||||
DatabaseConverter.convert(database, databaseDO);
|
||||
databaseRepository.updateDatabase(databaseDO);
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
DatabaseDO databaseDO = DatabaseConverter.convert(database);
|
||||
databaseDO = DatabaseConverter.convert(database);
|
||||
databaseRepository.createDatabase(databaseDO);
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatabaseResp> getDatabaseList(User user) {
|
||||
List<DatabaseResp> databaseResps =
|
||||
databaseRepository.getDatabaseList()
|
||||
.stream().map(DatabaseConverter::convert)
|
||||
.collect(Collectors.toList());
|
||||
fillPermission(databaseResps, user);
|
||||
return databaseResps;
|
||||
}
|
||||
|
||||
private void fillPermission(List<DatabaseResp> databaseResps, User user) {
|
||||
databaseResps.forEach(databaseResp -> {
|
||||
if (databaseResp.getAdmins().contains(user.getName())
|
||||
|| user.getName().equalsIgnoreCase(databaseResp.getCreatedBy())) {
|
||||
databaseResp.setHasPermission(true);
|
||||
databaseResp.setHasEditPermission(true);
|
||||
databaseResp.setHasUsePermission(true);
|
||||
}
|
||||
if (databaseResp.getViewers().contains(databaseResp.getCreatedBy())) {
|
||||
databaseResp.setHasUsePermission(true);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDatabase(Long databaseId) {
|
||||
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(databaseId);
|
||||
if (!CollectionUtils.isEmpty(datasourceResps)) {
|
||||
List<String> datasourceNames = datasourceResps.stream()
|
||||
.map(DatasourceResp::getName).collect(Collectors.toList());
|
||||
String message = String.format("该数据库被数据源%s使用,无法删除", datasourceNames);
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
databaseRepository.deleteDatabase(databaseId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseResp getDatabase(Long id) {
|
||||
@@ -74,36 +101,20 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
return DatabaseConverter.convert(databaseDO);
|
||||
}
|
||||
|
||||
// one domain only has one database
|
||||
@Override
|
||||
public DatabaseResp getDatabaseByDomainId(Long domainId) {
|
||||
Optional<DatabaseDO> databaseDO = getDatabaseDO(domainId);
|
||||
return databaseDO.map(DatabaseConverter::convert).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public DatabaseResp getDatabaseByModelId(Long modelId) {
|
||||
ModelResp modelResp = modelService.getModel(modelId);
|
||||
Map<Long, DomainResp> domainRespMap = domainService.getDomainMap();
|
||||
Long domainId = modelResp.getDomainId();
|
||||
Optional<DatabaseDO> databaseDO = getDatabaseDO(domainId);
|
||||
while (!databaseDO.isPresent()) {
|
||||
DomainResp domainResp = domainRespMap.get(domainId);
|
||||
if (domainResp == null) {
|
||||
return null;
|
||||
}
|
||||
domainId = domainResp.getParentId();
|
||||
databaseDO = getDatabaseDO(domainId);
|
||||
}
|
||||
return databaseDO.map(DatabaseConverter::convert).orElse(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QueryResultWithSchemaResp executeSql(String sql, Long modelId) {
|
||||
DatabaseResp databaseResp = getDatabaseByModelId(modelId);
|
||||
public QueryResultWithSchemaResp executeSql(String sql, Long id, User user) {
|
||||
DatabaseResp databaseResp = getDatabase(id);
|
||||
if (databaseResp == null) {
|
||||
return new QueryResultWithSchemaResp();
|
||||
}
|
||||
List<String> admins = databaseResp.getAdmins();
|
||||
if (!admins.contains(user.getName())
|
||||
|| !databaseResp.getCreatedBy().equalsIgnoreCase(user.getName())) {
|
||||
String message = String.format("您暂无当前数据库%s权限, 请联系数据库管理员%s开通",
|
||||
databaseResp.getName(),
|
||||
String.join(",", admins));
|
||||
throw new RuntimeException(message);
|
||||
}
|
||||
return executeSql(sql, databaseResp);
|
||||
}
|
||||
|
||||
@@ -112,17 +123,6 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
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);
|
||||
@@ -131,9 +131,8 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
return queryResultWithColumns;
|
||||
}
|
||||
|
||||
private Optional<DatabaseDO> getDatabaseDO(Long domainId) {
|
||||
List<DatabaseDO> databaseDOS = databaseRepository.getDatabaseByDomainId(domainId);
|
||||
return databaseDOS.stream().findFirst();
|
||||
private DatabaseDO getDatabaseDO(Long id) {
|
||||
return databaseRepository.getDatabase(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,9 @@ import com.tencent.supersonic.semantic.api.model.pojo.DatasourceDetail;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Dim;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatasourceRelaReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatasourceReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DateInfoReq;
|
||||
@@ -20,9 +23,6 @@ import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ItemDateResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MeasureResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatabaseService;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.model.domain.DimensionService;
|
||||
@@ -190,6 +190,13 @@ public class DatasourceServiceImpl implements DatasourceService {
|
||||
return DatasourceConverter.convertList(datasourceRepository.getDatasourceList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceResp> getDatasourceListByDatabaseId(Long databaseId) {
|
||||
return getDatasourceList().stream()
|
||||
.filter(datasourceResp -> datasourceResp.getDatabaseId().equals(databaseId))
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long modelId) {
|
||||
List<DatasourceResp> datasourceResps = getDatasourceList(modelId);
|
||||
@@ -346,7 +353,8 @@ public class DatasourceServiceImpl implements DatasourceService {
|
||||
List<DatasourceResp> datasourceResps = getDatasourceList(modelId);
|
||||
List<MetricResp> metricResps = metricService.getMetrics(modelId);
|
||||
metricYamlTplList.addAll(MetricYamlManager.convert2YamlObj(MetricConverter.metricInfo2Metric(metricResps)));
|
||||
DatabaseResp databaseResp = databaseService.getDatabaseByModelId(modelId);
|
||||
Long databaseId = datasourceResps.iterator().next().getDatabaseId();
|
||||
DatabaseResp databaseResp = databaseService.getDatabase(databaseId);
|
||||
List<DimensionResp> dimensionResps = dimensionService.getDimensions(modelId);
|
||||
for (DatasourceResp datasourceResp : datasourceResps) {
|
||||
datasourceYamlTplList.add(DatasourceYamlManager.convert2YamlObj(
|
||||
|
||||
@@ -92,12 +92,12 @@ public class DomainServiceImpl implements DomainService {
|
||||
|
||||
@Override
|
||||
public List<DomainResp> getDomainListWithAdminAuth(User user) {
|
||||
Set<DomainResp> domainWithAuthAll = getDomainAuthSet(user.getName(), AuthType.VISIBLE);
|
||||
Set<DomainResp> domainWithAuthAll = getDomainAuthSet(user.getName(), AuthType.ADMIN);
|
||||
if (!CollectionUtils.isEmpty(domainWithAuthAll)) {
|
||||
List<Long> domainIds = domainWithAuthAll.stream().map(DomainResp::getId).collect(Collectors.toList());
|
||||
domainWithAuthAll.addAll(getParentDomain(domainIds));
|
||||
}
|
||||
List<ModelResp> modelResps = modelService.getModelAuthList(user.getName(), AuthType.VISIBLE);
|
||||
List<ModelResp> modelResps = modelService.getModelAuthList(user.getName(), AuthType.ADMIN);
|
||||
if (!CollectionUtils.isEmpty(modelResps)) {
|
||||
List<Long> domainIds = modelResps.stream().map(ModelResp::getDomainId).collect(Collectors.toList());
|
||||
domainWithAuthAll.addAll(getParentDomain(domainIds));
|
||||
|
||||
@@ -5,13 +5,14 @@ import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ViewInfoReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelSchemaRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.ViewInfoRepository;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
|
||||
import com.tencent.supersonic.semantic.model.domain.DimensionService;
|
||||
import com.tencent.supersonic.semantic.model.domain.MetricService;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.ViewInfoRepository;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import org.assertj.core.util.Lists;
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package com.tencent.supersonic.semantic.model.domain;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ItemDateResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -16,7 +16,6 @@ import java.util.Set;
|
||||
public interface Catalog {
|
||||
|
||||
DatabaseResp getDatabase(Long id);
|
||||
|
||||
DatabaseResp getDatabaseByModelId(Long modelId);
|
||||
|
||||
List<DatasourceResp> getDatasourceList(Long modelId);
|
||||
|
||||
@@ -4,28 +4,25 @@ import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatabaseReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.SqlParserResp;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
public interface DatabaseService {
|
||||
|
||||
QueryResultWithSchemaResp executeSql(String sql, DatabaseResp databaseResp);
|
||||
|
||||
QueryResultWithSchemaResp executeSql(String sql, Long domainId);
|
||||
|
||||
DatabaseResp getDatabaseByModelId(Long modelId);
|
||||
QueryResultWithSchemaResp executeSql(String sql, Long id, User user);
|
||||
|
||||
boolean testConnect(DatabaseReq databaseReq, User user);
|
||||
|
||||
DatabaseResp createOrUpdateDatabase(DatabaseReq databaseReq, User user);
|
||||
|
||||
List<DatabaseResp> getDatabaseList(User user);
|
||||
|
||||
void deleteDatabase(Long databaseId);
|
||||
|
||||
DatabaseResp getDatabase(Long id);
|
||||
|
||||
// one domain only has one database
|
||||
DatabaseResp getDatabaseByDomainId(Long domainId);
|
||||
|
||||
QueryResultWithSchemaResp queryWithColumns(SqlParserResp sqlParser);
|
||||
|
||||
QueryResultWithSchemaResp getDbNames(Long id);
|
||||
|
||||
QueryResultWithSchemaResp getTables(Long id, String db);
|
||||
|
||||
@@ -3,15 +3,15 @@ package com.tencent.supersonic.semantic.model.domain;
|
||||
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatasourceRelaReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DatasourceReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ItemDateResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MeasureResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -22,11 +22,13 @@ public interface DatasourceService {
|
||||
|
||||
DatasourceResp updateDatasource(DatasourceReq datasourceReq, User user) throws Exception;
|
||||
|
||||
List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long domainId);
|
||||
List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long modelId);
|
||||
|
||||
List<DatasourceResp> getDatasourceListByDatabaseId(Long databaseId);
|
||||
|
||||
List<DatasourceResp> getDatasourceList();
|
||||
|
||||
List<DatasourceResp> getDatasourceList(Long domainId);
|
||||
List<DatasourceResp> getDatasourceList(Long modelId);
|
||||
|
||||
Map<Long, DatasourceResp> getDatasourceMap();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.tencent.supersonic.common.pojo.enums.AuthType;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DomainReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DomainUpdateReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
@@ -6,6 +6,7 @@ import com.tencent.supersonic.semantic.api.model.request.ModelReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelSchemaFilterReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelSchemaResp;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
|
||||
public class ClickHouseAdaptor extends EngineAdaptor {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
|
||||
|
||||
public class MysqlAdaptor extends EngineAdaptor {
|
||||
|
||||
@@ -3,17 +3,11 @@ package com.tencent.supersonic.semantic.model.domain.dataobject;
|
||||
import java.util.Date;
|
||||
|
||||
public class DatabaseDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 主题域ID
|
||||
*/
|
||||
private Long domainId;
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
@@ -25,7 +19,7 @@ public class DatabaseDO {
|
||||
private String description;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
*/
|
||||
private String version;
|
||||
|
||||
@@ -54,46 +48,39 @@ public class DatabaseDO {
|
||||
*/
|
||||
private String updatedBy;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String admin;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private String viewer;
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*/
|
||||
private String config;
|
||||
|
||||
/**
|
||||
* @return id
|
||||
*
|
||||
* @return id
|
||||
*/
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param 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() {
|
||||
@@ -102,7 +89,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 名称
|
||||
*
|
||||
* @param name 名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
@@ -111,7 +97,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*
|
||||
* @return description 描述
|
||||
*/
|
||||
public String getDescription() {
|
||||
@@ -120,7 +105,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 描述
|
||||
*
|
||||
* @param description 描述
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
@@ -128,14 +112,16 @@ public class DatabaseDO {
|
||||
}
|
||||
|
||||
/**
|
||||
* @return version
|
||||
*
|
||||
* @return version
|
||||
*/
|
||||
public String getVersion() {
|
||||
return version;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param version
|
||||
*
|
||||
* @param version
|
||||
*/
|
||||
public void setVersion(String version) {
|
||||
this.version = version == null ? null : version.trim();
|
||||
@@ -143,7 +129,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 类型 mysql,clickhouse,tdw
|
||||
*
|
||||
* @return type 类型 mysql,clickhouse,tdw
|
||||
*/
|
||||
public String getType() {
|
||||
@@ -152,7 +137,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 类型 mysql,clickhouse,tdw
|
||||
*
|
||||
* @param type 类型 mysql,clickhouse,tdw
|
||||
*/
|
||||
public void setType(String type) {
|
||||
@@ -161,7 +145,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @return created_at 创建时间
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
@@ -170,7 +153,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
@@ -179,7 +161,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @return created_by 创建人
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
@@ -188,7 +169,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @param createdBy 创建人
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
@@ -197,7 +177,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @return updated_at 更新时间
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
@@ -206,7 +185,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
@@ -215,7 +193,6 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @return updated_by 更新人
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
@@ -224,16 +201,46 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @param updatedBy 更新人
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return admin
|
||||
*/
|
||||
public String getAdmin() {
|
||||
return admin;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param admin
|
||||
*/
|
||||
public void setAdmin(String admin) {
|
||||
this.admin = admin == null ? null : admin.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return viewer
|
||||
*/
|
||||
public String getViewer() {
|
||||
return viewer;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param viewer
|
||||
*/
|
||||
public void setViewer(String viewer) {
|
||||
this.viewer = viewer == null ? null : viewer.trim();
|
||||
}
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*
|
||||
* @return config 配置信息
|
||||
*/
|
||||
public String getConfig() {
|
||||
@@ -242,10 +249,9 @@ public class DatabaseDO {
|
||||
|
||||
/**
|
||||
* 配置信息
|
||||
*
|
||||
* @param config 配置信息
|
||||
*/
|
||||
public void setConfig(String config) {
|
||||
this.config = config == null ? null : config.trim();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatabaseDOExample {
|
||||
|
||||
/**
|
||||
* s2_database
|
||||
*/
|
||||
@@ -32,6 +31,7 @@ public class DatabaseDOExample {
|
||||
protected Integer limitEnd;
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public DatabaseDOExample() {
|
||||
@@ -39,6 +39,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setOrderByClause(String orderByClause) {
|
||||
@@ -46,6 +47,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public String getOrderByClause() {
|
||||
@@ -53,6 +55,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setDistinct(boolean distinct) {
|
||||
@@ -60,6 +63,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public boolean isDistinct() {
|
||||
@@ -67,6 +71,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public List<Criteria> getOredCriteria() {
|
||||
@@ -74,6 +79,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void or(Criteria criteria) {
|
||||
@@ -81,6 +87,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria or() {
|
||||
@@ -90,6 +97,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Criteria createCriteria() {
|
||||
@@ -101,6 +109,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
protected Criteria createCriteriaInternal() {
|
||||
@@ -109,6 +118,7 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void clear() {
|
||||
@@ -118,13 +128,15 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitStart(Integer limitStart) {
|
||||
this.limitStart = limitStart;
|
||||
this.limitStart=limitStart;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitStart() {
|
||||
@@ -132,13 +144,15 @@ public class DatabaseDOExample {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public void setLimitEnd(Integer limitEnd) {
|
||||
this.limitEnd = limitEnd;
|
||||
this.limitEnd=limitEnd;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
public Integer getLimitEnd() {
|
||||
@@ -149,7 +163,6 @@ public class DatabaseDOExample {
|
||||
* s2_database null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -250,66 +263,6 @@ public class DatabaseDOExample {
|
||||
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;
|
||||
@@ -849,6 +802,146 @@ public class DatabaseDOExample {
|
||||
addCriterion("updated_by not between", value1, value2, "updatedBy");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminIsNull() {
|
||||
addCriterion("admin is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminIsNotNull() {
|
||||
addCriterion("admin is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminEqualTo(String value) {
|
||||
addCriterion("admin =", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminNotEqualTo(String value) {
|
||||
addCriterion("admin <>", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminGreaterThan(String value) {
|
||||
addCriterion("admin >", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("admin >=", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminLessThan(String value) {
|
||||
addCriterion("admin <", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminLessThanOrEqualTo(String value) {
|
||||
addCriterion("admin <=", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminLike(String value) {
|
||||
addCriterion("admin like", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminNotLike(String value) {
|
||||
addCriterion("admin not like", value, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminIn(List<String> values) {
|
||||
addCriterion("admin in", values, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminNotIn(List<String> values) {
|
||||
addCriterion("admin not in", values, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminBetween(String value1, String value2) {
|
||||
addCriterion("admin between", value1, value2, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andAdminNotBetween(String value1, String value2) {
|
||||
addCriterion("admin not between", value1, value2, "admin");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerIsNull() {
|
||||
addCriterion("viewer is null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerIsNotNull() {
|
||||
addCriterion("viewer is not null");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerEqualTo(String value) {
|
||||
addCriterion("viewer =", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerNotEqualTo(String value) {
|
||||
addCriterion("viewer <>", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerGreaterThan(String value) {
|
||||
addCriterion("viewer >", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerGreaterThanOrEqualTo(String value) {
|
||||
addCriterion("viewer >=", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerLessThan(String value) {
|
||||
addCriterion("viewer <", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerLessThanOrEqualTo(String value) {
|
||||
addCriterion("viewer <=", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerLike(String value) {
|
||||
addCriterion("viewer like", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerNotLike(String value) {
|
||||
addCriterion("viewer not like", value, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerIn(List<String> values) {
|
||||
addCriterion("viewer in", values, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerNotIn(List<String> values) {
|
||||
addCriterion("viewer not in", values, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerBetween(String value1, String value2) {
|
||||
addCriterion("viewer between", value1, value2, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
|
||||
public Criteria andViewerNotBetween(String value1, String value2) {
|
||||
addCriterion("viewer not between", value1, value2, "viewer");
|
||||
return (Criteria) this;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -865,7 +958,6 @@ public class DatabaseDOExample {
|
||||
* s2_database null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
@@ -882,6 +974,38 @@ public class DatabaseDOExample {
|
||||
|
||||
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;
|
||||
@@ -917,37 +1041,5 @@ public class DatabaseDOExample {
|
||||
protected Criterion(String condition, Object value, Object secondValue) {
|
||||
this(condition, value, secondValue, null);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,6 @@ package com.tencent.supersonic.semantic.model.domain.dataobject;
|
||||
import java.util.Date;
|
||||
|
||||
public class DatasourceDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatasourceDOExample {
|
||||
|
||||
/**
|
||||
* s2_datasource
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class DatasourceDOExample {
|
||||
* s2_datasource null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -855,7 +853,6 @@ public class DatasourceDOExample {
|
||||
* s2_datasource null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.tencent.supersonic.semantic.model.domain.dataobject;
|
||||
import java.util.Date;
|
||||
|
||||
public class DatasourceRelaDO {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DatasourceRelaDOExample {
|
||||
|
||||
/**
|
||||
* s2_datasource_rela
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class DatasourceRelaDOExample {
|
||||
* s2_datasource_rela null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -775,7 +773,6 @@ public class DatasourceRelaDOExample {
|
||||
* s2_datasource_rela null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.tencent.supersonic.semantic.model.domain.dataobject;
|
||||
import java.util.Date;
|
||||
|
||||
public class DimensionDO {
|
||||
|
||||
/**
|
||||
* 维度ID
|
||||
*/
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DimensionDOExample {
|
||||
|
||||
/**
|
||||
* s2_dimension
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class DimensionDOExample {
|
||||
* s2_dimension null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -1325,7 +1323,6 @@ public class DimensionDOExample {
|
||||
* s2_dimension null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -3,7 +3,6 @@ package com.tencent.supersonic.semantic.model.domain.dataobject;
|
||||
import java.util.Date;
|
||||
|
||||
public class DomainDO {
|
||||
|
||||
/**
|
||||
* 自增ID
|
||||
*/
|
||||
@@ -76,7 +75,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 自增ID
|
||||
*
|
||||
* @return id 自增ID
|
||||
*/
|
||||
public Long getId() {
|
||||
@@ -85,7 +83,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 自增ID
|
||||
*
|
||||
* @param id 自增ID
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
@@ -94,7 +91,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域名称
|
||||
*
|
||||
* @return name 主题域名称
|
||||
*/
|
||||
public String getName() {
|
||||
@@ -103,7 +99,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域名称
|
||||
*
|
||||
* @param name 主题域名称
|
||||
*/
|
||||
public void setName(String name) {
|
||||
@@ -112,7 +107,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 内部名称
|
||||
*
|
||||
* @return biz_name 内部名称
|
||||
*/
|
||||
public String getBizName() {
|
||||
@@ -121,7 +115,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 内部名称
|
||||
*
|
||||
* @param bizName 内部名称
|
||||
*/
|
||||
public void setBizName(String bizName) {
|
||||
@@ -130,7 +123,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 父主题域ID
|
||||
*
|
||||
* @return parent_id 父主题域ID
|
||||
*/
|
||||
public Long getParentId() {
|
||||
@@ -139,7 +131,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 父主题域ID
|
||||
*
|
||||
* @param parentId 父主题域ID
|
||||
*/
|
||||
public void setParentId(Long parentId) {
|
||||
@@ -148,7 +139,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域状态
|
||||
*
|
||||
* @return status 主题域状态
|
||||
*/
|
||||
public Integer getStatus() {
|
||||
@@ -157,7 +147,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域状态
|
||||
*
|
||||
* @param status 主题域状态
|
||||
*/
|
||||
public void setStatus(Integer status) {
|
||||
@@ -166,7 +155,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @return created_at 创建时间
|
||||
*/
|
||||
public Date getCreatedAt() {
|
||||
@@ -175,7 +163,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*
|
||||
* @param createdAt 创建时间
|
||||
*/
|
||||
public void setCreatedAt(Date createdAt) {
|
||||
@@ -184,7 +171,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @return created_by 创建人
|
||||
*/
|
||||
public String getCreatedBy() {
|
||||
@@ -193,7 +179,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*
|
||||
* @param createdBy 创建人
|
||||
*/
|
||||
public void setCreatedBy(String createdBy) {
|
||||
@@ -202,7 +187,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @return updated_at 更新时间
|
||||
*/
|
||||
public Date getUpdatedAt() {
|
||||
@@ -211,7 +195,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*
|
||||
* @param updatedAt 更新时间
|
||||
*/
|
||||
public void setUpdatedAt(Date updatedAt) {
|
||||
@@ -220,7 +203,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @return updated_by 更新人
|
||||
*/
|
||||
public String getUpdatedBy() {
|
||||
@@ -229,7 +211,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 更新人
|
||||
*
|
||||
* @param updatedBy 更新人
|
||||
*/
|
||||
public void setUpdatedBy(String updatedBy) {
|
||||
@@ -238,7 +219,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域管理员
|
||||
*
|
||||
* @return admin 主题域管理员
|
||||
*/
|
||||
public String getAdmin() {
|
||||
@@ -247,7 +227,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域管理员
|
||||
*
|
||||
* @param admin 主题域管理员
|
||||
*/
|
||||
public void setAdmin(String admin) {
|
||||
@@ -256,7 +235,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域管理员组织
|
||||
*
|
||||
* @return admin_org 主题域管理员组织
|
||||
*/
|
||||
public String getAdminOrg() {
|
||||
@@ -265,7 +243,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域管理员组织
|
||||
*
|
||||
* @param adminOrg 主题域管理员组织
|
||||
*/
|
||||
public void setAdminOrg(String adminOrg) {
|
||||
@@ -274,7 +251,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域是否公开
|
||||
*
|
||||
* @return is_open 主题域是否公开
|
||||
*/
|
||||
public Integer getIsOpen() {
|
||||
@@ -283,7 +259,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域是否公开
|
||||
*
|
||||
* @param isOpen 主题域是否公开
|
||||
*/
|
||||
public void setIsOpen(Integer isOpen) {
|
||||
@@ -292,7 +267,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域可用用户
|
||||
*
|
||||
* @return viewer 主题域可用用户
|
||||
*/
|
||||
public String getViewer() {
|
||||
@@ -301,7 +275,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域可用用户
|
||||
*
|
||||
* @param viewer 主题域可用用户
|
||||
*/
|
||||
public void setViewer(String viewer) {
|
||||
@@ -310,7 +283,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域可用组织
|
||||
*
|
||||
* @return view_org 主题域可用组织
|
||||
*/
|
||||
public String getViewOrg() {
|
||||
@@ -319,7 +291,6 @@ public class DomainDO {
|
||||
|
||||
/**
|
||||
* 主题域可用组织
|
||||
*
|
||||
* @param viewOrg 主题域可用组织
|
||||
*/
|
||||
public void setViewOrg(String viewOrg) {
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class DomainDOExample {
|
||||
|
||||
/**
|
||||
* s2_domain
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class DomainDOExample {
|
||||
* s2_domain null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -1125,7 +1123,6 @@ public class DomainDOExample {
|
||||
* s2_domain null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class MetricDOExample {
|
||||
|
||||
/**
|
||||
* s2_metric
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class MetricDOExample {
|
||||
* s2_metric null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -1195,7 +1193,6 @@ public class MetricDOExample {
|
||||
* s2_metric null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ModelDOExample {
|
||||
|
||||
/**
|
||||
* s2_model
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class ModelDOExample {
|
||||
* s2_model null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -1065,7 +1063,6 @@ public class ModelDOExample {
|
||||
* s2_model null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -5,7 +5,6 @@ import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
public class ViewInfoDOExample {
|
||||
|
||||
/**
|
||||
* s2_view_info
|
||||
*/
|
||||
@@ -149,7 +148,6 @@ public class ViewInfoDOExample {
|
||||
* s2_view_info null
|
||||
*/
|
||||
protected abstract static class GeneratedCriteria {
|
||||
|
||||
protected List<Criterion> criteria;
|
||||
|
||||
protected GeneratedCriteria() {
|
||||
@@ -655,7 +653,6 @@ public class ViewInfoDOExample {
|
||||
* s2_view_info null
|
||||
*/
|
||||
public static class Criterion {
|
||||
|
||||
private String condition;
|
||||
|
||||
private Object value;
|
||||
|
||||
@@ -4,17 +4,17 @@ import com.tencent.supersonic.semantic.api.model.pojo.DatasourceDetail;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Dim;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Identify;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DatasourceYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionTimeTypeParamsTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.IdentifyYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.MeasureYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.utils.SysTimeDimensionBuilder;
|
||||
import com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter.EngineAdaptor;
|
||||
import com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter.EngineAdaptorFactory;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Datasource;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.DatasourceQueryEnum;
|
||||
import com.tencent.supersonic.semantic.model.domain.utils.SysTimeDimensionBuilder;
|
||||
import java.util.stream.Collectors;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
@@ -3,6 +3,9 @@ package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.RecordInfo;
|
||||
import lombok.Data;
|
||||
import org.assertj.core.util.Lists;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Database extends RecordInfo {
|
||||
@@ -25,5 +28,8 @@ public class Database extends RecordInfo {
|
||||
|
||||
private ConnectInfo connectInfo;
|
||||
|
||||
private List<String> admins = Lists.newArrayList();
|
||||
|
||||
private List<String> viewers = Lists.newArrayList();
|
||||
|
||||
}
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class Dimension extends SchemaItem {
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DomainReq;
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.alibaba.druid.wall.WallFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.DataTypeEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.utils.JdbcDataSourceUtils;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.Map;
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.pojo;
|
||||
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
|
||||
@@ -5,10 +5,11 @@ import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
|
||||
import java.util.List;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@Data
|
||||
public class Model extends SchemaItem {
|
||||
|
||||
@@ -12,6 +12,7 @@ public interface DatabaseRepository {
|
||||
|
||||
DatabaseDO getDatabase(Long id);
|
||||
|
||||
List<DatabaseDO> getDatabaseByDomainId(Long domainId);
|
||||
List<DatabaseDO> getDatabaseList();
|
||||
|
||||
void deleteDatabase(Long id);
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ package com.tencent.supersonic.semantic.model.domain.repository;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DateInfoReq;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DateInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface DateInfoRepository {
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tencent.supersonic.semantic.model.domain.repository;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.repository;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.ConnectInfo;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Database;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
public class DatabaseConverter {
|
||||
@@ -33,6 +35,8 @@ public class DatabaseConverter {
|
||||
database.setId(databaseDO.getId());
|
||||
BeanUtils.copyProperties(database, databaseDO);
|
||||
databaseDO.setConfig(JSONObject.toJSONString(database.getConnectInfo()));
|
||||
databaseDO.setAdmin(String.join(",", database.getAdmins()));
|
||||
databaseDO.setViewer(String.join(",", database.getViewers()));
|
||||
return databaseDO;
|
||||
}
|
||||
|
||||
@@ -41,6 +45,8 @@ public class DatabaseConverter {
|
||||
DatabaseDO databaseDO = new DatabaseDO();
|
||||
BeanUtils.copyProperties(database, databaseDO);
|
||||
databaseDO.setConfig(JSONObject.toJSONString(database.getConnectInfo()));
|
||||
databaseDO.setAdmin(String.join(",", database.getAdmins()));
|
||||
databaseDO.setViewer(String.join(",", database.getViewers()));
|
||||
return databaseDO;
|
||||
}
|
||||
|
||||
@@ -52,6 +58,12 @@ public class DatabaseConverter {
|
||||
databaseResp.setUrl(connectInfo.getUrl());
|
||||
databaseResp.setPassword(connectInfo.getPassword());
|
||||
databaseResp.setUsername(connectInfo.getUserName());
|
||||
if (StringUtils.isNotBlank(databaseDO.getAdmin())) {
|
||||
databaseResp.setAdmins(Arrays.asList(databaseDO.getAdmin().split(",")));
|
||||
}
|
||||
if (StringUtils.isNotBlank(databaseDO.getViewer())) {
|
||||
databaseResp.setViewers(Arrays.asList(databaseDO.getViewer().split(",")));
|
||||
}
|
||||
return databaseResp;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,8 +3,6 @@ package com.tencent.supersonic.semantic.model.domain.utils;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.common.util.BeanMapper;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.MetricTypeEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DatasourceDetail;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.Dim;
|
||||
@@ -17,6 +15,8 @@ import com.tencent.supersonic.semantic.api.model.request.MetricReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceRelaResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.MeasureResp;
|
||||
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
|
||||
import com.tencent.supersonic.common.util.BeanMapper;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Datasource;
|
||||
|
||||
@@ -1,18 +1,20 @@
|
||||
package com.tencent.supersonic.semantic.model.domain.utils;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.tencent.supersonic.common.util.BeanMapper;
|
||||
import com.tencent.supersonic.common.util.JsonUtil;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DimensionReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
|
||||
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
|
||||
import com.tencent.supersonic.common.util.BeanMapper;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Dimension;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.logging.log4j.util.Strings;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
@@ -46,8 +48,8 @@ public class DimensionConverter {
|
||||
|
||||
|
||||
public static DimensionResp convert2DimensionResp(DimensionDO dimensionDO,
|
||||
Map<Long, String> fullPathMap,
|
||||
Map<Long, DatasourceResp> datasourceRespMap) {
|
||||
Map<Long, String> fullPathMap,
|
||||
Map<Long, DatasourceResp> datasourceRespMap) {
|
||||
DimensionResp dimensionResp = new DimensionResp();
|
||||
BeanUtils.copyProperties(dimensionDO, dimensionResp);
|
||||
dimensionResp.setFullPath(fullPathMap.get(dimensionDO.getModelId()) + dimensionDO.getBizName());
|
||||
|
||||
@@ -10,9 +10,9 @@ import static com.tencent.supersonic.common.pojo.Constants.PATTERN_JDBC_TYPE;
|
||||
import static com.tencent.supersonic.common.pojo.Constants.SPACE;
|
||||
|
||||
import com.alibaba.druid.util.StringUtils;
|
||||
import com.tencent.supersonic.common.util.MD5Util;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.DataTypeEnum;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.common.util.MD5Util;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Database;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.JdbcDataSource;
|
||||
import java.sql.Connection;
|
||||
|
||||
@@ -11,11 +11,11 @@ import com.tencent.supersonic.semantic.api.model.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.Model;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.Map;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
|
||||
public class ModelConvert {
|
||||
|
||||
@@ -57,7 +57,7 @@ public class ModelConvert {
|
||||
}
|
||||
|
||||
public static ModelResp convert(ModelDO modelDO,
|
||||
Map<Long, DomainResp> domainRespMap) {
|
||||
Map<Long, DomainResp> domainRespMap) {
|
||||
ModelResp modelResp = convert(modelDO);
|
||||
DomainResp domainResp = domainRespMap.get(modelResp.getDomainId());
|
||||
if (domainResp != null) {
|
||||
|
||||
@@ -2,8 +2,8 @@ package com.tencent.supersonic.semantic.model.domain.utils;
|
||||
|
||||
import static com.tencent.supersonic.common.pojo.Constants.AT_SYMBOL;
|
||||
|
||||
import com.tencent.supersonic.common.pojo.QueryColumn;
|
||||
import com.tencent.supersonic.semantic.api.model.enums.DataTypeEnum;
|
||||
import com.tencent.supersonic.common.pojo.QueryColumn;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.JdbcDataSource;
|
||||
|
||||
@@ -2,58 +2,68 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DatabaseDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DatabaseDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DatabaseDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DatabaseDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DatabaseDO> selectByExampleWithBLOBs(DatabaseDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DatabaseDO> selectByExample(DatabaseDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DatabaseDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DatabaseDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(DatabaseDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DatabaseDO record);
|
||||
|
||||
@@ -2,58 +2,68 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DatasourceDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DatasourceDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DatasourceDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DatasourceDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DatasourceDO> selectByExampleWithBLOBs(DatasourceDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DatasourceDO> selectByExample(DatasourceDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DatasourceDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DatasourceDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(DatasourceDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DatasourceDO record);
|
||||
|
||||
@@ -2,48 +2,56 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DatasourceRelaDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DatasourceRelaDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DatasourceRelaDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DatasourceRelaDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DatasourceRelaDO> selectByExample(DatasourceRelaDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DatasourceRelaDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DatasourceRelaDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DatasourceRelaDO record);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DateInfoDO;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
|
||||
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
@@ -2,58 +2,68 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DimensionDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DimensionDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DimensionDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DimensionDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DimensionDO> selectByExampleWithBLOBs(DimensionDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DimensionDO> selectByExample(DimensionDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DimensionDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DimensionDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(DimensionDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DimensionDO record);
|
||||
|
||||
@@ -2,48 +2,56 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface DomainDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(DomainDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(DomainDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(DomainDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<DomainDO> selectByExample(DomainDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
DomainDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(DomainDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(DomainDO record);
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
|
||||
|
||||
import java.util.List;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
@Mapper
|
||||
|
||||
@@ -2,58 +2,68 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface MetricDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(MetricDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(MetricDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(MetricDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<MetricDO> selectByExampleWithBLOBs(MetricDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<MetricDO> selectByExample(MetricDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
MetricDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(MetricDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(MetricDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(MetricDO record);
|
||||
|
||||
@@ -3,73 +3,86 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@Mapper
|
||||
public interface ModelDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(ModelDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(ModelDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<ModelDO> selectByExampleWithBLOBs(ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<ModelDO> selectByExample(ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
ModelDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExampleSelective(@Param("record") ModelDO record, @Param("example") ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExampleWithBLOBs(@Param("record") ModelDO record, @Param("example") ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByExample(@Param("record") ModelDO record, @Param("example") ModelDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(ModelDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(ModelDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(ModelDO record);
|
||||
|
||||
@@ -2,58 +2,68 @@ package com.tencent.supersonic.semantic.model.infrastructure.mapper;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample;
|
||||
import java.util.List;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface ViewInfoDOMapper {
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
long countByExample(ViewInfoDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int deleteByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insert(ViewInfoDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int insertSelective(ViewInfoDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<ViewInfoDO> selectByExampleWithBLOBs(ViewInfoDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
List<ViewInfoDO> selectByExample(ViewInfoDOExample example);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
ViewInfoDO selectByPrimaryKey(Long id);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeySelective(ViewInfoDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKeyWithBLOBs(ViewInfoDO record);
|
||||
|
||||
/**
|
||||
*
|
||||
* @mbg.generated
|
||||
*/
|
||||
int updateByPrimaryKey(ViewInfoDO record);
|
||||
|
||||
@@ -36,11 +36,13 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<DatabaseDO> getDatabaseByDomainId(Long domainId) {
|
||||
DatabaseDOExample databaseDOExample = new DatabaseDOExample();
|
||||
databaseDOExample.createCriteria().andDomainIdEqualTo(domainId);
|
||||
return databaseDOMapper.selectByExampleWithBLOBs(databaseDOExample);
|
||||
public List<DatabaseDO> getDatabaseList() {
|
||||
return databaseDOMapper.selectByExampleWithBLOBs(new DatabaseDOExample());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteDatabase(Long id) {
|
||||
databaseDOMapper.deleteByPrimaryKey(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,9 @@ import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOE
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.DatasourceRepository;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DatasourceDOMapper;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DatasourceRelaDOMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@@ -20,7 +22,7 @@ public class DatasourceRepositoryImpl implements DatasourceRepository {
|
||||
private DatasourceRelaDOMapper datasourceRelaDOMapper;
|
||||
|
||||
public DatasourceRepositoryImpl(DatasourceDOMapper datasourceMapper,
|
||||
DatasourceRelaDOMapper datasourceRelaDOMapper) {
|
||||
DatasourceRelaDOMapper datasourceRelaDOMapper) {
|
||||
this.datasourceMapper = datasourceMapper;
|
||||
this.datasourceRelaDOMapper = datasourceRelaDOMapper;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@ package com.tencent.supersonic.semantic.model.infrastructure.repository;
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.google.common.base.Stopwatch;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.semantic.api.model.pojo.ItemDateFilter;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DateInfoReq;
|
||||
import com.tencent.supersonic.common.pojo.Constants;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DateInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.DateInfoRepository;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DateInfoMapper;
|
||||
|
||||
@@ -2,11 +2,13 @@ package com.tencent.supersonic.semantic.model.infrastructure.repository;
|
||||
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.DimensionFilter;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.DimensionRepository;
|
||||
import com.tencent.supersonic.semantic.model.domain.pojo.DimensionFilter;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DimensionDOCustomMapper;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DimensionDOMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,7 +22,7 @@ public class DimensionRepositoryImpl implements DimensionRepository {
|
||||
|
||||
|
||||
public DimensionRepositoryImpl(DimensionDOMapper dimensionDOMapper,
|
||||
DimensionDOCustomMapper dimensionDOCustomMapper) {
|
||||
DimensionDOCustomMapper dimensionDOCustomMapper) {
|
||||
this.dimensionDOMapper = dimensionDOMapper;
|
||||
this.dimensionDOCustomMapper = dimensionDOCustomMapper;
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.DomainRepository;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DomainDOMapper;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MetricRepositoryImpl implements MetricRepository {
|
||||
private MetricDOCustomMapper metricDOCustomMapper;
|
||||
|
||||
public MetricRepositoryImpl(MetricDOMapper metricDOMapper,
|
||||
MetricDOCustomMapper metricDOCustomMapper) {
|
||||
MetricDOCustomMapper metricDOCustomMapper) {
|
||||
this.metricDOMapper = metricDOMapper;
|
||||
this.metricDOCustomMapper = metricDOCustomMapper;
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.ModelRepository;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.ModelDOMapper;
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Component
|
||||
public class ModelRepositoryImpl implements ModelRepository {
|
||||
|
||||
|
||||
@@ -4,7 +4,9 @@ import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample;
|
||||
import com.tencent.supersonic.semantic.model.domain.repository.ViewInfoRepository;
|
||||
import com.tencent.supersonic.semantic.model.infrastructure.mapper.ViewInfoDOMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
@Component
|
||||
|
||||
@@ -7,14 +7,16 @@ import com.tencent.supersonic.semantic.api.model.request.SqlExecuteReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DatabaseResp;
|
||||
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.DatabaseService;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/semantic/database")
|
||||
@@ -48,14 +50,25 @@ public class DatabaseController {
|
||||
return databaseService.getDatabase(id);
|
||||
}
|
||||
|
||||
@GetMapping("/getDatabaseByDomainId/{domainId}")
|
||||
public DatabaseResp getDatabaseByDomainId(@PathVariable("domainId") Long domainId) {
|
||||
return databaseService.getDatabaseByDomainId(domainId);
|
||||
@GetMapping("/getDatabaseList")
|
||||
public List<DatabaseResp> getDatabaseList(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
User user = UserHolder.findUser(request, response);
|
||||
return databaseService.getDatabaseList(user);
|
||||
}
|
||||
|
||||
@DeleteMapping("/{id}")
|
||||
public boolean deleteDatabase(@PathVariable("id") Long id) {
|
||||
databaseService.deleteDatabase(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@PostMapping("/executeSql")
|
||||
public QueryResultWithSchemaResp executeSql(@RequestBody SqlExecuteReq sqlExecuteReq) {
|
||||
return databaseService.executeSql(sqlExecuteReq.getSql(), sqlExecuteReq.getModelId());
|
||||
public QueryResultWithSchemaResp executeSql(@RequestBody SqlExecuteReq sqlExecuteReq,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
User user = UserHolder.findUser(request, response);
|
||||
return databaseService.executeSql(sqlExecuteReq.getSql(), sqlExecuteReq.getId(), user);
|
||||
}
|
||||
|
||||
@RequestMapping("/getDbNames/{id}")
|
||||
@@ -69,7 +82,6 @@ public class DatabaseController {
|
||||
return databaseService.getTables(id, db);
|
||||
}
|
||||
|
||||
|
||||
@RequestMapping("/getColumns/{id}/{db}/{table}")
|
||||
public QueryResultWithSchemaResp getColumns(@PathVariable("id") Long id,
|
||||
@PathVariable("db") String db,
|
||||
@@ -77,5 +89,4 @@ public class DatabaseController {
|
||||
return databaseService.getColumns(id, db, table);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -6,11 +6,13 @@ import com.tencent.supersonic.semantic.api.model.request.DomainReq;
|
||||
import com.tencent.supersonic.semantic.api.model.request.DomainUpdateReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
|
||||
import com.tencent.supersonic.semantic.model.domain.DomainService;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
@@ -32,8 +34,8 @@ public class DomainController {
|
||||
|
||||
@PostMapping("/createDomain")
|
||||
public Boolean createDomain(@RequestBody DomainReq domainReq,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
User user = UserHolder.findUser(request, response);
|
||||
domainService.createDomain(domainReq, user);
|
||||
return true;
|
||||
@@ -41,8 +43,8 @@ public class DomainController {
|
||||
|
||||
@PostMapping("/updateDomain")
|
||||
public Boolean updateDomain(@RequestBody DomainUpdateReq domainUpdateReq,
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
User user = UserHolder.findUser(request, response);
|
||||
domainService.updateDomain(domainUpdateReq, user);
|
||||
return true;
|
||||
@@ -56,7 +58,7 @@ public class DomainController {
|
||||
|
||||
@GetMapping("/getDomainList")
|
||||
public List<DomainResp> getDomainList(HttpServletRequest request,
|
||||
HttpServletResponse response) {
|
||||
HttpServletResponse response) {
|
||||
User user = UserHolder.findUser(request, response);
|
||||
return domainService.getDomainListWithAdminAuth(user);
|
||||
}
|
||||
|
||||
@@ -5,8 +5,9 @@ import com.tencent.supersonic.auth.api.authentication.pojo.User;
|
||||
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
|
||||
import com.tencent.supersonic.semantic.api.model.request.ViewInfoReq;
|
||||
import com.tencent.supersonic.semantic.api.model.response.ModelSchemaRelaResp;
|
||||
import com.tencent.supersonic.semantic.model.application.ViewInfoServiceImpl;
|
||||
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
|
||||
import com.tencent.supersonic.semantic.model.application.ViewInfoServiceImpl;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
@@ -1,272 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.DatabaseDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="version" jdbcType="VARCHAR" property="version"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="version" jdbcType="VARCHAR" property="version" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin" />
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, domain_id, name, description, version, type, created_at, created_by, updated_at,
|
||||
updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</trim>
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database (id, domain_id, name,
|
||||
description, version, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, config)
|
||||
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR}, #{version,jdbcType=VARCHAR},
|
||||
#{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
#{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
<set>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, description, version, type, created_at, created_by, updated_at, updated_by,
|
||||
admin, viewer
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database (id, name, description,
|
||||
version, type, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
admin, viewer, config
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{version,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
||||
#{admin,jdbcType=VARCHAR}, #{viewer,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
#{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
viewer = #{viewer,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,272 +1,252 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.DatasourceDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="database_id" jdbcType="BIGINT" property="databaseId"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
<result column="datasource_detail" jdbcType="LONGVARCHAR" property="datasourceDetail"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="database_id" jdbcType="BIGINT" property="databaseId" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
<result column="datasource_detail" jdbcType="LONGVARCHAR" property="datasourceDetail" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, model_id, name, biz_name, description, database_id, created_at, created_by, updated_at,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, name, biz_name, description, database_id, created_at, created_by, updated_at,
|
||||
updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
datasource_detail
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource (id, model_id, name,
|
||||
biz_name, description, database_id,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, datasource_detail)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{databaseId,jdbcType=BIGINT},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{datasourceDetail,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
database_id,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
#{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
#{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
datasource_detail
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource (id, model_id, name,
|
||||
biz_name, description, database_id,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, datasource_detail)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{databaseId,jdbcType=BIGINT},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{datasourceDetail,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
database_id,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
#{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
#{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="databaseId != null">
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,209 +1,194 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.DatasourceRelaDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
||||
<result column="datasource_from" jdbcType="BIGINT" property="datasourceFrom"/>
|
||||
<result column="datasource_to" jdbcType="BIGINT" property="datasourceTo"/>
|
||||
<result column="join_key" jdbcType="VARCHAR" property="joinKey"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId" />
|
||||
<result column="datasource_from" jdbcType="BIGINT" property="datasourceFrom" />
|
||||
<result column="datasource_to" jdbcType="BIGINT" property="datasourceTo" />
|
||||
<result column="join_key" jdbcType="VARCHAR" property="joinKey" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, model_id, datasource_from, datasource_to, join_key, created_at, created_by, updated_at,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, datasource_from, datasource_to, join_key, created_at, created_by, updated_at,
|
||||
updated_by
|
||||
</sql>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela (id, model_id, datasource_from,
|
||||
datasource_to, join_key, created_at,
|
||||
created_by, updated_at, updated_by)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT},
|
||||
#{datasourceFrom,jdbcType=BIGINT},
|
||||
#{datasourceTo,jdbcType=BIGINT}, #{joinKey,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from,
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to,
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
#{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
#{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
#{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela (id, model_id, datasource_from,
|
||||
datasource_to, join_key, created_at,
|
||||
created_by, updated_at, updated_by
|
||||
)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{datasourceFrom,jdbcType=BIGINT},
|
||||
#{datasourceTo,jdbcType=BIGINT}, #{joinKey,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR}
|
||||
)
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from,
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to,
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
#{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
#{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
#{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,378 +1,354 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.DimensionDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
||||
<result column="datasource_id" jdbcType="BIGINT" property="datasourceId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="semantic_type" jdbcType="VARCHAR" property="semanticType"/>
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias"/>
|
||||
<result column="default_values" jdbcType="VARCHAR" property="defaultValues"/>
|
||||
<result column="dim_value_maps" jdbcType="VARCHAR" property="dimValueMaps"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
<result column="type_params" jdbcType="LONGVARCHAR" property="typeParams"/>
|
||||
<result column="expr" jdbcType="LONGVARCHAR" property="expr"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId" />
|
||||
<result column="datasource_id" jdbcType="BIGINT" property="datasourceId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="semantic_type" jdbcType="VARCHAR" property="semanticType" />
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias" />
|
||||
<result column="default_values" jdbcType="VARCHAR" property="defaultValues" />
|
||||
<result column="dim_value_maps" jdbcType="VARCHAR" property="dimValueMaps" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
<result column="type_params" jdbcType="LONGVARCHAR" property="typeParams" />
|
||||
<result column="expr" jdbcType="LONGVARCHAR" property="expr" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, model_id, datasource_id, name, biz_name, description, status, sensitive_level,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, datasource_id, name, biz_name, description, status, sensitive_level,
|
||||
type, created_at, created_by, updated_at, updated_by, semantic_type, alias, default_values,
|
||||
dim_value_maps
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
type_params
|
||||
, expr
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_dimension
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_dimension
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
insert into s2_dimension (id, model_id, datasource_id,
|
||||
name, biz_name, description,
|
||||
status, sensitive_level, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, semantic_type, alias,
|
||||
default_values, dim_value_maps, type_params,
|
||||
expr)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{datasourceId,jdbcType=BIGINT},
|
||||
#{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=INTEGER}, #{sensitiveLevel,jdbcType=INTEGER},
|
||||
#{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{semanticType,jdbcType=VARCHAR},
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
#{defaultValues,jdbcType=VARCHAR}, #{dimValueMaps,jdbcType=VARCHAR},
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
#{expr,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
insert into s2_dimension
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
datasource_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
semantic_type,
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias,
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
default_values,
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
dim_value_maps,
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params,
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
expr,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
#{datasourceId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
#{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
#{semanticType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
#{defaultValues,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
#{dimValueMaps,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
#{expr,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
expr = #{expr,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR},
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
expr = #{expr,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
type_params, expr
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_dimension
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_dimension
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
insert into s2_dimension (id, model_id, datasource_id,
|
||||
name, biz_name, description,
|
||||
status, sensitive_level, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, semantic_type, alias,
|
||||
default_values, dim_value_maps, type_params,
|
||||
expr)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{datasourceId,jdbcType=BIGINT},
|
||||
#{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=INTEGER}, #{sensitiveLevel,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{semanticType,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR},
|
||||
#{defaultValues,jdbcType=VARCHAR}, #{dimValueMaps,jdbcType=VARCHAR}, #{typeParams,jdbcType=LONGVARCHAR},
|
||||
#{expr,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
insert into s2_dimension
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
datasource_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
semantic_type,
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias,
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
default_values,
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
dim_value_maps,
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params,
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
expr,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
#{datasourceId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
#{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
#{semanticType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
#{defaultValues,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
#{dimValueMaps,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
#{expr,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_dimension
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceId != null">
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="semanticType != null">
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="defaultValues != null">
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dimValueMaps != null">
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
<if test="expr != null">
|
||||
expr = #{expr,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR},
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
expr = #{expr,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
update s2_dimension
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
datasource_id = #{datasourceId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
semantic_type = #{semanticType,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
default_values = #{defaultValues,jdbcType=VARCHAR},
|
||||
dim_value_maps = #{dimValueMaps,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,267 +1,251 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.DomainDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin"/>
|
||||
<result column="admin_org" jdbcType="VARCHAR" property="adminOrg"/>
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen"/>
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer"/>
|
||||
<result column="view_org" jdbcType="VARCHAR" property="viewOrg"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin" />
|
||||
<result column="admin_org" jdbcType="VARCHAR" property="adminOrg" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer" />
|
||||
<result column="view_org" jdbcType="VARCHAR" property="viewOrg" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, name, biz_name, parent_id, status, created_at, created_by, updated_at, updated_by,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, biz_name, parent_id, status, created_at, created_by, updated_at, updated_by,
|
||||
admin, admin_org, is_open, viewer, view_org
|
||||
</sql>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain (id, name, biz_name,
|
||||
parent_id, status, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
admin, admin_org, is_open,
|
||||
viewer, view_org)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{parentId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER},
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
#{admin,jdbcType=VARCHAR}, #{adminOrg,jdbcType=VARCHAR}, #{isOpen,jdbcType=INTEGER},
|
||||
#{viewer,jdbcType=VARCHAR}, #{viewOrg,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org,
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
#{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
#{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</sql>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain (id, name, biz_name,
|
||||
parent_id, status, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
admin, admin_org, is_open,
|
||||
viewer, view_org)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{parentId,jdbcType=BIGINT}, #{status,jdbcType=INTEGER}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
||||
#{admin,jdbcType=VARCHAR}, #{adminOrg,jdbcType=VARCHAR}, #{isOpen,jdbcType=INTEGER},
|
||||
#{viewer,jdbcType=VARCHAR}, #{viewOrg,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org,
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
#{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
#{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
#{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,338 +1,316 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.MetricDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="data_format_type" jdbcType="VARCHAR" property="dataFormatType"/>
|
||||
<result column="data_format" jdbcType="VARCHAR" property="dataFormat"/>
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
<result column="type_params" jdbcType="LONGVARCHAR" property="typeParams"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="description" jdbcType="VARCHAR" property="description" />
|
||||
<result column="status" jdbcType="INTEGER" property="status" />
|
||||
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="data_format_type" jdbcType="VARCHAR" property="dataFormatType" />
|
||||
<result column="data_format" jdbcType="VARCHAR" property="dataFormat" />
|
||||
<result column="alias" jdbcType="VARCHAR" property="alias" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
<result column="type_params" jdbcType="LONGVARCHAR" property="typeParams" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, model_id, name, biz_name, description, status, sensitive_level, type, created_at,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, name, biz_name, description, status, sensitive_level, type, created_at,
|
||||
created_by, updated_at, updated_by, data_format_type, data_format, alias
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
type_params
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_metric
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_metric
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
insert into s2_metric (id, model_id, name,
|
||||
biz_name, description, status,
|
||||
sensitive_level, type, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
data_format_type, data_format, alias,
|
||||
type_params)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{status,jdbcType=INTEGER},
|
||||
#{sensitiveLevel,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
#{dataFormatType,jdbcType=VARCHAR}, #{dataFormat,jdbcType=VARCHAR},
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
#{typeParams,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
insert into s2_metric
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
data_format_type,
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
data_format,
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias,
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
#{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
#{dataFormatType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
#{dataFormat,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
type_params
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_metric
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_metric
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
insert into s2_metric (id, model_id, name,
|
||||
biz_name, description, status,
|
||||
sensitive_level, type, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
data_format_type, data_format, alias,
|
||||
type_params)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER},
|
||||
#{sensitiveLevel,jdbcType=INTEGER}, #{type,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
||||
#{dataFormatType,jdbcType=VARCHAR}, #{dataFormat,jdbcType=VARCHAR}, #{alias,jdbcType=VARCHAR},
|
||||
#{typeParams,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
insert into s2_metric
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
data_format_type,
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
data_format,
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias,
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
#{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
#{dataFormatType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
#{dataFormat,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
#{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
#{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_metric
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormatType != null">
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="dataFormat != null">
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="alias != null">
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="typeParams != null">
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR},
|
||||
type_params = #{typeParams,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
|
||||
update s2_metric
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
sensitive_level = #{sensitiveLevel,jdbcType=INTEGER},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
data_format_type = #{dataFormatType,jdbcType=VARCHAR},
|
||||
data_format = #{dataFormat,jdbcType=VARCHAR},
|
||||
alias = #{alias,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,430 +1,408 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.ModelDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer"/>
|
||||
<result column="view_org" jdbcType="VARCHAR" property="viewOrg"/>
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin"/>
|
||||
<result column="admin_org" jdbcType="VARCHAR" property="adminOrg"/>
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
<result column="entity" jdbcType="LONGVARCHAR" property="entity"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="name" jdbcType="VARCHAR" property="name" />
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
|
||||
<result column="domain_id" jdbcType="BIGINT" property="domainId" />
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer" />
|
||||
<result column="view_org" jdbcType="VARCHAR" property="viewOrg" />
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin" />
|
||||
<result column="admin_org" jdbcType="VARCHAR" property="adminOrg" />
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
<result column="entity" jdbcType="LONGVARCHAR" property="entity" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Update_By_Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="example.oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, name, biz_name, domain_id, viewer, view_org, admin, admin_org, is_open, created_by,
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, name, biz_name, domain_id, viewer, view_org, admin, admin_org, is_open, created_by,
|
||||
created_at, updated_by, updated_at
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
entity
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_model
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_model
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
insert into s2_model (id, name, biz_name,
|
||||
domain_id, viewer, view_org,
|
||||
admin, admin_org, is_open,
|
||||
created_by, created_at, updated_by,
|
||||
updated_at, entity)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{domainId,jdbcType=BIGINT}, #{viewer,jdbcType=VARCHAR},
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
#{admin,jdbcType=VARCHAR}, #{adminOrg,jdbcType=VARCHAR}, #{isOpen,jdbcType=INTEGER},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP}, #{entity,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
insert into s2_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org,
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
#{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
#{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
#{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update s2_model
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.bizName != null">
|
||||
biz_name = #{record.bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.domainId != null">
|
||||
domain_id = #{record.domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.viewer != null">
|
||||
viewer = #{record.viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.viewOrg != null">
|
||||
view_org = #{record.viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.admin != null">
|
||||
admin = #{record.admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.adminOrg != null">
|
||||
admin_org = #{record.adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isOpen != null">
|
||||
is_open = #{record.isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.createdBy != null">
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createdAt != null">
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updatedBy != null">
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updatedAt != null">
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.entity != null">
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update s2_model
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
entity
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_model
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_model
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
insert into s2_model (id, name, biz_name,
|
||||
domain_id, viewer, view_org,
|
||||
admin, admin_org, is_open,
|
||||
created_by, created_at, updated_by,
|
||||
updated_at, entity)
|
||||
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{bizName,jdbcType=VARCHAR},
|
||||
#{domainId,jdbcType=BIGINT}, #{viewer,jdbcType=VARCHAR}, #{viewOrg,jdbcType=VARCHAR},
|
||||
#{admin,jdbcType=VARCHAR}, #{adminOrg,jdbcType=VARCHAR}, #{isOpen,jdbcType=INTEGER},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{createdAt,jdbcType=TIMESTAMP}, #{updatedBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP}, #{entity,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
insert into s2_model
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org,
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
#{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
#{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
#{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
#{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_model
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByExampleSelective" parameterType="map">
|
||||
update s2_model
|
||||
<set>
|
||||
<if test="record.id != null">
|
||||
id = #{record.id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.name != null">
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.bizName != null">
|
||||
biz_name = #{record.bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.domainId != null">
|
||||
domain_id = #{record.domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="record.viewer != null">
|
||||
viewer = #{record.viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.viewOrg != null">
|
||||
view_org = #{record.viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.admin != null">
|
||||
admin = #{record.admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.adminOrg != null">
|
||||
admin_org = #{record.adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.isOpen != null">
|
||||
is_open = #{record.isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="record.createdBy != null">
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.createdAt != null">
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="record.updatedBy != null">
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="record.updatedAt != null">
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update s2_model
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
biz_name = #{record.bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{record.domainId,jdbcType=BIGINT},
|
||||
viewer = #{record.viewer,jdbcType=VARCHAR},
|
||||
view_org = #{record.viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{record.admin,jdbcType=VARCHAR},
|
||||
admin_org = #{record.adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{record.isOpen,jdbcType=INTEGER},
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause"/>
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity = #{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
entity = #{entity,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</if>
|
||||
<if test="record.entity != null">
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExampleWithBLOBs" parameterType="map">
|
||||
update s2_model
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
biz_name = #{record.bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{record.domainId,jdbcType=BIGINT},
|
||||
viewer = #{record.viewer,jdbcType=VARCHAR},
|
||||
view_org = #{record.viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{record.admin,jdbcType=VARCHAR},
|
||||
admin_org = #{record.adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{record.isOpen,jdbcType=INTEGER},
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP},
|
||||
entity = #{record.entity,jdbcType=LONGVARCHAR}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByExample" parameterType="map">
|
||||
update s2_model
|
||||
set id = #{record.id,jdbcType=BIGINT},
|
||||
name = #{record.name,jdbcType=VARCHAR},
|
||||
biz_name = #{record.bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{record.domainId,jdbcType=BIGINT},
|
||||
viewer = #{record.viewer,jdbcType=VARCHAR},
|
||||
view_org = #{record.viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{record.admin,jdbcType=VARCHAR},
|
||||
admin_org = #{record.adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{record.isOpen,jdbcType=INTEGER},
|
||||
created_by = #{record.createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{record.createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{record.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{record.updatedAt,jdbcType=TIMESTAMP}
|
||||
<if test="_parameter != null">
|
||||
<include refid="Update_By_Example_Where_Clause" />
|
||||
</if>
|
||||
</update>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity = #{entity,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
entity = #{entity,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO">
|
||||
update s2_model
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -1,232 +1,213 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.tencent.supersonic.semantic.model.infrastructure.mapper.ViewInfoDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id" />
|
||||
<result column="model_id" jdbcType="BIGINT" property="modelId" />
|
||||
<result column="type" jdbcType="VARCHAR" property="type" />
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config" />
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, model_id, type, created_at, created_by, updated_at, updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</trim>
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info (id, model_id, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, config)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id, model_id, type, created_at, created_by, updated_at, updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample" resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List" />
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List" />
|
||||
,
|
||||
<include refid="Blob_Column_List" />
|
||||
from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info (id, model_id, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, config)
|
||||
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
model_id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="modelId != null">
|
||||
#{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample" resultType="java.lang.Long">
|
||||
select count(*) from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause" />
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
<set>
|
||||
<if test="modelId != null">
|
||||
model_id = #{modelId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey" parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set model_id = #{modelId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -20,7 +20,7 @@
|
||||
<insert id="upsertDateInfo">
|
||||
insert into s2_available_date_info
|
||||
(`type`, item_id, date_format, start_date, end_date, unavailable_date, created_by,
|
||||
updated_by, date_period)
|
||||
updated_by,date_period)
|
||||
values (#{type}, #{itemId}, #{dateFormat}, #{startDate}, #{endDate}, #{unavailableDateList},
|
||||
#{createdBy}, #{updatedBy}, #{datePeriod}) ON DUPLICATE KEY
|
||||
UPDATE
|
||||
@@ -44,7 +44,7 @@
|
||||
<if test="itemIds != null and itemIds.size >0">
|
||||
and item_id in
|
||||
<foreach collection="itemIds" index="index" item="item" open="(" close=")"
|
||||
separator=",">
|
||||
separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
@@ -98,9 +98,9 @@
|
||||
</update>
|
||||
|
||||
<select id="query" resultMap="ResultMapWithBLOBs">
|
||||
select *
|
||||
from s2_metric
|
||||
where 1=1
|
||||
select *
|
||||
from s2_metric
|
||||
where 1=1
|
||||
<if test="type != null and type != ''">
|
||||
and type = #{type}
|
||||
</if>
|
||||
@@ -125,7 +125,7 @@
|
||||
<if test="modelIds != null and modelIds.size >0">
|
||||
and model_id in
|
||||
<foreach collection="modelIds" index="index" item="model" open="(" close=")"
|
||||
separator=",">
|
||||
separator=",">
|
||||
#{model}
|
||||
</foreach>
|
||||
</if>
|
||||
|
||||
@@ -4,7 +4,7 @@ CREATE TABLE `s2_database`
|
||||
`domain_id` bigint(20) NOT NULL COMMENT '主题域ID',
|
||||
`name` varchar(255) NOT NULL COMMENT '名称',
|
||||
`description` varchar(500) DEFAULT NULL COMMENT '描述',
|
||||
`version` varchar(64) DEFAULT NULL COMMENT '版本',
|
||||
`version` varchar(64) DEFAULT NULL COMMENT '版本',
|
||||
`type` varchar(20) NOT NULL COMMENT '类型 mysql,clickhouse,tdw',
|
||||
`config` text NOT NULL COMMENT '配置信息',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
|
||||
Reference in New Issue
Block a user