[improvement][project] supersonic 0.7.2 version backend update (#28)

Co-authored-by: jipengli <jipengli@tencent.com>
This commit is contained in:
jipeli
2023-08-15 08:56:18 +08:00
committed by GitHub
parent 27283001a8
commit b1952d64ab
461 changed files with 18548 additions and 11939 deletions

View File

@@ -17,7 +17,6 @@
</properties>
<dependencies>
<dependency>
<groupId>org.projectlombok</groupId>
@@ -75,7 +74,6 @@
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>

View File

@@ -1,19 +1,20 @@
package com.tencent.supersonic.semantic.model.application;
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.response.ModelResp;
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.Catalog;
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
import com.tencent.supersonic.semantic.model.domain.DimensionService;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.MetricService;
import com.tencent.supersonic.semantic.model.domain.ModelService;
import com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO;
import com.tencent.supersonic.semantic.model.domain.repository.DatabaseRepository;
import com.tencent.supersonic.semantic.model.domain.utils.DatabaseConverter;
@@ -29,17 +30,17 @@ import org.springframework.stereotype.Component;
public class CatalogImpl implements Catalog {
private final DatabaseRepository databaseRepository;
private final DomainService domainService;
private final ModelService modelService;
private final DimensionService dimensionService;
private final DatasourceService datasourceService;
private final MetricService metricService;
public CatalogImpl(DatabaseRepository databaseRepository,
DomainService domainService, DimensionService dimensionService,
ModelService modelService, DimensionService dimensionService,
DatasourceService datasourceService,
MetricService metricService) {
this.databaseRepository = databaseRepository;
this.domainService = domainService;
this.modelService = modelService;
this.dimensionService = dimensionService;
this.datasourceService = datasourceService;
this.metricService = metricService;
@@ -50,47 +51,51 @@ public class CatalogImpl implements Catalog {
return DatabaseConverter.convert(databaseDO);
}
public DatabaseResp getDatabaseByDomainId(Long domainId) {
List<DatabaseDO> databaseDOS = databaseRepository.getDatabaseByDomainId(domainId);
public DatabaseResp getDatabaseByModelId(Long modelId) {
List<DatabaseDO> databaseDOS = databaseRepository.getDatabaseByDomainId(modelId);
Optional<DatabaseDO> databaseDO = databaseDOS.stream().findFirst();
return databaseDO.map(DatabaseConverter::convert).orElse(null);
}
@Override
public String getDomainFullPath(Long domainId) {
return domainService.getDomainFullPath(domainId);
public String getModelFullPath(Long modelId) {
ModelResp modelResp = modelService.getModelMap().get(modelId);
if (modelResp != null) {
return modelResp.getFullPath();
}
return "";
}
@Override
public Map<Long, String> getDomainFullPath() {
return domainService.getDomainFullPath();
public Map<Long, String> getModelFullPath() {
return modelService.getModelFullPathMap();
}
@Override
public DimensionResp getDimension(String bizName, Long domainId) {
return dimensionService.getDimension(bizName, domainId);
public DimensionResp getDimension(String bizName, Long modelId) {
return dimensionService.getDimension(bizName, modelId);
}
@Override
public void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
public void getModelYamlTplByMoldelIds(Set<Long> modelIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList) {
datasourceService.getModelYamlTplByDomainIds(domainIds, dimensionYamlMap, datasourceYamlTplList,
datasourceService.getModelYamlTplByModelIds(modelIds, dimensionYamlMap, datasourceYamlTplList,
metricYamlTplList);
}
@Override
public List<DimensionResp> getDimensions(Long domainId) {
return dimensionService.getDimensions(domainId);
public List<DimensionResp> getDimensions(Long modelId) {
return dimensionService.getDimensions(modelId);
}
@Override
public List<DatasourceResp> getDatasourceList(Long domainId) {
return datasourceService.getDatasourceList(domainId);
public List<DatasourceResp> getDatasourceList(Long modelId) {
return datasourceService.getDatasourceList(modelId);
}
@Override
public List<MetricResp> getMetrics(Long domainId) {
return metricService.getMetrics(domainId);
public List<MetricResp> getMetrics(Long modelId) {
return metricService.getMetrics(modelId);
}
@Override

View File

@@ -3,19 +3,23 @@ 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.DatabaseResp;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.api.model.response.QueryResultWithSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.SqlParserResp;
import com.tencent.supersonic.semantic.model.domain.DatabaseService;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.ModelService;
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;
import com.tencent.supersonic.semantic.model.domain.pojo.Database;
import com.tencent.supersonic.semantic.model.domain.repository.DatabaseRepository;
import com.tencent.supersonic.semantic.model.domain.utils.DatabaseConverter;
import com.tencent.supersonic.semantic.model.domain.utils.JdbcDataSourceUtils;
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 lombok.extern.slf4j.Slf4j;
import org.apache.logging.log4j.util.Strings;
@@ -29,9 +33,18 @@ public class DatabaseServiceImpl implements DatabaseService {
private final SqlUtils sqlUtils;
private DatabaseRepository databaseRepository;
public DatabaseServiceImpl(DatabaseRepository databaseRepository, SqlUtils sqlUtils) {
private DomainService domainService;
private ModelService modelService;
public DatabaseServiceImpl(DatabaseRepository databaseRepository,
SqlUtils sqlUtils,
DomainService domainService,
ModelService modelService) {
this.databaseRepository = databaseRepository;
this.sqlUtils = sqlUtils;
this.modelService = modelService;
this.domainService = domainService;
}
@Override
@@ -61,16 +74,36 @@ public class DatabaseServiceImpl implements DatabaseService {
return DatabaseConverter.convert(databaseDO);
}
@Override
// 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 QueryResultWithSchemaResp executeSql(String sql, Long domainId) {
DatabaseResp databaseResp = getDatabaseByDomainId(domainId);
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);
if (databaseResp == null) {
return new QueryResultWithSchemaResp();
}
return executeSql(sql, databaseResp);
}

View File

@@ -8,9 +8,6 @@ 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;
@@ -23,6 +20,9 @@ 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;
@@ -88,7 +88,7 @@ public class DatasourceServiceImpl implements DatasourceService {
Datasource datasource = DatasourceConverter.convert(datasourceReq);
log.info("[create datasource] object:{}", JSONObject.toJSONString(datasource));
saveDatasource(datasource, user);
Optional<DatasourceResp> datasourceDescOptional = getDatasource(datasourceReq.getDomainId(),
Optional<DatasourceResp> datasourceDescOptional = getDatasource(datasourceReq.getModelId(),
datasourceReq.getBizName());
if (!datasourceDescOptional.isPresent()) {
throw new RuntimeException("create datasource failed");
@@ -122,24 +122,8 @@ public class DatasourceServiceImpl implements DatasourceService {
}
@Override
public String getSourceBizNameById(Long id) {
DatasourceDO datasourceDO = getDatasourceById(id);
if (datasourceDO == null) {
String message = String.format("datasource with id:%s not exsit", id);
throw new RuntimeException(message);
}
return datasourceDO.getBizName();
}
private DatasourceDO getDatasourceById(Long id) {
return datasourceRepository.getDatasourceById(id);
}
@Override
public List<MeasureResp> getMeasureListOfDomain(Long domainId) {
List<DatasourceResp> datasourceDescs = getDatasourceList(domainId);
public List<MeasureResp> getMeasureListOfModel(Long modelId) {
List<DatasourceResp> datasourceDescs = getDatasourceList(modelId);
List<MeasureResp> measureDescs = Lists.newArrayList();
if (!CollectionUtils.isEmpty(datasourceDescs)) {
for (DatasourceResp datasourceDesc : datasourceDescs) {
@@ -167,8 +151,8 @@ public class DatasourceServiceImpl implements DatasourceService {
}
private Optional<DatasourceResp> getDatasource(Long domainId, String bizName) {
List<DatasourceResp> datasourceDescs = getDatasourceList(domainId);
private Optional<DatasourceResp> getDatasource(Long modelId, String bizName) {
List<DatasourceResp> datasourceDescs = getDatasourceList(modelId);
if (CollectionUtils.isEmpty(datasourceDescs)) {
return Optional.empty();
}
@@ -197,8 +181,8 @@ public class DatasourceServiceImpl implements DatasourceService {
}
@Override
public List<DatasourceResp> getDatasourceList(Long domainId) {
return DatasourceConverter.convertList(datasourceRepository.getDatasourceList(domainId));
public List<DatasourceResp> getDatasourceList(Long modelId) {
return DatasourceConverter.convertList(datasourceRepository.getDatasourceList(modelId));
}
@Override
@@ -207,8 +191,8 @@ public class DatasourceServiceImpl implements DatasourceService {
}
@Override
public List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long domainId) {
List<DatasourceResp> datasourceResps = getDatasourceList(domainId);
public List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long modelId) {
List<DatasourceResp> datasourceResps = getDatasourceList(modelId);
for (DatasourceResp datasourceResp : datasourceResps) {
if (!CollectionUtils.isEmpty(datasourceResp.getDatasourceDetail().getMeasures())) {
for (Measure measure : datasourceResp.getDatasourceDetail().getMeasures()) {
@@ -237,17 +221,17 @@ public class DatasourceServiceImpl implements DatasourceService {
@Override
public void deleteDatasource(Long id) throws Exception {
public void deleteDatasource(Long id) {
DatasourceDO datasourceDO = datasourceRepository.getDatasourceById(id);
if (datasourceDO == null) {
return;
}
checkDelete(datasourceDO.getDomainId(), id);
checkDelete(datasourceDO.getModelId(), id);
datasourceRepository.deleteDatasource(id);
}
private void checkDelete(Long domainId, Long datasourceId) {
List<MetricResp> metricResps = metricService.getMetrics(domainId, datasourceId);
private void checkDelete(Long modelId, Long datasourceId) {
List<MetricResp> metricResps = metricService.getMetrics(modelId, datasourceId);
List<DimensionResp> dimensionResps = dimensionService.getDimensionsByDatasource(datasourceId);
if (!CollectionUtils.isEmpty(metricResps) || !CollectionUtils.isEmpty(dimensionResps)) {
throw new RuntimeException("exist dimension or metric on this datasource, please check");
@@ -261,8 +245,6 @@ public class DatasourceServiceImpl implements DatasourceService {
return datasourceRelaResps;
}
return datasourceRelaDOS.stream().map(DatasourceConverter::convert).collect(Collectors.toList());
}
@@ -289,8 +271,8 @@ public class DatasourceServiceImpl implements DatasourceService {
}
@Override
public List<DatasourceRelaResp> getDatasourceRelaList(Long domainId) {
return convertDatasourceRelaList(datasourceRepository.getDatasourceRelaList(domainId));
public List<DatasourceRelaResp> getDatasourceRelaList(Long modelId) {
return convertDatasourceRelaList(datasourceRepository.getDatasourceRelaList(modelId));
}
@@ -358,14 +340,14 @@ public class DatasourceServiceImpl implements DatasourceService {
}
@Override
public void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
public void getModelYamlTplByModelIds(Set<Long> modelIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList) {
for (Long domainId : domainIds) {
List<DatasourceResp> datasourceResps = getDatasourceList(domainId);
List<MetricResp> metricResps = metricService.getMetrics(domainId);
for (Long modelId : modelIds) {
List<DatasourceResp> datasourceResps = getDatasourceList(modelId);
List<MetricResp> metricResps = metricService.getMetrics(modelId);
metricYamlTplList.addAll(MetricYamlManager.convert2YamlObj(MetricConverter.metricInfo2Metric(metricResps)));
DatabaseResp databaseResp = databaseService.getDatabaseByDomainId(domainId);
List<DimensionResp> dimensionResps = dimensionService.getDimensions(domainId);
DatabaseResp databaseResp = databaseService.getDatabaseByModelId(modelId);
List<DimensionResp> dimensionResps = dimensionService.getDimensions(modelId);
for (DatasourceResp datasourceResp : datasourceResps) {
datasourceYamlTplList.add(DatasourceYamlManager.convert2YamlObj(
DatasourceConverter.datasourceInfo2Datasource(datasourceResp), databaseResp));

View File

@@ -5,19 +5,19 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.common.pojo.enums.SensitiveLevelEnum;
import com.tencent.supersonic.semantic.api.model.request.DimensionReq;
import com.tencent.supersonic.semantic.api.model.request.PageDimensionReq;
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
import com.tencent.supersonic.common.pojo.enums.SensitiveLevelEnum;
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
import com.tencent.supersonic.semantic.model.domain.repository.DimensionRepository;
import com.tencent.supersonic.semantic.model.domain.utils.DimensionConverter;
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
import com.tencent.supersonic.semantic.model.domain.DimensionService;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Dimension;
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.utils.DimensionConverter;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@@ -63,8 +63,8 @@ public class DimensionServiceImpl implements DimensionService {
if (CollectionUtils.isEmpty(dimensionReqs)) {
return;
}
Long domainId = dimensionReqs.get(0).getDomainId();
List<DimensionResp> dimensionResps = getDimensions(domainId);
Long modelId = dimensionReqs.get(0).getModelId();
List<DimensionResp> dimensionResps = getDimensions(modelId);
Map<String, DimensionResp> dimensionRespMap = dimensionResps.stream()
.collect(Collectors.toMap(DimensionResp::getBizName, a -> a, (k1, k2) -> k1));
List<Dimension> dimensions = dimensionReqs.stream().map(DimensionConverter::convert)
@@ -92,8 +92,8 @@ public class DimensionServiceImpl implements DimensionService {
@Override
public DimensionResp getDimension(String bizName, Long domainId) {
List<DimensionResp> dimensionResps = getDimensions(domainId);
public DimensionResp getDimension(String bizName, Long modelId) {
List<DimensionResp> dimensionResps = getDimensions(modelId);
if (CollectionUtils.isEmpty(dimensionResps)) {
return null;
}
@@ -109,7 +109,7 @@ public class DimensionServiceImpl implements DimensionService {
public PageInfo<DimensionResp> queryDimension(PageDimensionReq pageDimensionReq) {
DimensionFilter dimensionFilter = new DimensionFilter();
BeanUtils.copyProperties(pageDimensionReq, dimensionFilter);
dimensionFilter.setDomainIds(pageDimensionReq.getDomainIds());
dimensionFilter.setModelIds(pageDimensionReq.getModelIds());
PageInfo<DimensionDO> dimensionDOPageInfo = PageHelper.startPage(pageDimensionReq.getCurrent(),
pageDimensionReq.getPageSize())
.doSelectPageInfo(() -> queryDimension(dimensionFilter));
@@ -139,8 +139,8 @@ public class DimensionServiceImpl implements DimensionService {
}
@Override
public List<DimensionResp> getDimensions(Long domainId) {
return convertList(getDimensionDOS(domainId), datasourceService.getDatasourceMap());
public List<DimensionResp> getDimensions(Long modelId) {
return convertList(getDimensionDOS(modelId), datasourceService.getDatasourceMap());
}
@Override
@@ -176,8 +176,8 @@ public class DimensionServiceImpl implements DimensionService {
@Override
public List<DimensionResp> getHighSensitiveDimension(Long domainId) {
List<DimensionResp> dimensionResps = getDimensions(domainId);
public List<DimensionResp> getHighSensitiveDimension(Long modelId) {
List<DimensionResp> dimensionResps = getDimensions(modelId);
if (CollectionUtils.isEmpty(dimensionResps)) {
return dimensionResps;
}
@@ -187,8 +187,8 @@ public class DimensionServiceImpl implements DimensionService {
}
protected List<DimensionDO> getDimensionDOS(Long domainId) {
return dimensionRepository.getDimensionListOfDomain(domainId);
protected List<DimensionDO> getDimensionDOS(Long modelId) {
return dimensionRepository.getDimensionListOfDomain(modelId);
}
protected List<DimensionDO> getDimensionDOS() {
@@ -240,8 +240,8 @@ public class DimensionServiceImpl implements DimensionService {
private void checkExist(List<DimensionReq> dimensionReqs) {
Long domainId = dimensionReqs.get(0).getDomainId();
List<DimensionResp> dimensionResps = getDimensions(domainId);
Long modelId = dimensionReqs.get(0).getModelId();
List<DimensionResp> dimensionResps = getDimensions(modelId);
for (DimensionReq dimensionReq : dimensionReqs) {
for (DimensionResp dimensionResp : dimensionResps) {
if (dimensionResp.getName().equalsIgnoreCase(dimensionReq.getBizName())) {

View File

@@ -2,35 +2,33 @@ package com.tencent.supersonic.semantic.model.application;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.google.common.collect.Sets;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.service.UserService;
import com.tencent.supersonic.common.pojo.enums.AuthType;
import com.tencent.supersonic.common.util.BeanMapper;
import com.tencent.supersonic.common.util.JsonUtil;
import com.tencent.supersonic.semantic.api.model.request.DomainReq;
import com.tencent.supersonic.semantic.api.model.request.DomainSchemaFilterReq;
import com.tencent.supersonic.semantic.api.model.request.DomainUpdateReq;
import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
import com.tencent.supersonic.semantic.api.model.response.DimSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.DomainSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.semantic.api.model.response.MetricSchemaResp;
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
import com.tencent.supersonic.semantic.model.domain.DimensionService;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.MetricService;
import com.tencent.supersonic.semantic.model.domain.ModelService;
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Domain;
import com.tencent.supersonic.semantic.model.domain.repository.DomainRepository;
import com.tencent.supersonic.semantic.model.domain.utils.DomainConvert;
import java.util.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Queue;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.assertj.core.util.Sets;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -41,33 +39,26 @@ import org.springframework.util.CollectionUtils;
public class DomainServiceImpl implements DomainService {
private final DomainRepository domainRepository;
private final MetricService metricService;
private final DimensionService dimensionService;
private final DatasourceService datasourceService;
private final ModelService modelService;
private final UserService userService;
public DomainServiceImpl(DomainRepository domainRepository, @Lazy MetricService metricService,
@Lazy DimensionService dimensionService, @Lazy DatasourceService datasourceService,
UserService userService) {
public DomainServiceImpl(DomainRepository domainRepository,
@Lazy ModelService modelService,
UserService userService) {
this.domainRepository = domainRepository;
this.metricService = metricService;
this.dimensionService = dimensionService;
this.datasourceService = datasourceService;
this.modelService = modelService;
this.userService = userService;
}
@Override
public void createDomain(DomainReq domainReq, User user) {
log.info("[create domain] cmd : {}", JSONObject.toJSONString(domainReq));
Domain domain = DomainConvert.convert(domainReq);
log.info("[create domain] object:{}", JSONObject.toJSONString(domainReq));
saveDomain(domain, user);
}
@Override
public void updateDomain(DomainUpdateReq domainUpdateReq, User user) {
DomainDO domainDO = getDomainDO(domainUpdateReq.getId());
@@ -78,48 +69,19 @@ public class DomainServiceImpl implements DomainService {
domainDO.setAdminOrg(String.join(",", domainUpdateReq.getAdminOrgs()));
domainDO.setViewer(String.join(",", domainUpdateReq.getViewers()));
domainDO.setViewOrg(String.join(",", domainUpdateReq.getViewOrgs()));
domainDO.setEntity(JsonUtil.toString(domainUpdateReq.getEntity()));
domainRepository.updateDomain(domainDO);
}
@Override
public void deleteDomain(Long id) {
checkDelete(id);
domainRepository.deleteDomain(id);
}
private void checkDelete(Long id) {
List<MetricResp> metricResps = metricService.getMetrics(id);
List<DimensionResp> dimensionResps = dimensionService.getDimensions(id);
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(id);
if (!CollectionUtils.isEmpty(metricResps) || !CollectionUtils.isEmpty(datasourceResps)
|| !CollectionUtils.isEmpty(dimensionResps)) {
throw new RuntimeException("exist datasource, dimension or metric in this domain, please check");
}
}
@Override
public String getDomainBizName(Long id) {
if (id == null) {
return "";
}
DomainDO domainDO = getDomainDO(id);
if (domainDO == null) {
String message = String.format("domain with id:%s not exist", id);
throw new RuntimeException(message);
}
return domainDO.getBizName();
}
@Override
public List<DomainResp> getDomainList() {
return convertList(domainRepository.getDomainList(), new HashMap<>(), new HashMap<>());
return convertList(domainRepository.getDomainList());
}
@Override
public List<DomainResp> getDomainList(List<Long> domainIds) {
return getDomainList().stream()
@@ -128,27 +90,55 @@ public class DomainServiceImpl implements DomainService {
}
@Override
public List<DomainResp> getDomainListForAdmin(String userName) {
List<DomainDO> domainDOS = domainRepository.getDomainList();
Set<String> orgIds = Sets.newHashSet();
log.info("orgIds:{},userName:{}", orgIds, userName);
Map<Long, List<MetricResp>> metricDomainMap = metricService.getMetrics().stream()
.collect(Collectors.groupingBy(MetricResp::getDomainId));
Map<Long, List<DimensionResp>> dimensionDomainMap = dimensionService.getDimensions().stream()
.collect(Collectors.groupingBy(DimensionResp::getDomainId));
return convertList(domainDOS, metricDomainMap, dimensionDomainMap).stream()
.filter(domainDesc -> checkAdminPermission(orgIds, userName, domainDesc))
.collect(Collectors.toList());
public List<DomainResp> getDomainListWithAdminAuth(User user) {
Set<DomainResp> domainWithAuthAll = getDomainAuthSet(user.getName(), AuthType.VISIBLE);
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);
if (!CollectionUtils.isEmpty(modelResps)) {
List<Long> domainIds = modelResps.stream().map(ModelResp::getDomainId).collect(Collectors.toList());
domainWithAuthAll.addAll(getParentDomain(domainIds));
}
return new ArrayList<>(domainWithAuthAll);
}
@Override
public List<DomainResp> getDomainListForViewer(String userName) {
List<DomainDO> domainDOS = domainRepository.getDomainList();
Set<String> orgIds = Sets.newHashSet();
log.info("orgIds:{},userName:{}", orgIds, userName);
return convertList(domainDOS, new HashMap<>(), new HashMap<>()).stream()
.filter(domainDesc -> checkViewerPermission(orgIds, userName, domainDesc))
public Set<DomainResp> getDomainAuthSet(String userName, AuthType authTypeEnum) {
List<DomainResp> domainResps = getDomainList();
Set<String> orgIds = userService.getUserAllOrgId(userName);
List<DomainResp> domainWithAuth = Lists.newArrayList();
if (authTypeEnum.equals(AuthType.ADMIN)) {
domainWithAuth = domainResps.stream()
.filter(domainResp -> checkAdminPermission(orgIds, userName, domainResp))
.collect(Collectors.toList());
}
if (authTypeEnum.equals(AuthType.VISIBLE)) {
domainWithAuth = domainResps.stream()
.filter(domainResp -> checkViewerPermission(orgIds, userName, domainResp))
.collect(Collectors.toList());
}
List<Long> domainIds = domainWithAuth.stream().map(DomainResp::getId)
.collect(Collectors.toList());
//get all child domain
return getDomainChildren(domainIds);
}
private Set<DomainResp> getParentDomain(List<Long> ids) {
Set<DomainResp> domainSet = new HashSet<>();
if (CollectionUtils.isEmpty(ids)) {
return Sets.newHashSet(domainSet);
}
Map<Long, DomainResp> domainRespMap = getDomainMap();
for (Long domainId : ids) {
DomainResp domainResp = domainRespMap.get(domainId);
while (domainResp != null) {
domainSet.add(domainResp);
domainResp = domainRespMap.get(domainResp.getParentId());
}
}
return domainSet;
}
@@ -158,16 +148,6 @@ public class DomainServiceImpl implements DomainService {
return DomainConvert.convert(getDomainDO(id), fullDomainPathMap);
}
@Override
public String getDomainFullPath(Long domainId) {
if (domainId == null) {
return "";
}
Map<Long, String> map = getDomainFullPathMap();
return map.getOrDefault(domainId, "");
}
@Override
public Map<Long, String> getDomainFullPath() {
return getDomainFullPathMap();
@@ -180,22 +160,17 @@ public class DomainServiceImpl implements DomainService {
domain.setId(domainDO.getId());
}
private List<DomainResp> convertList(List<DomainDO> domainDOS, Map<Long, List<MetricResp>> metricDomainMap,
Map<Long, List<DimensionResp>> dimensionDomainMap) {
private List<DomainResp> convertList(List<DomainDO> domainDOS) {
List<DomainResp> domainDescs = Lists.newArrayList();
if (CollectionUtils.isEmpty(domainDOS)) {
return domainDescs;
}
Map<Long, String> fullDomainPathMap = getDomainFullPath();
return domainDOS.stream()
.map(domainDO -> DomainConvert.convert(domainDO, fullDomainPathMap, dimensionDomainMap,
metricDomainMap))
.map(domainDO -> DomainConvert.convert(domainDO, fullDomainPathMap))
.collect(Collectors.toList());
}
@Override
public Map<Long, DomainResp> getDomainMap() {
return getDomainList().stream().collect(Collectors.toMap(DomainResp::getId, a -> a, (k1, k2) -> k1));
@@ -251,72 +226,17 @@ public class DomainServiceImpl implements DomainService {
return domainFullPathMap;
}
public List<DomainSchemaResp> fetchDomainSchema(DomainSchemaFilterReq filter, User user) {
List<DomainSchemaResp> domainSchemaDescList = new ArrayList<>();
List<Long> domainIdsReq = generateDomainIdsReq(filter);
List<DomainResp> getDomainListByIds = getDomainList(domainIdsReq);
getDomainListByIds.stream().forEach(domainDesc -> {
domainSchemaDescList.add(fetchSingleDomainSchema(domainDesc));
});
return domainSchemaDescList;
}
protected DomainDO getDomainDO(Long id) {
return domainRepository.getDomainById(id);
}
private DomainSchemaResp fetchSingleDomainSchema(DomainResp domainDesc) {
Long domainId = domainDesc.getId();
DomainSchemaResp domainSchemaDesc = new DomainSchemaResp();
BeanUtils.copyProperties(domainDesc, domainSchemaDesc);
private boolean checkAdminPermission(Set<String> orgIds, String userName, DomainResp domainResp) {
domainSchemaDesc.setDimensions(generateDimSchema(domainId));
domainSchemaDesc.setMetrics(generateMetricSchema(domainId));
return domainSchemaDesc;
}
private List<MetricSchemaResp> generateMetricSchema(Long domainId) {
List<MetricSchemaResp> metricSchemaDescList = new ArrayList<>();
List<MetricResp> metricDescList = metricService.getMetrics(domainId);
metricDescList.stream().forEach(metricDesc -> {
MetricSchemaResp metricSchemaDesc = new MetricSchemaResp();
BeanUtils.copyProperties(metricDesc, metricSchemaDesc);
metricSchemaDesc.setUseCnt(0L);
metricSchemaDescList.add(metricSchemaDesc);
}
);
return metricSchemaDescList;
}
private List<DimSchemaResp> generateDimSchema(Long domainId) {
List<DimSchemaResp> dimSchemaDescList = new ArrayList<>();
List<DimensionResp> dimDescList = dimensionService.getDimensions(domainId);
dimDescList.stream().forEach(dimDesc -> {
DimSchemaResp dimSchemaDesc = new DimSchemaResp();
BeanUtils.copyProperties(dimDesc, dimSchemaDesc);
dimSchemaDesc.setUseCnt(0L);
dimSchemaDescList.add(dimSchemaDesc);
}
);
return dimSchemaDescList;
}
private List<Long> generateDomainIdsReq(DomainSchemaFilterReq filter) {
if (Objects.nonNull(filter) && !CollectionUtils.isEmpty(filter.getDomainIds())) {
return filter.getDomainIds();
}
return new ArrayList<>(getDomainMap().keySet());
}
private boolean checkAdminPermission(Set<String> orgIds, String userName, DomainResp domainDesc) {
List<String> admins = domainDesc.getAdmins();
List<String> adminOrgs = domainDesc.getAdminOrgs();
if (admins.contains(userName) || domainDesc.getCreatedBy().equals(userName)) {
List<String> admins = domainResp.getAdmins();
List<String> adminOrgs = domainResp.getAdminOrgs();
if (admins.contains(userName) || domainResp.getCreatedBy().equals(userName)) {
return true;
}
if (CollectionUtils.isEmpty(adminOrgs)) {
@@ -331,9 +251,6 @@ public class DomainServiceImpl implements DomainService {
}
private boolean checkViewerPermission(Set<String> orgIds, String userName, DomainResp domainDesc) {
if (domainDesc.getIsOpen() == 1) {
return true;
}
List<String> admins = domainDesc.getAdmins();
List<String> viewers = domainDesc.getViewers();
List<String> adminOrgs = domainDesc.getAdminOrgs();

View File

@@ -5,21 +5,22 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.common.pojo.enums.SensitiveLevelEnum;
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
import com.tencent.supersonic.semantic.api.model.request.PageMetricReq;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.common.pojo.enums.SensitiveLevelEnum;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.MetricService;
import com.tencent.supersonic.semantic.model.domain.ModelService;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Metric;
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
import com.tencent.supersonic.semantic.model.domain.repository.MetricRepository;
import com.tencent.supersonic.semantic.model.domain.utils.MetricConverter;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.MetricService;
import com.tencent.supersonic.semantic.model.domain.pojo.Metric;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@@ -35,16 +36,18 @@ import org.springframework.util.CollectionUtils;
@Slf4j
public class MetricServiceImpl implements MetricService {
private MetricRepository metricRepository;
private ModelService modelService;
private DomainService domainService;
public MetricServiceImpl(MetricRepository metricRepository,
ModelService modelService,
DomainService domainService) {
this.domainService = domainService;
this.metricRepository = metricRepository;
this.modelService = modelService;
}
@Override
@@ -62,8 +65,8 @@ public class MetricServiceImpl implements MetricService {
return;
}
List<Metric> metrics = metricReqs.stream().map(MetricConverter::convert).collect(Collectors.toList());
Long domainId = metricReqs.get(0).getDomainId();
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
Long modelId = metricReqs.get(0).getModelId();
List<MetricResp> metricDescs = getMetricByModelId(modelId);
Map<String, MetricResp> metricDescMap = metricDescs.stream()
.collect(Collectors.toMap(MetricResp::getBizName, a -> a, (k1, k2) -> k1));
List<Metric> metricToInsert = metrics.stream()
@@ -72,10 +75,9 @@ public class MetricServiceImpl implements MetricService {
saveMetricBatch(metricToInsert, user);
}
@Override
public List<MetricResp> getMetrics(Long domainId) {
return convertList(metricRepository.getMetricList(domainId));
public List<MetricResp> getMetrics(Long modelId) {
return convertList(metricRepository.getMetricList(modelId));
}
@Override
@@ -84,8 +86,8 @@ public class MetricServiceImpl implements MetricService {
}
@Override
public List<MetricResp> getMetrics(Long domainId, Long datasourceId) {
List<MetricResp> metricResps = convertList(metricRepository.getMetricList(domainId));
public List<MetricResp> getMetrics(Long modelId, Long datasourceId) {
List<MetricResp> metricResps = convertList(metricRepository.getMetricList(modelId));
return metricResps.stream().filter(metricResp -> {
Set<Long> datasourceIdSet = metricResp.getTypeParams().getMeasures().stream()
.map(Measure::getDatasourceId)
@@ -104,7 +106,10 @@ public class MetricServiceImpl implements MetricService {
BeanUtils.copyProperties(pageMetricReq, metricFilter);
Set<DomainResp> domainResps = domainService.getDomainChildren(pageMetricReq.getDomainIds());
List<Long> domainIds = domainResps.stream().map(DomainResp::getId).collect(Collectors.toList());
metricFilter.setDomainIds(domainIds);
List<ModelResp> modelResps = modelService.getModelByDomainIds(domainIds);
List<Long> modelIds = modelResps.stream().map(ModelResp::getId).collect(Collectors.toList());
pageMetricReq.getModelIds().addAll(modelIds);
metricFilter.setModelIds(pageMetricReq.getModelIds());
PageInfo<MetricDO> metricDOPageInfo = PageHelper.startPage(pageMetricReq.getCurrent(),
pageMetricReq.getPageSize())
.doSelectPageInfo(() -> queryMetric(metricFilter));
@@ -118,10 +123,9 @@ public class MetricServiceImpl implements MetricService {
return metricRepository.getMetric(metricFilter);
}
@Override
public MetricResp getMetric(Long domainId, String bizName) {
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
public MetricResp getMetric(Long modelId, String bizName) {
List<MetricResp> metricDescs = getMetricByModelId(modelId);
MetricResp metricDesc = null;
if (CollectionUtils.isEmpty(metricDescs)) {
return metricDesc;
@@ -143,7 +147,6 @@ public class MetricServiceImpl implements MetricService {
updateMetric(metric);
}
public void saveMetric(Metric metric) {
MetricDO metricDO = MetricConverter.convert2MetricDO(metric);
log.info("[save metric] metricDO:{}", JSONObject.toJSONString(metricDO));
@@ -156,21 +159,19 @@ public class MetricServiceImpl implements MetricService {
metricRepository.updateMetric(MetricConverter.convert(metricDO, metric));
}
public List<MetricResp> getMetricByDomainId(Long domainId) {
return convertList(getMetricDOByDomainId(domainId));
public List<MetricResp> getMetricByModelId(Long modelId) {
return convertList(getMetricDOByModelId(modelId));
}
protected List<MetricDO> getMetricDOByDomainId(Long domainId) {
protected List<MetricDO> getMetricDOByModelId(Long modelId) {
List<MetricDO> metricDOS = metricRepository.getAllMetricList();
return metricDOS.stream().filter(metricDO -> Objects.equals(metricDO.getDomainId(), domainId))
return metricDOS.stream().filter(metricDO -> Objects.equals(metricDO.getModelId(), modelId))
.collect(Collectors.toList());
}
@Override
public List<MetricResp> getHighSensitiveMetric(Long domainId) {
List<MetricResp> metricDescs = getMetricByDomainId(domainId);
public List<MetricResp> getHighSensitiveMetric(Long modelId) {
List<MetricResp> metricDescs = getMetricByModelId(modelId);
if (CollectionUtils.isEmpty(metricDescs)) {
return metricDescs;
}
@@ -223,8 +224,8 @@ public class MetricServiceImpl implements MetricService {
}
private void checkExist(List<MetricReq> exprMetricReqList) {
Long domainId = exprMetricReqList.get(0).getDomainId();
List<MetricResp> metricDescs = getMetrics(domainId);
Long modelId = exprMetricReqList.get(0).getModelId();
List<MetricResp> metricDescs = getMetrics(modelId);
for (MetricReq exprMetricReq : exprMetricReqList) {
for (MetricResp metricDesc : metricDescs) {
if (metricDesc.getName().equalsIgnoreCase(exprMetricReq.getName())) {
@@ -238,13 +239,12 @@ public class MetricServiceImpl implements MetricService {
}
}
private List<MetricResp> convertList(List<MetricDO> metricDOS) {
List<MetricResp> metricDescs = Lists.newArrayList();
Map<Long, DomainResp> domainMap = domainService.getDomainMap();
Map<Long, ModelResp> modelMap = modelService.getModelMap();
if (!CollectionUtils.isEmpty(metricDOS)) {
metricDescs = metricDOS.stream()
.map(metricDO -> MetricConverter.convert2MetricDesc(metricDO, domainMap))
.map(metricDO -> MetricConverter.convert2MetricDesc(metricDO, modelMap))
.collect(Collectors.toList());
}
return metricDescs;

View File

@@ -0,0 +1,334 @@
package com.tencent.supersonic.semantic.model.application;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.service.UserService;
import com.tencent.supersonic.common.pojo.enums.AuthType;
import com.tencent.supersonic.common.util.BeanMapper;
import com.tencent.supersonic.common.util.JsonUtil;
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.DatasourceResp;
import com.tencent.supersonic.semantic.api.model.response.DimSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.semantic.api.model.response.MetricSchemaResp;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.api.model.response.ModelSchemaResp;
import com.tencent.supersonic.semantic.model.domain.DatasourceService;
import com.tencent.supersonic.semantic.model.domain.DimensionService;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import com.tencent.supersonic.semantic.model.domain.MetricService;
import com.tencent.supersonic.semantic.model.domain.ModelService;
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Model;
import com.tencent.supersonic.semantic.model.domain.repository.ModelRepository;
import com.tencent.supersonic.semantic.model.domain.utils.ModelConvert;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.stream.Collectors;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.BeanUtils;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@Slf4j
@Service
public class ModelServiceImpl implements ModelService {
private final ModelRepository modelRepository;
private final MetricService metricService;
private final DimensionService dimensionService;
private final DatasourceService datasourceService;
private final DomainService domainService;
private final UserService userService;
public ModelServiceImpl(ModelRepository modelRepository, @Lazy MetricService metricService,
@Lazy DimensionService dimensionService, @Lazy DatasourceService datasourceService,
@Lazy DomainService domainService, UserService userService) {
this.modelRepository = modelRepository;
this.metricService = metricService;
this.dimensionService = dimensionService;
this.datasourceService = datasourceService;
this.domainService = domainService;
this.userService = userService;
}
@Override
public void createModel(ModelReq modelReq, User user) {
log.info("[create model] cmd : {}", JSONObject.toJSONString(modelReq));
Model model = ModelConvert.convert(modelReq);
log.info("[create model] object:{}", JSONObject.toJSONString(modelReq));
saveModel(model, user);
}
@Override
public void updateModel(ModelReq modelReq, User user) {
ModelDO modelDO = getModelDO(modelReq.getId());
modelDO.setUpdatedAt(new Date());
modelDO.setUpdatedBy(user.getName());
BeanMapper.mapper(modelReq, modelDO);
modelDO.setAdmin(String.join(",", modelReq.getAdmins()));
modelDO.setAdminOrg(String.join(",", modelReq.getAdminOrgs()));
modelDO.setViewer(String.join(",", modelReq.getViewers()));
modelDO.setViewOrg(String.join(",", modelReq.getViewOrgs()));
modelDO.setEntity(JsonUtil.toString(modelReq.getEntity()));
modelRepository.updateModel(modelDO);
}
@Override
public void deleteModel(Long id) {
checkDelete(id);
modelRepository.deleteModel(id);
}
@Override
public List<ModelResp> getModelListWithAuth(String userName, Long domainId, AuthType authType) {
List<ModelResp> modelResps = getModelAuthList(userName, authType);
Set<ModelResp> modelRespSet = new HashSet<>(modelResps);
List<ModelResp> modelRespsAuthInheritDomain = getModelRespAuthInheritDomain(userName, authType);
modelRespSet.addAll(modelRespsAuthInheritDomain);
if (domainId != null && domainId > 0) {
modelRespSet = modelRespSet.stream().filter(modelResp ->
modelResp.getDomainId().equals(domainId)).collect(Collectors.toSet());
}
return fillMetricInfo(new ArrayList<>(modelRespSet));
}
public List<ModelResp> getModelRespAuthInheritDomain(String userName, AuthType authType) {
Set<DomainResp> domainResps = domainService.getDomainAuthSet(userName, authType);
if (CollectionUtils.isEmpty(domainResps)) {
return Lists.newArrayList();
}
List<ModelResp> allModelList = getModelList();
Set<Long> domainIds = domainResps.stream().map(DomainResp::getId).collect(Collectors.toSet());
return allModelList.stream().filter(modelResp ->
domainIds.contains(modelResp.getDomainId())).collect(Collectors.toList());
}
@Override
public List<ModelResp> getModelAuthList(String userName, AuthType authTypeEnum) {
List<ModelResp> modelResps = getModelList();
Set<String> orgIds = userService.getUserAllOrgId(userName);
List<ModelResp> modelWithAuth = Lists.newArrayList();
if (authTypeEnum.equals(AuthType.ADMIN)) {
modelWithAuth = modelResps.stream()
.filter(modelResp -> checkAdminPermission(orgIds, userName, modelResp))
.collect(Collectors.toList());
}
if (authTypeEnum.equals(AuthType.VISIBLE)) {
modelWithAuth = modelResps.stream()
.filter(domainResp -> checkViewerPermission(orgIds, userName, domainResp))
.collect(Collectors.toList());
}
return modelWithAuth;
}
@Override
public List<ModelResp> getModelByDomainIds(List<Long> domainIds) {
if (CollectionUtils.isEmpty(domainIds)) {
return Lists.newArrayList();
}
List<ModelResp> modelResps = getModelList();
if (CollectionUtils.isEmpty(modelResps)) {
return modelResps;
}
return modelResps.stream().filter(modelResp ->
domainIds.contains(modelResp.getDomainId())).collect(Collectors.toList());
}
@Override
public List<ModelResp> getModelList(List<Long> modelIds) {
return getModelList().stream()
.filter(modelDO -> modelIds.contains(modelDO.getId()))
.collect(Collectors.toList());
}
@Override
public List<ModelResp> getModelList() {
return convertList(modelRepository.getModelList());
}
@Override
public ModelResp getModel(Long id) {
Map<Long, DomainResp> domainRespMap = domainService.getDomainList().stream()
.collect(Collectors.toMap(DomainResp::getId, d -> d));
return ModelConvert.convert(getModelDO(id), domainRespMap);
}
private void checkDelete(Long id) {
List<MetricResp> metricResps = metricService.getMetrics(id);
List<DimensionResp> dimensionResps = dimensionService.getDimensions(id);
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(id);
if (!CollectionUtils.isEmpty(metricResps) || !CollectionUtils.isEmpty(datasourceResps)
|| !CollectionUtils.isEmpty(dimensionResps)) {
throw new RuntimeException("exist datasource, dimension or metric in this model, please check");
}
}
private void saveModel(Model model, User user) {
ModelDO modelDO = ModelConvert.convert(model, user);
modelRepository.createModel(modelDO);
model.setId(modelDO.getId());
}
private List<ModelResp> convertList(List<ModelDO> modelDOS) {
List<ModelResp> modelResps = Lists.newArrayList();
if (CollectionUtils.isEmpty(modelDOS)) {
return modelResps;
}
Map<Long, DomainResp> domainRespMap = domainService.getDomainList().stream()
.collect(Collectors.toMap(DomainResp::getId, d -> d));
return modelDOS.stream()
.map(modelDO -> ModelConvert.convert(modelDO, domainRespMap))
.collect(Collectors.toList());
}
private List<ModelResp> fillMetricInfo(List<ModelResp> modelResps) {
if (CollectionUtils.isEmpty(modelResps)) {
return modelResps;
}
Map<Long, List<MetricResp>> metricMap = metricService.getMetrics().stream()
.collect(Collectors.groupingBy(MetricResp::getModelId));
Map<Long, List<DimensionResp>> dimensionMap = dimensionService.getDimensions().stream()
.collect(Collectors.groupingBy(DimensionResp::getModelId));
modelResps.forEach(modelResp -> {
modelResp.setDimensionCnt(dimensionMap.getOrDefault(modelResp.getId(), Lists.newArrayList()).size());
modelResp.setMetricCnt(metricMap.getOrDefault(modelResp.getId(), Lists.newArrayList()).size());
});
return modelResps;
}
@Override
public Map<Long, ModelResp> getModelMap() {
return getModelList().stream().collect(Collectors.toMap(ModelResp::getId, a -> a, (k1, k2) -> k1));
}
@Override
public Map<Long, String> getModelFullPathMap() {
return getModelList().stream()
.collect(Collectors.toMap(ModelResp::getId, ModelResp::getFullPath, (k1, k2) -> k1));
}
protected ModelDO getModelDO(Long id) {
return modelRepository.getModelById(id);
}
private ModelSchemaResp fetchSingleModelSchema(ModelResp modelResp) {
Long modelId = modelResp.getId();
ModelSchemaResp modelSchemaResp = new ModelSchemaResp();
BeanUtils.copyProperties(modelResp, modelSchemaResp);
modelSchemaResp.setDimensions(generateDimSchema(modelId));
modelSchemaResp.setMetrics(generateMetricSchema(modelId));
return modelSchemaResp;
}
@Override
public ModelSchemaResp fetchSingleModelSchema(Long modelId) {
ModelResp model = getModel(modelId);
return fetchSingleModelSchema(model);
}
@Override
public List<ModelSchemaResp> fetchModelSchema(ModelSchemaFilterReq modelSchemaFilterReq) {
List<ModelSchemaResp> modelSchemaRespList = new ArrayList<>();
List<Long> modelIds = modelSchemaFilterReq.getModelIds();
if (CollectionUtils.isEmpty(modelIds)) {
modelIds = generateModelIdsReq(modelSchemaFilterReq);
}
modelIds.stream().forEach(modelId -> {
ModelSchemaResp modelSchemaResp = fetchSingleModelSchema(modelId);
if (Objects.nonNull(modelSchemaResp)) {
modelSchemaRespList.add(modelSchemaResp);
}
});
return modelSchemaRespList;
}
private List<MetricSchemaResp> generateMetricSchema(Long modelId) {
List<MetricSchemaResp> metricSchemaDescList = new ArrayList<>();
List<MetricResp> metricDescList = metricService.getMetrics(modelId);
metricDescList.stream().forEach(metricDesc -> {
MetricSchemaResp metricSchemaDesc = new MetricSchemaResp();
BeanUtils.copyProperties(metricDesc, metricSchemaDesc);
metricSchemaDesc.setUseCnt(0L);
metricSchemaDescList.add(metricSchemaDesc);
}
);
return metricSchemaDescList;
}
private List<DimSchemaResp> generateDimSchema(Long modelId) {
List<DimSchemaResp> dimSchemaDescList = new ArrayList<>();
List<DimensionResp> dimDescList = dimensionService.getDimensions(modelId);
dimDescList.stream().forEach(dimDesc -> {
DimSchemaResp dimSchemaDesc = new DimSchemaResp();
BeanUtils.copyProperties(dimDesc, dimSchemaDesc);
dimSchemaDesc.setUseCnt(0L);
dimSchemaDescList.add(dimSchemaDesc);
}
);
return dimSchemaDescList;
}
private List<Long> generateModelIdsReq(ModelSchemaFilterReq filter) {
if (Objects.nonNull(filter) && !CollectionUtils.isEmpty(filter.getModelIds())) {
return filter.getModelIds();
}
return new ArrayList<>(getModelMap().keySet());
}
public static boolean checkAdminPermission(Set<String> orgIds, String userName, ModelResp modelResp) {
List<String> admins = modelResp.getAdmins();
List<String> adminOrgs = modelResp.getAdminOrgs();
if (admins.contains(userName) || modelResp.getCreatedBy().equals(userName)) {
return true;
}
if (CollectionUtils.isEmpty(adminOrgs)) {
return false;
}
for (String orgId : orgIds) {
if (adminOrgs.contains(orgId)) {
return true;
}
}
return false;
}
public static boolean checkViewerPermission(Set<String> orgIds, String userName, ModelResp modelResp) {
List<String> admins = modelResp.getAdmins();
List<String> viewers = modelResp.getViewers();
List<String> adminOrgs = modelResp.getAdminOrgs();
List<String> viewOrgs = modelResp.getViewOrgs();
if (modelResp.openToAll()) {
return true;
}
if (admins.contains(userName) || viewers.contains(userName) || modelResp.getCreatedBy().equals(userName)) {
return true;
}
if (CollectionUtils.isEmpty(adminOrgs) && CollectionUtils.isEmpty(viewOrgs)) {
return false;
}
for (String orgId : orgIds) {
if (adminOrgs.contains(orgId)) {
return true;
}
}
for (String orgId : orgIds) {
if (viewOrgs.contains(orgId)) {
return true;
}
}
return false;
}
}

View File

@@ -5,14 +5,13 @@ 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.DomainSchemaRelaResp;
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.api.model.response.ModelSchemaRelaResp;
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;
@@ -38,22 +37,22 @@ public class ViewInfoServiceImpl {
this.datasourceService = datasourceService;
}
public List<ViewInfoDO> getViewInfoList(Long domainId) {
return viewInfoRepository.getViewInfoList(domainId);
public List<ViewInfoDO> getViewInfoList(Long modelId) {
return viewInfoRepository.getViewInfoList(modelId);
}
public List<DomainSchemaRelaResp> getDomainSchema(Long domainId) {
List<DomainSchemaRelaResp> domainSchemaRelaResps = Lists.newArrayList();
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(domainId);
public List<ModelSchemaRelaResp> getDomainSchema(Long modelId) {
List<ModelSchemaRelaResp> domainSchemaRelaResps = Lists.newArrayList();
List<DatasourceResp> datasourceResps = datasourceService.getDatasourceList(modelId);
for (DatasourceResp datasourceResp : datasourceResps) {
DomainSchemaRelaResp domainSchemaRelaResp = new DomainSchemaRelaResp();
ModelSchemaRelaResp domainSchemaRelaResp = new ModelSchemaRelaResp();
Long datasourceId = datasourceResp.getId();
List<MetricResp> metricResps = metricService.getMetrics(domainId, datasourceId);
List<MetricResp> metricResps = metricService.getMetrics(modelId, datasourceId);
List<DimensionResp> dimensionResps = dimensionService.getDimensionsByDatasource(datasourceId);
domainSchemaRelaResp.setDatasource(datasourceResp);
domainSchemaRelaResp.setDimensions(dimensionResps);
domainSchemaRelaResp.setMetrics(metricResps);
domainSchemaRelaResp.setDomainId(domainId);
domainSchemaRelaResp.setDomainId(modelId);
domainSchemaRelaResps.add(domainSchemaRelaResp);
}
return domainSchemaRelaResps;

View File

@@ -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,21 +16,22 @@ import java.util.Set;
public interface Catalog {
DatabaseResp getDatabase(Long id);
DatabaseResp getDatabaseByDomainId(Long domainId);
List<DatasourceResp> getDatasourceList(Long domainId);
DatabaseResp getDatabaseByModelId(Long modelId);
String getDomainFullPath(Long domainId);
List<DatasourceResp> getDatasourceList(Long modelId);
Map<Long, String> getDomainFullPath();
String getModelFullPath(Long modelId);
DimensionResp getDimension(String bizName, Long domainId);
Map<Long, String> getModelFullPath();
List<DimensionResp> getDimensions(Long domainId);
DimensionResp getDimension(String bizName, Long modelId);
List<MetricResp> getMetrics(Long domainId);
List<DimensionResp> getDimensions(Long modelId);
void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
List<MetricResp> getMetrics(Long modelId);
void getModelYamlTplByMoldelIds(Set<Long> modelIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList);

View File

@@ -11,6 +11,8 @@ public interface DatabaseService {
QueryResultWithSchemaResp executeSql(String sql, DatabaseResp databaseResp);
DatabaseResp getDatabaseByModelId(Long modelId);
QueryResultWithSchemaResp executeSql(String sql, Long domainId);
boolean testConnect(DatabaseReq databaseReq, User user);

View File

@@ -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,8 +22,6 @@ public interface DatasourceService {
DatasourceResp updateDatasource(DatasourceReq datasourceReq, User user) throws Exception;
String getSourceBizNameById(Long id);
List<DatasourceResp> getDatasourceListNoMeasurePrefix(Long domainId);
List<DatasourceResp> getDatasourceList();
@@ -42,10 +40,9 @@ public interface DatasourceService {
ItemDateResp getItemDate(ItemDateFilter dimension, ItemDateFilter metric);
List<MeasureResp> getMeasureListOfDomain(Long domainId);
List<MeasureResp> getMeasureListOfModel(Long modelId);
void getModelYamlTplByDomainIds(Set<Long> domainIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
void getModelYamlTplByModelIds(Set<Long> modelIds, Map<String, List<DimensionYamlTpl>> dimensionYamlMap,
List<DatasourceYamlTpl> datasourceYamlTplList, List<MetricYamlTpl> metricYamlTplList);
}

View File

@@ -1,22 +1,18 @@
package com.tencent.supersonic.semantic.model.domain;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
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.DomainSchemaFilterReq;
import com.tencent.supersonic.semantic.api.model.request.DomainUpdateReq;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.DomainSchemaResp;
import java.util.List;
import java.util.Map;
import java.util.Set;
public interface DomainService {
DomainResp getDomain(Long id);
String getDomainFullPath(Long domainId);
Map<Long, String> getDomainFullPath();
void createDomain(DomainReq domainReq, User user);
@@ -25,20 +21,16 @@ public interface DomainService {
void deleteDomain(Long id);
String getDomainBizName(Long domainId);
List<DomainResp> getDomainList();
List<DomainResp> getDomainList(List<Long> domainIds);
Map<Long, DomainResp> getDomainMap();
List<DomainResp> getDomainListForAdmin(String userName);
List<DomainResp> getDomainListWithAdminAuth(User user);
List<DomainResp> getDomainListForViewer(String userName);
Set<DomainResp> getDomainAuthSet(String userName, AuthType authTypeEnum);
Set<DomainResp> getDomainChildren(List<Long> domainId);
List<DomainSchemaResp> fetchDomainSchema(DomainSchemaFilterReq filter, User user);
}

View File

@@ -11,11 +11,11 @@ public interface MetricService {
List<MetricResp> getMetrics(List<Long> ids);
List<MetricResp> getMetrics(Long domainId);
List<MetricResp> getMetrics(Long modelId);
List<MetricResp> getMetrics();
List<MetricResp> getMetrics(Long domainId, Long datasourceId);
List<MetricResp> getMetrics(Long modelId, Long datasourceId);
void creatExprMetric(MetricReq metricReq, User user) throws Exception;
@@ -23,9 +23,9 @@ public interface MetricService {
PageInfo<MetricResp> queryMetric(PageMetricReq pageMetrricReq);
MetricResp getMetric(Long domainId, String bizName);
MetricResp getMetric(Long modelId, String bizName);
List<MetricResp> getHighSensitiveMetric(Long domainId);
List<MetricResp> getHighSensitiveMetric(Long modelId);
void updateExprMetric(MetricReq metricReq, User user) throws Exception;

View File

@@ -0,0 +1,39 @@
package com.tencent.supersonic.semantic.model.domain;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.common.pojo.enums.AuthType;
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;
public interface ModelService {
List<ModelResp> getModelListWithAuth(String userName, Long domainId, AuthType authType);
List<ModelResp> getModelAuthList(String userName, AuthType authTypeEnum);
List<ModelResp> getModelByDomainIds(List<Long> domainIds);
List<ModelResp> getModelList();
List<ModelResp> getModelList(List<Long> modelIds);
ModelResp getModel(Long id);
void updateModel(ModelReq modelReq, User user);
void createModel(ModelReq modelReq, User user);
void deleteModel(Long model);
Map<Long, ModelResp> getModelMap();
Map<Long, String> getModelFullPathMap();
ModelSchemaResp fetchSingleModelSchema(Long modelId);
List<ModelSchemaResp> fetchModelSchema(ModelSchemaFilterReq modelSchemaFilterReq);
}

View File

@@ -1,7 +1,7 @@
package com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter;
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
import com.tencent.supersonic.common.pojo.Constants;
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
public class ClickHouseAdaptor extends EngineAdaptor {

View File

@@ -1,7 +1,7 @@
package com.tencent.supersonic.semantic.model.domain.adaptor.engineadapter;
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
import com.tencent.supersonic.common.pojo.Constants;
import com.tencent.supersonic.semantic.api.model.enums.TimeDimensionEnum;
public class MysqlAdaptor extends EngineAdaptor {

View File

@@ -25,7 +25,7 @@ public class DatabaseDO {
private String description;
/**
* 版本
*
*/
private String version;
@@ -127,6 +127,20 @@ public class DatabaseDO {
this.description = description == null ? null : description.trim();
}
/**
* @return version
*/
public String getVersion() {
return version;
}
/**
* @param version
*/
public void setVersion(String version) {
this.version = version == null ? null : version.trim();
}
/**
* 类型 mysql,clickhouse,tdw
*
@@ -234,16 +248,4 @@ public class DatabaseDO {
public void setConfig(String config) {
this.config = config == null ? null : config.trim();
}
/**
* 版本信息
*
*/
public String getVersion() {
return version;
}
public void setVersion(String version) {
this.version = version;
}
}

View File

@@ -38,13 +38,6 @@ public class DatabaseDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DatabaseDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DatabaseDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DatabaseDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DatabaseDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class DatabaseDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_database null
*/
@@ -450,6 +450,76 @@ public class DatabaseDOExample {
return (Criteria) this;
}
public Criteria andVersionIsNull() {
addCriterion("version is null");
return (Criteria) this;
}
public Criteria andVersionIsNotNull() {
addCriterion("version is not null");
return (Criteria) this;
}
public Criteria andVersionEqualTo(String value) {
addCriterion("version =", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotEqualTo(String value) {
addCriterion("version <>", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThan(String value) {
addCriterion("version >", value, "version");
return (Criteria) this;
}
public Criteria andVersionGreaterThanOrEqualTo(String value) {
addCriterion("version >=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThan(String value) {
addCriterion("version <", value, "version");
return (Criteria) this;
}
public Criteria andVersionLessThanOrEqualTo(String value) {
addCriterion("version <=", value, "version");
return (Criteria) this;
}
public Criteria andVersionLike(String value) {
addCriterion("version like", value, "version");
return (Criteria) this;
}
public Criteria andVersionNotLike(String value) {
addCriterion("version not like", value, "version");
return (Criteria) this;
}
public Criteria andVersionIn(List<String> values) {
addCriterion("version in", values, "version");
return (Criteria) this;
}
public Criteria andVersionNotIn(List<String> values) {
addCriterion("version not in", values, "version");
return (Criteria) this;
}
public Criteria andVersionBetween(String value1, String value2) {
addCriterion("version between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andVersionNotBetween(String value1, String value2) {
addCriterion("version not between", value1, value2, "version");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
@@ -812,6 +882,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;
@@ -847,37 +949,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;
}
}
}

View File

@@ -12,7 +12,7 @@ public class DatasourceDO {
/**
* 主题域ID
*/
private Long domainId;
private Long modelId;
/**
* 数据源名称
@@ -76,19 +76,19 @@ public class DatasourceDO {
/**
* 主题域ID
*
* @return domain_id 主题域ID
* @return model_id 主题域ID
*/
public Long getDomainId() {
return domainId;
public Long getModelId() {
return modelId;
}
/**
* 主题域ID
*
* @param domainId 主题域ID
* @param modelId 主题域ID
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**

View File

@@ -38,13 +38,6 @@ public class DatasourceDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DatasourceDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DatasourceDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DatasourceDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DatasourceDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class DatasourceDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_datasource null
*/
@@ -250,63 +250,63 @@ public class DatasourceDOExample {
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
public Criteria andModelIdIsNull() {
addCriterion("model_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
public Criteria andModelIdIsNotNull() {
addCriterion("model_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
public Criteria andModelIdEqualTo(Long value) {
addCriterion("model_id =", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
public Criteria andModelIdNotEqualTo(Long value) {
addCriterion("model_id <>", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
public Criteria andModelIdGreaterThan(Long value) {
addCriterion("model_id >", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
public Criteria andModelIdGreaterThanOrEqualTo(Long value) {
addCriterion("model_id >=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
public Criteria andModelIdLessThan(Long value) {
addCriterion("model_id <", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
public Criteria andModelIdLessThanOrEqualTo(Long value) {
addCriterion("model_id <=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
public Criteria andModelIdIn(List<Long> values) {
addCriterion("model_id in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
public Criteria andModelIdNotIn(List<Long> values) {
addCriterion("model_id not in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
public Criteria andModelIdBetween(Long value1, Long value2) {
addCriterion("model_id between", value1, value2, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
public Criteria andModelIdNotBetween(Long value1, Long value2) {
addCriterion("model_id not between", value1, value2, "modelId");
return (Criteria) this;
}
@@ -872,6 +872,38 @@ public class DatasourceDOExample {
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;
@@ -907,37 +939,5 @@ public class DatasourceDOExample {
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;
}
}
}

View File

@@ -12,7 +12,7 @@ public class DatasourceRelaDO {
/**
*
*/
private Long domainId;
private Long modelId;
/**
*
@@ -64,17 +64,17 @@ public class DatasourceRelaDO {
}
/**
* @return domain_id
* @return model_id
*/
public Long getDomainId() {
return domainId;
public Long getModelId() {
return modelId;
}
/**
* @param domainId
* @param modelId
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**

View File

@@ -38,13 +38,6 @@ public class DatasourceRelaDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DatasourceRelaDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DatasourceRelaDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DatasourceRelaDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DatasourceRelaDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class DatasourceRelaDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_datasource_rela null
*/
@@ -250,63 +250,63 @@ public class DatasourceRelaDOExample {
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
public Criteria andModelIdIsNull() {
addCriterion("model_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
public Criteria andModelIdIsNotNull() {
addCriterion("model_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
public Criteria andModelIdEqualTo(Long value) {
addCriterion("model_id =", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
public Criteria andModelIdNotEqualTo(Long value) {
addCriterion("model_id <>", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
public Criteria andModelIdGreaterThan(Long value) {
addCriterion("model_id >", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
public Criteria andModelIdGreaterThanOrEqualTo(Long value) {
addCriterion("model_id >=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
public Criteria andModelIdLessThan(Long value) {
addCriterion("model_id <", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
public Criteria andModelIdLessThanOrEqualTo(Long value) {
addCriterion("model_id <=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
public Criteria andModelIdIn(List<Long> values) {
addCriterion("model_id in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
public Criteria andModelIdNotIn(List<Long> values) {
addCriterion("model_id not in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
public Criteria andModelIdBetween(Long value1, Long value2) {
addCriterion("model_id between", value1, value2, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
public Criteria andModelIdNotBetween(Long value1, Long value2) {
addCriterion("model_id not between", value1, value2, "modelId");
return (Criteria) this;
}
@@ -335,6 +335,11 @@ public class DatasourceRelaDOExample {
return (Criteria) this;
}
public Criteria andDatasourceFromGreaterThanOrEqualTo(Long value) {
addCriterion("datasource_from >=", value, "datasourceFrom");
return (Criteria) this;
}
public Criteria andDatasourceFromLessThan(Long value) {
addCriterion("datasource_from <", value, "datasourceFrom");
return (Criteria) this;
@@ -787,6 +792,38 @@ public class DatasourceRelaDOExample {
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;
@@ -822,37 +859,5 @@ public class DatasourceRelaDOExample {
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;
}
}
}

View File

@@ -1,278 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.Date;
public class DictionaryDO {
/**
*
*/
private Long id;
/**
* 对应维度id、指标id等
*/
private Long itemId;
/**
* 对应维度、指标等
*/
private String type;
/**
* 1-开启写入字典0-不开启
*/
private Boolean isDictInfo;
/**
* 创建时间
*/
private Date createdAt;
/**
* 更新时间
*/
private Date updatedAt;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
/**
* 1-删除,0-可用
*/
private Boolean isDeleted;
/**
* 字典黑名单
*/
private String blackList;
/**
* 字典白名单
*/
private String whiteList;
/**
* 字典规则
*/
private String ruleList;
/**
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 对应维度id、指标id等
*
* @return item_id 对应维度id、指标id等
*/
public Long getItemId() {
return itemId;
}
/**
* 对应维度id、指标id等
*
* @param itemId 对应维度id、指标id等
*/
public void setItemId(Long itemId) {
this.itemId = itemId;
}
/**
* 对应维度、指标等
*
* @return type 对应维度、指标等
*/
public String getType() {
return type;
}
/**
* 对应维度、指标等
*
* @param type 对应维度、指标等
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* 1-开启写入字典0-不开启
*
* @return is_dict_Info 1-开启写入字典0-不开启
*/
public Boolean getIsDictInfo() {
return isDictInfo;
}
/**
* 1-开启写入字典0-不开启
*
* @param isDictInfo 1-开启写入字典0-不开启
*/
public void setIsDictInfo(Boolean isDictInfo) {
this.isDictInfo = isDictInfo;
}
/**
* 创建时间
*
* @return created_at 创建时间
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* 创建时间
*
* @param createdAt 创建时间
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* 更新时间
*
* @return updated_at 更新时间
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* 更新时间
*
* @param updatedAt 更新时间
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* 创建人
*
* @return created_by 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 更新人
*
* @return updated_by 更新人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 更新人
*
* @param updatedBy 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 1-删除,0-可用
*
* @return is_deleted 1-删除,0-可用
*/
public Boolean getIsDeleted() {
return isDeleted;
}
/**
* 1-删除,0-可用
*
* @param isDeleted 1-删除,0-可用
*/
public void setIsDeleted(Boolean isDeleted) {
this.isDeleted = isDeleted;
}
/**
* 字典黑名单
*
* @return black_list 字典黑名单
*/
public String getBlackList() {
return blackList;
}
/**
* 字典黑名单
*
* @param blackList 字典黑名单
*/
public void setBlackList(String blackList) {
this.blackList = blackList == null ? null : blackList.trim();
}
/**
* 字典白名单
*
* @return white_list 字典白名单
*/
public String getWhiteList() {
return whiteList;
}
/**
* 字典白名单
*
* @param whiteList 字典白名单
*/
public void setWhiteList(String whiteList) {
this.whiteList = whiteList == null ? null : whiteList.trim();
}
/**
* 字典规则
*
* @return rule_list 字典规则
*/
public String getRuleList() {
return ruleList;
}
/**
* 字典规则
*
* @param ruleList 字典规则
*/
public void setRuleList(String ruleList) {
this.ruleList = ruleList == null ? null : ruleList.trim();
}
}

View File

@@ -1,863 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class DictionaryDOExample {
/**
* s2_dictionary
*/
protected String orderByClause;
/**
* s2_dictionary
*/
protected boolean distinct;
/**
* s2_dictionary
*/
protected List<Criteria> oredCriteria;
/**
* s2_dictionary
*/
protected Integer limitStart;
/**
* s2_dictionary
*/
protected Integer limitEnd;
/**
* @mbg.generated
*/
public DictionaryDOExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
public void setLimitStart(Integer limitStart) {
this.limitStart = limitStart;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* @mbg.generated
*/
public void setLimitEnd(Integer limitEnd) {
this.limitEnd = limitEnd;
}
/**
* s2_dictionary null
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andItemIdIsNull() {
addCriterion("item_id is null");
return (Criteria) this;
}
public Criteria andItemIdIsNotNull() {
addCriterion("item_id is not null");
return (Criteria) this;
}
public Criteria andItemIdEqualTo(Long value) {
addCriterion("item_id =", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotEqualTo(Long value) {
addCriterion("item_id <>", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdGreaterThan(Long value) {
addCriterion("item_id >", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdGreaterThanOrEqualTo(Long value) {
addCriterion("item_id >=", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdLessThan(Long value) {
addCriterion("item_id <", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdLessThanOrEqualTo(Long value) {
addCriterion("item_id <=", value, "itemId");
return (Criteria) this;
}
public Criteria andItemIdIn(List<Long> values) {
addCriterion("item_id in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotIn(List<Long> values) {
addCriterion("item_id not in", values, "itemId");
return (Criteria) this;
}
public Criteria andItemIdBetween(Long value1, Long value2) {
addCriterion("item_id between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andItemIdNotBetween(Long value1, Long value2) {
addCriterion("item_id not between", value1, value2, "itemId");
return (Criteria) this;
}
public Criteria andTypeIsNull() {
addCriterion("type is null");
return (Criteria) this;
}
public Criteria andTypeIsNotNull() {
addCriterion("type is not null");
return (Criteria) this;
}
public Criteria andTypeEqualTo(String value) {
addCriterion("type =", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotEqualTo(String value) {
addCriterion("type <>", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThan(String value) {
addCriterion("type >", value, "type");
return (Criteria) this;
}
public Criteria andTypeGreaterThanOrEqualTo(String value) {
addCriterion("type >=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThan(String value) {
addCriterion("type <", value, "type");
return (Criteria) this;
}
public Criteria andTypeLessThanOrEqualTo(String value) {
addCriterion("type <=", value, "type");
return (Criteria) this;
}
public Criteria andTypeLike(String value) {
addCriterion("type like", value, "type");
return (Criteria) this;
}
public Criteria andTypeNotLike(String value) {
addCriterion("type not like", value, "type");
return (Criteria) this;
}
public Criteria andTypeIn(List<String> values) {
addCriterion("type in", values, "type");
return (Criteria) this;
}
public Criteria andTypeNotIn(List<String> values) {
addCriterion("type not in", values, "type");
return (Criteria) this;
}
public Criteria andTypeBetween(String value1, String value2) {
addCriterion("type between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andTypeNotBetween(String value1, String value2) {
addCriterion("type not between", value1, value2, "type");
return (Criteria) this;
}
public Criteria andIsDictInfoIsNull() {
addCriterion("is_dict_Info is null");
return (Criteria) this;
}
public Criteria andIsDictInfoIsNotNull() {
addCriterion("is_dict_Info is not null");
return (Criteria) this;
}
public Criteria andIsDictInfoEqualTo(Boolean value) {
addCriterion("is_dict_Info =", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoNotEqualTo(Boolean value) {
addCriterion("is_dict_Info <>", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoGreaterThan(Boolean value) {
addCriterion("is_dict_Info >", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_dict_Info >=", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoLessThan(Boolean value) {
addCriterion("is_dict_Info <", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoLessThanOrEqualTo(Boolean value) {
addCriterion("is_dict_Info <=", value, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoIn(List<Boolean> values) {
addCriterion("is_dict_Info in", values, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoNotIn(List<Boolean> values) {
addCriterion("is_dict_Info not in", values, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoBetween(Boolean value1, Boolean value2) {
addCriterion("is_dict_Info between", value1, value2, "isDictInfo");
return (Criteria) this;
}
public Criteria andIsDictInfoNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_dict_Info not between", value1, value2, "isDictInfo");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andCreatedByIsNull() {
addCriterion("created_by is null");
return (Criteria) this;
}
public Criteria andCreatedByIsNotNull() {
addCriterion("created_by is not null");
return (Criteria) this;
}
public Criteria andCreatedByEqualTo(String value) {
addCriterion("created_by =", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotEqualTo(String value) {
addCriterion("created_by <>", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThan(String value) {
addCriterion("created_by >", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByGreaterThanOrEqualTo(String value) {
addCriterion("created_by >=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThan(String value) {
addCriterion("created_by <", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLessThanOrEqualTo(String value) {
addCriterion("created_by <=", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByLike(String value) {
addCriterion("created_by like", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotLike(String value) {
addCriterion("created_by not like", value, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByIn(List<String> values) {
addCriterion("created_by in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotIn(List<String> values) {
addCriterion("created_by not in", values, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByBetween(String value1, String value2) {
addCriterion("created_by between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andCreatedByNotBetween(String value1, String value2) {
addCriterion("created_by not between", value1, value2, "createdBy");
return (Criteria) this;
}
public Criteria andUpdatedByIsNull() {
addCriterion("updated_by is null");
return (Criteria) this;
}
public Criteria andUpdatedByIsNotNull() {
addCriterion("updated_by is not null");
return (Criteria) this;
}
public Criteria andUpdatedByEqualTo(String value) {
addCriterion("updated_by =", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotEqualTo(String value) {
addCriterion("updated_by <>", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByGreaterThan(String value) {
addCriterion("updated_by >", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByGreaterThanOrEqualTo(String value) {
addCriterion("updated_by >=", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByLessThan(String value) {
addCriterion("updated_by <", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByLessThanOrEqualTo(String value) {
addCriterion("updated_by <=", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByLike(String value) {
addCriterion("updated_by like", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotLike(String value) {
addCriterion("updated_by not like", value, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByIn(List<String> values) {
addCriterion("updated_by in", values, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotIn(List<String> values) {
addCriterion("updated_by not in", values, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByBetween(String value1, String value2) {
addCriterion("updated_by between", value1, value2, "updatedBy");
return (Criteria) this;
}
public Criteria andUpdatedByNotBetween(String value1, String value2) {
addCriterion("updated_by not between", value1, value2, "updatedBy");
return (Criteria) this;
}
public Criteria andIsDeletedIsNull() {
addCriterion("is_deleted is null");
return (Criteria) this;
}
public Criteria andIsDeletedIsNotNull() {
addCriterion("is_deleted is not null");
return (Criteria) this;
}
public Criteria andIsDeletedEqualTo(Boolean value) {
addCriterion("is_deleted =", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotEqualTo(Boolean value) {
addCriterion("is_deleted <>", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThan(Boolean value) {
addCriterion("is_deleted >", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedGreaterThanOrEqualTo(Boolean value) {
addCriterion("is_deleted >=", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedLessThan(Boolean value) {
addCriterion("is_deleted <", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedLessThanOrEqualTo(Boolean value) {
addCriterion("is_deleted <=", value, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedIn(List<Boolean> values) {
addCriterion("is_deleted in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotIn(List<Boolean> values) {
addCriterion("is_deleted not in", values, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted between", value1, value2, "isDeleted");
return (Criteria) this;
}
public Criteria andIsDeletedNotBetween(Boolean value1, Boolean value2) {
addCriterion("is_deleted not between", value1, value2, "isDeleted");
return (Criteria) this;
}
}
/**
* s2_dictionary
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* s2_dictionary null
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
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;
}
}
}

View File

@@ -1,207 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
public class DictionaryTaskDO {
/**
*
*/
private Long id;
/**
* 主体域ID
*/
private Long domainId;
/**
* 任务最终运行状态
*/
private Integer status;
/**
* 任务耗时
*/
private Long elapsedMs;
/**
* 查询涉及的维度
*/
private String dimensions;
/**
* 查询涉及的指标
*/
private String metrics;
/**
* 查询的过滤信息
*/
private String filters;
/**
* 查询的排序信息
*/
private String orderBy;
/**
* 查询涉及的日期信息
*/
private String dateInfo;
/**
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 主体域ID
*
* @return domain_id 主体域ID
*/
public Long getDomainId() {
return domainId;
}
/**
* 主体域ID
*
* @param domainId 主体域ID
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
/**
* 任务最终运行状态
*
* @return status 任务最终运行状态
*/
public Integer getStatus() {
return status;
}
/**
* 任务最终运行状态
*
* @param status 任务最终运行状态
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 任务耗时
*
* @return elapsed_ms 任务耗时
*/
public Long getElapsedMs() {
return elapsedMs;
}
/**
* 任务耗时
*
* @param elapsedMs 任务耗时
*/
public void setElapsedMs(Long elapsedMs) {
this.elapsedMs = elapsedMs;
}
/**
* 查询涉及的维度
*
* @return dimensions 查询涉及的维度
*/
public String getDimensions() {
return dimensions;
}
/**
* 查询涉及的维度
*
* @param dimensions 查询涉及的维度
*/
public void setDimensions(String dimensions) {
this.dimensions = dimensions == null ? null : dimensions.trim();
}
/**
* 查询涉及的指标
*
* @return metrics 查询涉及的指标
*/
public String getMetrics() {
return metrics;
}
/**
* 查询涉及的指标
*
* @param metrics 查询涉及的指标
*/
public void setMetrics(String metrics) {
this.metrics = metrics == null ? null : metrics.trim();
}
/**
* 查询的过滤信息
*
* @return filters 查询的过滤信息
*/
public String getFilters() {
return filters;
}
/**
* 查询的过滤信息
*
* @param filters 查询的过滤信息
*/
public void setFilters(String filters) {
this.filters = filters == null ? null : filters.trim();
}
/**
* 查询的排序信息
*
* @return order_by 查询的排序信息
*/
public String getOrderBy() {
return orderBy;
}
/**
* 查询的排序信息
*
* @param orderBy 查询的排序信息
*/
public void setOrderBy(String orderBy) {
this.orderBy = orderBy == null ? null : orderBy.trim();
}
/**
* 查询涉及的日期信息
*
* @return date_info 查询涉及的日期信息
*/
public String getDateInfo() {
return dateInfo;
}
/**
* 查询涉及的日期信息
*
* @param dateInfo 查询涉及的日期信息
*/
public void setDateInfo(String dateInfo) {
this.dateInfo = dateInfo == null ? null : dateInfo.trim();
}
}

View File

@@ -1,532 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.ArrayList;
import java.util.List;
public class DictionaryTaskDOExample {
/**
* s2_dictionary_task
*/
protected String orderByClause;
/**
* s2_dictionary_task
*/
protected boolean distinct;
/**
* s2_dictionary_task
*/
protected List<Criteria> oredCriteria;
/**
* s2_dictionary_task
*/
protected Integer limitStart;
/**
* s2_dictionary_task
*/
protected Integer limitEnd;
/**
* @mbg.generated
*/
public DictionaryTaskDOExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
public void setOrderByClause(String orderByClause) {
this.orderByClause = orderByClause;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
public void setDistinct(boolean distinct) {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public List<Criteria> getOredCriteria() {
return oredCriteria;
}
/**
* @mbg.generated
*/
public void or(Criteria criteria) {
oredCriteria.add(criteria);
}
/**
* @mbg.generated
*/
public Criteria or() {
Criteria criteria = createCriteriaInternal();
oredCriteria.add(criteria);
return criteria;
}
/**
* @mbg.generated
*/
public Criteria createCriteria() {
Criteria criteria = createCriteriaInternal();
if (oredCriteria.size() == 0) {
oredCriteria.add(criteria);
}
return criteria;
}
/**
* @mbg.generated
*/
protected Criteria createCriteriaInternal() {
Criteria criteria = new Criteria();
return criteria;
}
/**
* @mbg.generated
*/
public void clear() {
oredCriteria.clear();
orderByClause = null;
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
public void setLimitStart(Integer limitStart) {
this.limitStart = limitStart;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* @mbg.generated
*/
public void setLimitEnd(Integer limitEnd) {
this.limitEnd = limitEnd;
}
/**
* s2_dictionary_task null
*/
protected abstract static class GeneratedCriteria {
protected List<Criterion> criteria;
protected GeneratedCriteria() {
super();
criteria = new ArrayList<Criterion>();
}
public boolean isValid() {
return criteria.size() > 0;
}
public List<Criterion> getAllCriteria() {
return criteria;
}
public List<Criterion> getCriteria() {
return criteria;
}
protected void addCriterion(String condition) {
if (condition == null) {
throw new RuntimeException("Value for condition cannot be null");
}
criteria.add(new Criterion(condition));
}
protected void addCriterion(String condition, Object value, String property) {
if (value == null) {
throw new RuntimeException("Value for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value));
}
protected void addCriterion(String condition, Object value1, Object value2, String property) {
if (value1 == null || value2 == null) {
throw new RuntimeException("Between values for " + property + " cannot be null");
}
criteria.add(new Criterion(condition, value1, value2));
}
public Criteria andIdIsNull() {
addCriterion("id is null");
return (Criteria) this;
}
public Criteria andIdIsNotNull() {
addCriterion("id is not null");
return (Criteria) this;
}
public Criteria andIdEqualTo(Long value) {
addCriterion("id =", value, "id");
return (Criteria) this;
}
public Criteria andIdNotEqualTo(Long value) {
addCriterion("id <>", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThan(Long value) {
addCriterion("id >", value, "id");
return (Criteria) this;
}
public Criteria andIdGreaterThanOrEqualTo(Long value) {
addCriterion("id >=", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThan(Long value) {
addCriterion("id <", value, "id");
return (Criteria) this;
}
public Criteria andIdLessThanOrEqualTo(Long value) {
addCriterion("id <=", value, "id");
return (Criteria) this;
}
public Criteria andIdIn(List<Long> values) {
addCriterion("id in", values, "id");
return (Criteria) this;
}
public Criteria andIdNotIn(List<Long> values) {
addCriterion("id not in", values, "id");
return (Criteria) this;
}
public Criteria andIdBetween(Long value1, Long value2) {
addCriterion("id between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andIdNotBetween(Long value1, Long value2) {
addCriterion("id not between", value1, value2, "id");
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
return (Criteria) this;
}
public Criteria andElapsedMsIsNull() {
addCriterion("elapsed_ms is null");
return (Criteria) this;
}
public Criteria andElapsedMsIsNotNull() {
addCriterion("elapsed_ms is not null");
return (Criteria) this;
}
public Criteria andElapsedMsEqualTo(Long value) {
addCriterion("elapsed_ms =", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsNotEqualTo(Long value) {
addCriterion("elapsed_ms <>", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsGreaterThan(Long value) {
addCriterion("elapsed_ms >", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsGreaterThanOrEqualTo(Long value) {
addCriterion("elapsed_ms >=", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsLessThan(Long value) {
addCriterion("elapsed_ms <", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsLessThanOrEqualTo(Long value) {
addCriterion("elapsed_ms <=", value, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsIn(List<Long> values) {
addCriterion("elapsed_ms in", values, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsNotIn(List<Long> values) {
addCriterion("elapsed_ms not in", values, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsBetween(Long value1, Long value2) {
addCriterion("elapsed_ms between", value1, value2, "elapsedMs");
return (Criteria) this;
}
public Criteria andElapsedMsNotBetween(Long value1, Long value2) {
addCriterion("elapsed_ms not between", value1, value2, "elapsedMs");
return (Criteria) this;
}
}
/**
* s2_dictionary_task
*/
public static class Criteria extends GeneratedCriteria {
protected Criteria() {
super();
}
}
/**
* s2_dictionary_task null
*/
public static class Criterion {
private String condition;
private Object value;
private Object secondValue;
private boolean noValue;
private boolean singleValue;
private boolean betweenValue;
private boolean listValue;
private String typeHandler;
protected Criterion(String condition) {
super();
this.condition = condition;
this.typeHandler = null;
this.noValue = true;
}
protected Criterion(String condition, Object value, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.typeHandler = typeHandler;
if (value instanceof List<?>) {
this.listValue = true;
} else {
this.singleValue = true;
}
}
protected Criterion(String condition, Object value) {
this(condition, value, null);
}
protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
super();
this.condition = condition;
this.value = value;
this.secondValue = secondValue;
this.typeHandler = typeHandler;
this.betweenValue = true;
}
protected Criterion(String condition, Object value, Object secondValue) {
this(condition, value, secondValue, null);
}
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;
}
}
}

View File

@@ -12,7 +12,7 @@ public class DimensionDO {
/**
* 主题域id
*/
private Long domainId;
private Long modelId;
/**
* 所属数据源id
@@ -84,6 +84,11 @@ public class DimensionDO {
*/
private String defaultValues;
/**
*
*/
private String dimValueMaps;
/**
* 类型参数
*/
@@ -94,11 +99,6 @@ public class DimensionDO {
*/
private String expr;
/**
* dimension value map info
*/
private String dimValueMaps;
/**
* 维度ID
*
@@ -120,19 +120,19 @@ public class DimensionDO {
/**
* 主题域id
*
* @return domain_id 主题域id
* @return model_id 主题域id
*/
public Long getDomainId() {
return domainId;
public Long getModelId() {
return modelId;
}
/**
* 主题域id
*
* @param domainId 主题域id
* @param modelId 主题域id
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**
@@ -383,6 +383,20 @@ public class DimensionDO {
this.defaultValues = defaultValues == null ? null : defaultValues.trim();
}
/**
* @return dim_value_maps
*/
public String getDimValueMaps() {
return dimValueMaps;
}
/**
* @param dimValueMaps
*/
public void setDimValueMaps(String dimValueMaps) {
this.dimValueMaps = dimValueMaps == null ? null : dimValueMaps.trim();
}
/**
* 类型参数
*
@@ -418,12 +432,4 @@ public class DimensionDO {
public void setExpr(String expr) {
this.expr = expr == null ? null : expr.trim();
}
public String getDimValueMaps() {
return dimValueMaps;
}
public void setDimValueMaps(String dimValueMaps) {
this.dimValueMaps = dimValueMaps;
}
}

View File

@@ -38,13 +38,6 @@ public class DimensionDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DimensionDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DimensionDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DimensionDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DimensionDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class DimensionDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_dimension null
*/
@@ -250,63 +250,63 @@ public class DimensionDOExample {
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
public Criteria andModelIdIsNull() {
addCriterion("model_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
public Criteria andModelIdIsNotNull() {
addCriterion("model_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
public Criteria andModelIdEqualTo(Long value) {
addCriterion("model_id =", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
public Criteria andModelIdNotEqualTo(Long value) {
addCriterion("model_id <>", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
public Criteria andModelIdGreaterThan(Long value) {
addCriterion("model_id >", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
public Criteria andModelIdGreaterThanOrEqualTo(Long value) {
addCriterion("model_id >=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
public Criteria andModelIdLessThan(Long value) {
addCriterion("model_id <", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
public Criteria andModelIdLessThanOrEqualTo(Long value) {
addCriterion("model_id <=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
public Criteria andModelIdIn(List<Long> values) {
addCriterion("model_id in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
public Criteria andModelIdNotIn(List<Long> values) {
addCriterion("model_id not in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
public Criteria andModelIdBetween(Long value1, Long value2) {
addCriterion("model_id between", value1, value2, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
public Criteria andModelIdNotBetween(Long value1, Long value2) {
addCriterion("model_id not between", value1, value2, "modelId");
return (Criteria) this;
}
@@ -1239,6 +1239,76 @@ public class DimensionDOExample {
addCriterion("default_values not between", value1, value2, "defaultValues");
return (Criteria) this;
}
public Criteria andDimValueMapsIsNull() {
addCriterion("dim_value_maps is null");
return (Criteria) this;
}
public Criteria andDimValueMapsIsNotNull() {
addCriterion("dim_value_maps is not null");
return (Criteria) this;
}
public Criteria andDimValueMapsEqualTo(String value) {
addCriterion("dim_value_maps =", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsNotEqualTo(String value) {
addCriterion("dim_value_maps <>", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsGreaterThan(String value) {
addCriterion("dim_value_maps >", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsGreaterThanOrEqualTo(String value) {
addCriterion("dim_value_maps >=", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsLessThan(String value) {
addCriterion("dim_value_maps <", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsLessThanOrEqualTo(String value) {
addCriterion("dim_value_maps <=", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsLike(String value) {
addCriterion("dim_value_maps like", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsNotLike(String value) {
addCriterion("dim_value_maps not like", value, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsIn(List<String> values) {
addCriterion("dim_value_maps in", values, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsNotIn(List<String> values) {
addCriterion("dim_value_maps not in", values, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsBetween(String value1, String value2) {
addCriterion("dim_value_maps between", value1, value2, "dimValueMaps");
return (Criteria) this;
}
public Criteria andDimValueMapsNotBetween(String value1, String value2) {
addCriterion("dim_value_maps not between", value1, value2, "dimValueMaps");
return (Criteria) this;
}
}
/**
@@ -1272,6 +1342,38 @@ public class DimensionDOExample {
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;
@@ -1307,37 +1409,5 @@ public class DimensionDOExample {
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;
}
}
}

View File

@@ -1,13 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import lombok.Data;
@Data
public class DimensionDOWithDictInfo extends DimensionDO {
private boolean isDictInfo;
}

View File

@@ -74,12 +74,6 @@ public class DomainDO {
*/
private String viewOrg;
/**
* 主题域实体信息
*/
private String entity;
/**
* 自增ID
*
@@ -331,12 +325,4 @@ public class DomainDO {
public void setViewOrg(String viewOrg) {
this.viewOrg = viewOrg == null ? null : viewOrg.trim();
}
public String getEntity() {
return entity;
}
public void setEntity(String entity) {
this.entity = entity;
}
}

View File

@@ -38,13 +38,6 @@ public class DomainDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DomainDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DomainDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DomainDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DomainDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class DomainDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_domain null
*/
@@ -1142,6 +1142,38 @@ public class DomainDOExample {
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;
@@ -1177,37 +1209,5 @@ public class DomainDOExample {
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;
}
}
}

View File

@@ -1,255 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.Date;
public class DomainExtendDO {
/**
*
*/
private Long id;
/**
* 主题域id
*/
private Long domainId;
/**
* 默认指标
*/
private String defaultMetrics;
/**
* 创建时间
*/
private Date createdAt;
/**
* 更新时间
*/
private Date updatedAt;
/**
* 创建人
*/
private String createdBy;
/**
* 更新人
*/
private String updatedBy;
/**
* 主题域扩展信息状态, 0-删除1-生效
*/
private Integer status;
/**
* 不可见指标信息
*/
private String metricsInvisible;
/**
* 不可见维度信息
*/
private String dimensionsInvisible;
/**
* 实体信息
*/
private String entityInfo;
/**
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 主题域id
*
* @return domain_id 主题域id
*/
public Long getDomainId() {
return domainId;
}
/**
* 主题域id
*
* @param domainId 主题域id
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
/**
* 默认指标
*
* @return default_metrics 默认指标
*/
public String getDefaultMetrics() {
return defaultMetrics;
}
/**
* 默认指标
*
* @param defaultMetrics 默认指标
*/
public void setDefaultMetrics(String defaultMetrics) {
this.defaultMetrics = defaultMetrics == null ? null : defaultMetrics.trim();
}
/**
* 创建时间
*
* @return created_at 创建时间
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* 创建时间
*
* @param createdAt 创建时间
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* 更新时间
*
* @return updated_at 更新时间
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* 更新时间
*
* @param updatedAt 更新时间
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* 创建人
*
* @return created_by 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 更新人
*
* @return updated_by 更新人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 更新人
*
* @param updatedBy 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 主题域扩展信息状态, 0-删除1-生效
*
* @return status 主题域扩展信息状态, 0-删除1-生效
*/
public Integer getStatus() {
return status;
}
/**
* 主题域扩展信息状态, 0-删除1-生效
*
* @param status 主题域扩展信息状态, 0-删除1-生效
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 不可见指标信息
*
* @return metrics_invisible 不可见指标信息
*/
public String getMetricsInvisible() {
return metricsInvisible;
}
/**
* 不可见指标信息
*
* @param metricsInvisible 不可见指标信息
*/
public void setMetricsInvisible(String metricsInvisible) {
this.metricsInvisible = metricsInvisible == null ? null : metricsInvisible.trim();
}
/**
* 不可见维度信息
*
* @return dimensions_invisible 不可见维度信息
*/
public String getDimensionsInvisible() {
return dimensionsInvisible;
}
/**
* 不可见维度信息
*
* @param dimensionsInvisible 不可见维度信息
*/
public void setDimensionsInvisible(String dimensionsInvisible) {
this.dimensionsInvisible = dimensionsInvisible == null ? null : dimensionsInvisible.trim();
}
/**
* 实体信息
*
* @return entity_info 实体信息
*/
public String getEntityInfo() {
return entityInfo;
}
/**
* 实体信息
*
* @param entityInfo 实体信息
*/
public void setEntityInfo(String entityInfo) {
this.entityInfo = entityInfo == null ? null : entityInfo.trim();
}
}

View File

@@ -12,7 +12,7 @@ public class MetricDO {
/**
* 主体域ID
*/
private Long domainId;
private Long modelId;
/**
* 指标名称
@@ -101,19 +101,19 @@ public class MetricDO {
/**
* 主体域ID
*
* @return domain_id 主体域ID
* @return model_id 主体域ID
*/
public Long getDomainId() {
return domainId;
public Long getModelId() {
return modelId;
}
/**
* 主体域ID
*
* @param domainId 主体域ID
* @param modelId 主体域ID
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**

View File

@@ -38,13 +38,6 @@ public class MetricDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class MetricDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class MetricDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class MetricDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class MetricDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class MetricDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_metric null
*/
@@ -250,63 +250,63 @@ public class MetricDOExample {
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
public Criteria andModelIdIsNull() {
addCriterion("model_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
public Criteria andModelIdIsNotNull() {
addCriterion("model_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
public Criteria andModelIdEqualTo(Long value) {
addCriterion("model_id =", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
public Criteria andModelIdNotEqualTo(Long value) {
addCriterion("model_id <>", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
public Criteria andModelIdGreaterThan(Long value) {
addCriterion("model_id >", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
public Criteria andModelIdGreaterThanOrEqualTo(Long value) {
addCriterion("model_id >=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
public Criteria andModelIdLessThan(Long value) {
addCriterion("model_id <", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
public Criteria andModelIdLessThanOrEqualTo(Long value) {
addCriterion("model_id <=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
public Criteria andModelIdIn(List<Long> values) {
addCriterion("model_id in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
public Criteria andModelIdNotIn(List<Long> values) {
addCriterion("model_id not in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
public Criteria andModelIdBetween(Long value1, Long value2) {
addCriterion("model_id between", value1, value2, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
public Criteria andModelIdNotBetween(Long value1, Long value2) {
addCriterion("model_id not between", value1, value2, "modelId");
return (Criteria) this;
}
@@ -1212,6 +1212,38 @@ public class MetricDOExample {
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;
@@ -1247,37 +1279,5 @@ public class MetricDOExample {
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;
}
}
}

View File

@@ -0,0 +1,272 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.Date;
public class ModelDO {
/**
*
*/
private Long id;
/**
*
*/
private String name;
/**
*
*/
private String bizName;
/**
*
*/
private Long domainId;
/**
*
*/
private String viewer;
/**
*
*/
private String viewOrg;
/**
*
*/
private String admin;
/**
*
*/
private String adminOrg;
/**
*
*/
private Integer isOpen;
/**
*
*/
private String createdBy;
/**
*
*/
private Date createdAt;
/**
*
*/
private String updatedBy;
/**
*
*/
private Date updatedAt;
/**
*
*/
private String entity;
/**
* @return id
*/
public Long getId() {
return id;
}
/**
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* @return name
*/
public String getName() {
return name;
}
/**
* @param name
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* @return biz_name
*/
public String getBizName() {
return bizName;
}
/**
* @param bizName
*/
public void setBizName(String bizName) {
this.bizName = bizName == null ? null : bizName.trim();
}
/**
* @return domain_id
*/
public Long getDomainId() {
return domainId;
}
/**
* @param domainId
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
}
/**
* @return viewer
*/
public String getViewer() {
return viewer;
}
/**
* @param viewer
*/
public void setViewer(String viewer) {
this.viewer = viewer == null ? null : viewer.trim();
}
/**
* @return view_org
*/
public String getViewOrg() {
return viewOrg;
}
/**
* @param viewOrg
*/
public void setViewOrg(String viewOrg) {
this.viewOrg = viewOrg == null ? null : viewOrg.trim();
}
/**
* @return admin
*/
public String getAdmin() {
return admin;
}
/**
* @param admin
*/
public void setAdmin(String admin) {
this.admin = admin == null ? null : admin.trim();
}
/**
* @return admin_org
*/
public String getAdminOrg() {
return adminOrg;
}
/**
* @param adminOrg
*/
public void setAdminOrg(String adminOrg) {
this.adminOrg = adminOrg == null ? null : adminOrg.trim();
}
/**
* @return is_open
*/
public Integer getIsOpen() {
return isOpen;
}
/**
* @param isOpen
*/
public void setIsOpen(Integer isOpen) {
this.isOpen = isOpen;
}
/**
* @return created_by
*/
public String getCreatedBy() {
return createdBy;
}
/**
* @param createdBy
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* @return created_at
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* @param createdAt
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* @return updated_by
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* @param updatedBy
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* @return updated_at
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* @param updatedAt
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* @return entity
*/
public String getEntity() {
return entity;
}
/**
* @param entity
*/
public void setEntity(String entity) {
this.entity = entity == null ? null : entity.trim();
}
}

View File

@@ -4,47 +4,40 @@ import java.util.ArrayList;
import java.util.Date;
import java.util.List;
public class DomainExtendDOExample {
public class ModelDOExample {
/**
* s2_domain_extend
* s2_model
*/
protected String orderByClause;
/**
* s2_domain_extend
* s2_model
*/
protected boolean distinct;
/**
* s2_domain_extend
* s2_model
*/
protected List<Criteria> oredCriteria;
/**
* s2_domain_extend
* s2_model
*/
protected Integer limitStart;
/**
* s2_domain_extend
* s2_model
*/
protected Integer limitEnd;
/**
* @mbg.generated
*/
public DomainExtendDOExample() {
public ModelDOExample() {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class DomainExtendDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class DomainExtendDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class DomainExtendDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class DomainExtendDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -146,7 +139,14 @@ public class DomainExtendDOExample {
}
/**
* s2_domain_extend null
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_model null
*/
protected abstract static class GeneratedCriteria {
@@ -250,6 +250,146 @@ public class DomainExtendDOExample {
return (Criteria) this;
}
public Criteria andNameIsNull() {
addCriterion("name is null");
return (Criteria) this;
}
public Criteria andNameIsNotNull() {
addCriterion("name is not null");
return (Criteria) this;
}
public Criteria andNameEqualTo(String value) {
addCriterion("name =", value, "name");
return (Criteria) this;
}
public Criteria andNameNotEqualTo(String value) {
addCriterion("name <>", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThan(String value) {
addCriterion("name >", value, "name");
return (Criteria) this;
}
public Criteria andNameGreaterThanOrEqualTo(String value) {
addCriterion("name >=", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThan(String value) {
addCriterion("name <", value, "name");
return (Criteria) this;
}
public Criteria andNameLessThanOrEqualTo(String value) {
addCriterion("name <=", value, "name");
return (Criteria) this;
}
public Criteria andNameLike(String value) {
addCriterion("name like", value, "name");
return (Criteria) this;
}
public Criteria andNameNotLike(String value) {
addCriterion("name not like", value, "name");
return (Criteria) this;
}
public Criteria andNameIn(List<String> values) {
addCriterion("name in", values, "name");
return (Criteria) this;
}
public Criteria andNameNotIn(List<String> values) {
addCriterion("name not in", values, "name");
return (Criteria) this;
}
public Criteria andNameBetween(String value1, String value2) {
addCriterion("name between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andNameNotBetween(String value1, String value2) {
addCriterion("name not between", value1, value2, "name");
return (Criteria) this;
}
public Criteria andBizNameIsNull() {
addCriterion("biz_name is null");
return (Criteria) this;
}
public Criteria andBizNameIsNotNull() {
addCriterion("biz_name is not null");
return (Criteria) this;
}
public Criteria andBizNameEqualTo(String value) {
addCriterion("biz_name =", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameNotEqualTo(String value) {
addCriterion("biz_name <>", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameGreaterThan(String value) {
addCriterion("biz_name >", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameGreaterThanOrEqualTo(String value) {
addCriterion("biz_name >=", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameLessThan(String value) {
addCriterion("biz_name <", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameLessThanOrEqualTo(String value) {
addCriterion("biz_name <=", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameLike(String value) {
addCriterion("biz_name like", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameNotLike(String value) {
addCriterion("biz_name not like", value, "bizName");
return (Criteria) this;
}
public Criteria andBizNameIn(List<String> values) {
addCriterion("biz_name in", values, "bizName");
return (Criteria) this;
}
public Criteria andBizNameNotIn(List<String> values) {
addCriterion("biz_name not in", values, "bizName");
return (Criteria) this;
}
public Criteria andBizNameBetween(String value1, String value2) {
addCriterion("biz_name between", value1, value2, "bizName");
return (Criteria) this;
}
public Criteria andBizNameNotBetween(String value1, String value2) {
addCriterion("biz_name not between", value1, value2, "bizName");
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
return (Criteria) this;
@@ -310,188 +450,343 @@ public class DomainExtendDOExample {
return (Criteria) this;
}
public Criteria andDefaultMetricsIsNull() {
addCriterion("default_metrics is null");
public Criteria andViewerIsNull() {
addCriterion("viewer is null");
return (Criteria) this;
}
public Criteria andDefaultMetricsIsNotNull() {
addCriterion("default_metrics is not null");
public Criteria andViewerIsNotNull() {
addCriterion("viewer is not null");
return (Criteria) this;
}
public Criteria andDefaultMetricsEqualTo(String value) {
addCriterion("default_metrics =", value, "defaultMetrics");
public Criteria andViewerEqualTo(String value) {
addCriterion("viewer =", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsNotEqualTo(String value) {
addCriterion("default_metrics <>", value, "defaultMetrics");
public Criteria andViewerNotEqualTo(String value) {
addCriterion("viewer <>", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsGreaterThan(String value) {
addCriterion("default_metrics >", value, "defaultMetrics");
public Criteria andViewerGreaterThan(String value) {
addCriterion("viewer >", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsLessThan(String value) {
addCriterion("default_metrics <", value, "defaultMetrics");
public Criteria andViewerGreaterThanOrEqualTo(String value) {
addCriterion("viewer >=", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsLessThanOrEqualTo(String value) {
addCriterion("default_metrics <=", value, "defaultMetrics");
public Criteria andViewerLessThan(String value) {
addCriterion("viewer <", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsLike(String value) {
addCriterion("default_metrics like", value, "defaultMetrics");
public Criteria andViewerLessThanOrEqualTo(String value) {
addCriterion("viewer <=", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsNotLike(String value) {
addCriterion("default_metrics not like", value, "defaultMetrics");
public Criteria andViewerLike(String value) {
addCriterion("viewer like", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsIn(List<String> values) {
addCriterion("default_metrics in", values, "defaultMetrics");
public Criteria andViewerNotLike(String value) {
addCriterion("viewer not like", value, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsNotIn(List<String> values) {
addCriterion("default_metrics not in", values, "defaultMetrics");
public Criteria andViewerIn(List<String> values) {
addCriterion("viewer in", values, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsBetween(String value1, String value2) {
addCriterion("default_metrics between", value1, value2, "defaultMetrics");
public Criteria andViewerNotIn(List<String> values) {
addCriterion("viewer not in", values, "viewer");
return (Criteria) this;
}
public Criteria andDefaultMetricsNotBetween(String value1, String value2) {
addCriterion("default_metrics not between", value1, value2, "defaultMetrics");
public Criteria andViewerBetween(String value1, String value2) {
addCriterion("viewer between", value1, value2, "viewer");
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
public Criteria andViewerNotBetween(String value1, String value2) {
addCriterion("viewer not between", value1, value2, "viewer");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
public Criteria andViewOrgIsNull() {
addCriterion("view_org is null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
public Criteria andViewOrgIsNotNull() {
addCriterion("view_org is not null");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
public Criteria andViewOrgEqualTo(String value) {
addCriterion("view_org =", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
public Criteria andViewOrgNotEqualTo(String value) {
addCriterion("view_org <>", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
public Criteria andViewOrgGreaterThan(String value) {
addCriterion("view_org >", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
public Criteria andViewOrgGreaterThanOrEqualTo(String value) {
addCriterion("view_org >=", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
public Criteria andViewOrgLessThan(String value) {
addCriterion("view_org <", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
public Criteria andViewOrgLessThanOrEqualTo(String value) {
addCriterion("view_org <=", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
public Criteria andViewOrgLike(String value) {
addCriterion("view_org like", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
public Criteria andViewOrgNotLike(String value) {
addCriterion("view_org not like", value, "viewOrg");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
public Criteria andViewOrgIn(List<String> values) {
addCriterion("view_org in", values, "viewOrg");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
public Criteria andViewOrgNotIn(List<String> values) {
addCriterion("view_org not in", values, "viewOrg");
return (Criteria) this;
}
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
public Criteria andViewOrgBetween(String value1, String value2) {
addCriterion("view_org between", value1, value2, "viewOrg");
return (Criteria) this;
}
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
public Criteria andViewOrgNotBetween(String value1, String value2) {
addCriterion("view_org not between", value1, value2, "viewOrg");
return (Criteria) this;
}
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
public Criteria andAdminIsNull() {
addCriterion("admin is null");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
public Criteria andAdminIsNotNull() {
addCriterion("admin is not null");
return (Criteria) this;
}
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
public Criteria andAdminEqualTo(String value) {
addCriterion("admin =", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
public Criteria andAdminNotEqualTo(String value) {
addCriterion("admin <>", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
public Criteria andAdminGreaterThan(String value) {
addCriterion("admin >", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
public Criteria andAdminGreaterThanOrEqualTo(String value) {
addCriterion("admin >=", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
public Criteria andAdminLessThan(String value) {
addCriterion("admin <", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
public Criteria andAdminLessThanOrEqualTo(String value) {
addCriterion("admin <=", value, "admin");
return (Criteria) this;
}
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
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 andAdminOrgIsNull() {
addCriterion("admin_org is null");
return (Criteria) this;
}
public Criteria andAdminOrgIsNotNull() {
addCriterion("admin_org is not null");
return (Criteria) this;
}
public Criteria andAdminOrgEqualTo(String value) {
addCriterion("admin_org =", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgNotEqualTo(String value) {
addCriterion("admin_org <>", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgGreaterThan(String value) {
addCriterion("admin_org >", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgGreaterThanOrEqualTo(String value) {
addCriterion("admin_org >=", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgLessThan(String value) {
addCriterion("admin_org <", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgLessThanOrEqualTo(String value) {
addCriterion("admin_org <=", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgLike(String value) {
addCriterion("admin_org like", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgNotLike(String value) {
addCriterion("admin_org not like", value, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgIn(List<String> values) {
addCriterion("admin_org in", values, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgNotIn(List<String> values) {
addCriterion("admin_org not in", values, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgBetween(String value1, String value2) {
addCriterion("admin_org between", value1, value2, "adminOrg");
return (Criteria) this;
}
public Criteria andAdminOrgNotBetween(String value1, String value2) {
addCriterion("admin_org not between", value1, value2, "adminOrg");
return (Criteria) this;
}
public Criteria andIsOpenIsNull() {
addCriterion("is_open is null");
return (Criteria) this;
}
public Criteria andIsOpenIsNotNull() {
addCriterion("is_open is not null");
return (Criteria) this;
}
public Criteria andIsOpenEqualTo(Integer value) {
addCriterion("is_open =", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenNotEqualTo(Integer value) {
addCriterion("is_open <>", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenGreaterThan(Integer value) {
addCriterion("is_open >", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenGreaterThanOrEqualTo(Integer value) {
addCriterion("is_open >=", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenLessThan(Integer value) {
addCriterion("is_open <", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenLessThanOrEqualTo(Integer value) {
addCriterion("is_open <=", value, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenIn(List<Integer> values) {
addCriterion("is_open in", values, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenNotIn(List<Integer> values) {
addCriterion("is_open not in", values, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenBetween(Integer value1, Integer value2) {
addCriterion("is_open between", value1, value2, "isOpen");
return (Criteria) this;
}
public Criteria andIsOpenNotBetween(Integer value1, Integer value2) {
addCriterion("is_open not between", value1, value2, "isOpen");
return (Criteria) this;
}
@@ -565,6 +860,66 @@ public class DomainExtendDOExample {
return (Criteria) this;
}
public Criteria andCreatedAtIsNull() {
addCriterion("created_at is null");
return (Criteria) this;
}
public Criteria andCreatedAtIsNotNull() {
addCriterion("created_at is not null");
return (Criteria) this;
}
public Criteria andCreatedAtEqualTo(Date value) {
addCriterion("created_at =", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotEqualTo(Date value) {
addCriterion("created_at <>", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThan(Date value) {
addCriterion("created_at >", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("created_at >=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThan(Date value) {
addCriterion("created_at <", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtLessThanOrEqualTo(Date value) {
addCriterion("created_at <=", value, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtIn(List<Date> values) {
addCriterion("created_at in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotIn(List<Date> values) {
addCriterion("created_at not in", values, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtBetween(Date value1, Date value2) {
addCriterion("created_at between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andCreatedAtNotBetween(Date value1, Date value2) {
addCriterion("created_at not between", value1, value2, "createdAt");
return (Criteria) this;
}
public Criteria andUpdatedByIsNull() {
addCriterion("updated_by is null");
return (Criteria) this;
@@ -635,69 +990,69 @@ public class DomainExtendDOExample {
return (Criteria) this;
}
public Criteria andStatusIsNull() {
addCriterion("status is null");
public Criteria andUpdatedAtIsNull() {
addCriterion("updated_at is null");
return (Criteria) this;
}
public Criteria andStatusIsNotNull() {
addCriterion("status is not null");
public Criteria andUpdatedAtIsNotNull() {
addCriterion("updated_at is not null");
return (Criteria) this;
}
public Criteria andStatusEqualTo(Integer value) {
addCriterion("status =", value, "status");
public Criteria andUpdatedAtEqualTo(Date value) {
addCriterion("updated_at =", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusNotEqualTo(Integer value) {
addCriterion("status <>", value, "status");
public Criteria andUpdatedAtNotEqualTo(Date value) {
addCriterion("updated_at <>", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusGreaterThan(Integer value) {
addCriterion("status >", value, "status");
public Criteria andUpdatedAtGreaterThan(Date value) {
addCriterion("updated_at >", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
addCriterion("status >=", value, "status");
public Criteria andUpdatedAtGreaterThanOrEqualTo(Date value) {
addCriterion("updated_at >=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusLessThan(Integer value) {
addCriterion("status <", value, "status");
public Criteria andUpdatedAtLessThan(Date value) {
addCriterion("updated_at <", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusLessThanOrEqualTo(Integer value) {
addCriterion("status <=", value, "status");
public Criteria andUpdatedAtLessThanOrEqualTo(Date value) {
addCriterion("updated_at <=", value, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusIn(List<Integer> values) {
addCriterion("status in", values, "status");
public Criteria andUpdatedAtIn(List<Date> values) {
addCriterion("updated_at in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusNotIn(List<Integer> values) {
addCriterion("status not in", values, "status");
public Criteria andUpdatedAtNotIn(List<Date> values) {
addCriterion("updated_at not in", values, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusBetween(Integer value1, Integer value2) {
addCriterion("status between", value1, value2, "status");
public Criteria andUpdatedAtBetween(Date value1, Date value2) {
addCriterion("updated_at between", value1, value2, "updatedAt");
return (Criteria) this;
}
public Criteria andStatusNotBetween(Integer value1, Integer value2) {
addCriterion("status not between", value1, value2, "status");
public Criteria andUpdatedAtNotBetween(Date value1, Date value2) {
addCriterion("updated_at not between", value1, value2, "updatedAt");
return (Criteria) this;
}
}
/**
* s2_domain_extend
* s2_model
*/
public static class Criteria extends GeneratedCriteria {
@@ -707,7 +1062,7 @@ public class DomainExtendDOExample {
}
/**
* s2_domain_extend null
* s2_model null
*/
public static class Criterion {
@@ -727,6 +1082,38 @@ public class DomainExtendDOExample {
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;
@@ -762,37 +1149,5 @@ public class DomainExtendDOExample {
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;
}
}
}

View File

@@ -1,16 +0,0 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import java.util.ArrayList;
import java.util.List;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UpdateDimValueDictBatchDO {
private List<Long> itemIdList = new ArrayList<>();
private String rules;
}

View File

@@ -12,7 +12,7 @@ public class ViewInfoDO {
/**
*
*/
private Long domainId;
private Long modelId;
/**
* datasource、dimension、metric
@@ -59,17 +59,17 @@ public class ViewInfoDO {
}
/**
* @return domain_id
* @return model_id
*/
public Long getDomainId() {
return domainId;
public Long getModelId() {
return modelId;
}
/**
* @param domainId
* @param modelId
*/
public void setDomainId(Long domainId) {
this.domainId = domainId;
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**

View File

@@ -38,13 +38,6 @@ public class ViewInfoDOExample {
oredCriteria = new ArrayList<Criteria>();
}
/**
* @mbg.generated
*/
public String getOrderByClause() {
return orderByClause;
}
/**
* @mbg.generated
*/
@@ -55,8 +48,8 @@ public class ViewInfoDOExample {
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
public String getOrderByClause() {
return orderByClause;
}
/**
@@ -66,6 +59,13 @@ public class ViewInfoDOExample {
this.distinct = distinct;
}
/**
* @mbg.generated
*/
public boolean isDistinct() {
return distinct;
}
/**
* @mbg.generated
*/
@@ -117,13 +117,6 @@ public class ViewInfoDOExample {
distinct = false;
}
/**
* @mbg.generated
*/
public Integer getLimitStart() {
return limitStart;
}
/**
* @mbg.generated
*/
@@ -134,8 +127,8 @@ public class ViewInfoDOExample {
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
public Integer getLimitStart() {
return limitStart;
}
/**
@@ -145,6 +138,13 @@ public class ViewInfoDOExample {
this.limitEnd = limitEnd;
}
/**
* @mbg.generated
*/
public Integer getLimitEnd() {
return limitEnd;
}
/**
* s2_view_info null
*/
@@ -250,63 +250,63 @@ public class ViewInfoDOExample {
return (Criteria) this;
}
public Criteria andDomainIdIsNull() {
addCriterion("domain_id is null");
public Criteria andModelIdIsNull() {
addCriterion("model_id is null");
return (Criteria) this;
}
public Criteria andDomainIdIsNotNull() {
addCriterion("domain_id is not null");
public Criteria andModelIdIsNotNull() {
addCriterion("model_id is not null");
return (Criteria) this;
}
public Criteria andDomainIdEqualTo(Long value) {
addCriterion("domain_id =", value, "domainId");
public Criteria andModelIdEqualTo(Long value) {
addCriterion("model_id =", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotEqualTo(Long value) {
addCriterion("domain_id <>", value, "domainId");
public Criteria andModelIdNotEqualTo(Long value) {
addCriterion("model_id <>", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThan(Long value) {
addCriterion("domain_id >", value, "domainId");
public Criteria andModelIdGreaterThan(Long value) {
addCriterion("model_id >", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdGreaterThanOrEqualTo(Long value) {
addCriterion("domain_id >=", value, "domainId");
public Criteria andModelIdGreaterThanOrEqualTo(Long value) {
addCriterion("model_id >=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThan(Long value) {
addCriterion("domain_id <", value, "domainId");
public Criteria andModelIdLessThan(Long value) {
addCriterion("model_id <", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdLessThanOrEqualTo(Long value) {
addCriterion("domain_id <=", value, "domainId");
public Criteria andModelIdLessThanOrEqualTo(Long value) {
addCriterion("model_id <=", value, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdIn(List<Long> values) {
addCriterion("domain_id in", values, "domainId");
public Criteria andModelIdIn(List<Long> values) {
addCriterion("model_id in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotIn(List<Long> values) {
addCriterion("domain_id not in", values, "domainId");
public Criteria andModelIdNotIn(List<Long> values) {
addCriterion("model_id not in", values, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdBetween(Long value1, Long value2) {
addCriterion("domain_id between", value1, value2, "domainId");
public Criteria andModelIdBetween(Long value1, Long value2) {
addCriterion("model_id between", value1, value2, "modelId");
return (Criteria) this;
}
public Criteria andDomainIdNotBetween(Long value1, Long value2) {
addCriterion("domain_id not between", value1, value2, "domainId");
public Criteria andModelIdNotBetween(Long value1, Long value2) {
addCriterion("model_id not between", value1, value2, "modelId");
return (Criteria) this;
}
@@ -672,6 +672,38 @@ public class ViewInfoDOExample {
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;
@@ -707,37 +739,5 @@ public class ViewInfoDOExample {
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;
}
}
}

View File

@@ -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;

View File

@@ -9,7 +9,7 @@ import lombok.Data;
@Data
public class Datasource extends SchemaItem {
private Long domainId;
private Long modelId;
private Long databaseId;

View File

@@ -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 lombok.Data;
import java.util.List;
import lombok.Data;
@Data
public class Dimension extends SchemaItem {
@@ -14,7 +14,7 @@ public class Dimension extends SchemaItem {
private String expr;
private Long domainId;
private Long modelId;
private Long datasourceId;

View File

@@ -1,10 +1,10 @@
package com.tencent.supersonic.semantic.model.domain.pojo;
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
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.Entity;
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
import com.tencent.supersonic.semantic.api.model.request.DomainReq;
import java.util.List;
import lombok.Data;
import org.springframework.beans.BeanUtils;

View File

@@ -9,7 +9,6 @@ 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;

View File

@@ -1,7 +1,7 @@
package com.tencent.supersonic.semantic.model.domain.pojo;
import lombok.Data;
import java.util.List;
import lombok.Data;
@Data
@@ -15,7 +15,7 @@ public class MetaFilter {
private String createdBy;
private List<Long> domainIds;
private List<Long> modelIds;
private Integer sensitiveLevel;

View File

@@ -10,7 +10,7 @@ import lombok.Data;
public class Metric extends SchemaItem {
private Long domainId;
private Long modelId;
//measure_proxy ratio expr cumulative derived
private String type;

View File

@@ -7,4 +7,6 @@ public class MetricFilter extends MetaFilter {
private String type;
private String key;
}

View File

@@ -0,0 +1,38 @@
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.ModelReq;
import java.util.List;
import lombok.Data;
import org.springframework.beans.BeanUtils;
@Data
public class Model extends SchemaItem {
private Long domainId;
private Integer isOpen;
private List<String> viewers;
private List<String> viewOrgs;
private List<String> admins;
private List<String> adminOrgs;
private Entity entity;
public static Model create(ModelReq modelReq) {
Model model = new Model();
BeanUtils.copyProperties(modelReq, model);
model.setStatus(StatusEnum.ONLINE.getCode());
return model;
}
}

View File

@@ -3,10 +3,8 @@ package com.tencent.supersonic.semantic.model.domain.repository;
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO;
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO;
import java.util.List;
public interface DatasourceRepository {
void createDatasource(DatasourceDO datasourceDO);
@@ -15,7 +13,7 @@ public interface DatasourceRepository {
List<DatasourceDO> getDatasourceList();
List<DatasourceDO> getDatasourceList(Long domainId);
List<DatasourceDO> getDatasourceList(Long modelId);
DatasourceDO getDatasourceById(Long id);
@@ -27,7 +25,7 @@ public interface DatasourceRepository {
DatasourceRelaDO getDatasourceRelaById(Long id);
List<DatasourceRelaDO> getDatasourceRelaList(Long domainId);
List<DatasourceRelaDO> getDatasourceRelaList(Long modelId);
void deleteDatasourceRela(Long id);
}

View File

@@ -4,7 +4,6 @@ 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 {

View File

@@ -4,7 +4,6 @@ import com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO;
import com.tencent.supersonic.semantic.model.domain.pojo.DimensionFilter;
import java.util.List;
public interface DimensionRepository {

View File

@@ -2,7 +2,6 @@ package com.tencent.supersonic.semantic.model.domain.repository;
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO;
import java.util.List;

View File

@@ -1,9 +1,8 @@
package com.tencent.supersonic.semantic.model.domain.repository;
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
import java.util.List;

View File

@@ -0,0 +1,18 @@
package com.tencent.supersonic.semantic.model.domain.repository;
import com.tencent.supersonic.semantic.model.domain.dataobject.ModelDO;
import java.util.List;
public interface ModelRepository {
void createModel(ModelDO modelDO);
void updateModel(ModelDO modelDO);
void deleteModel(Long id);
List<ModelDO> getModelList();
ModelDO getModelById(Long id);
}

View File

@@ -3,6 +3,8 @@ 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;
@@ -15,8 +17,6 @@ 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;
@@ -104,7 +104,7 @@ public class DatasourceConverter {
dimensionReq.setDescription(dim.getName());
dimensionReq.setSemanticType("CATEGORY");
dimensionReq.setDatasourceId(datasource.getId());
dimensionReq.setDomainId(datasource.getDomainId());
dimensionReq.setModelId(datasource.getModelId());
dimensionReq.setExpr(dim.getBizName());
dimensionReq.setType("categorical");
return dimensionReq;
@@ -114,9 +114,9 @@ public class DatasourceConverter {
measure.setDatasourceId(datasource.getId());
MetricReq metricReq = new MetricReq();
metricReq.setName(measure.getName());
metricReq.setBizName(measure.getBizName().replace(datasource.getBizName() + "_", ""));
metricReq.setBizName(measure.getBizName().replaceFirst(datasource.getBizName() + "_", ""));
metricReq.setDescription(measure.getName());
metricReq.setDomainId(datasource.getDomainId());
metricReq.setModelId(datasource.getModelId());
metricReq.setMetricType(MetricTypeEnum.ATOMIC);
MetricTypeParams exprTypeParams = new MetricTypeParams();
exprTypeParams.setExpr(measure.getBizName());
@@ -132,7 +132,7 @@ public class DatasourceConverter {
dimensionReq.setDescription(identify.getName());
dimensionReq.setSemanticType("CATEGORY");
dimensionReq.setDatasourceId(datasource.getId());
dimensionReq.setDomainId(datasource.getDomainId());
dimensionReq.setModelId(datasource.getModelId());
dimensionReq.setExpr(identify.getBizName());
dimensionReq.setType(identify.getType());
return dimensionReq;

View File

@@ -1,20 +1,18 @@
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.common.util.BeanMapper;
import com.tencent.supersonic.semantic.api.model.yaml.DimensionYamlTpl;
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,11 +44,11 @@ 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.getDomainId()) + dimensionDO.getBizName());
dimensionResp.setFullPath(fullPathMap.get(dimensionDO.getModelId()) + dimensionDO.getBizName());
dimensionResp.setDatasourceId(
datasourceRespMap.getOrDefault(dimensionResp.getDatasourceId(), new DatasourceResp()).getId());
dimensionResp.setDatasourceName(

View File

@@ -3,21 +3,17 @@ package com.tencent.supersonic.semantic.model.domain.utils;
import com.google.common.collect.Lists;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.common.util.JsonUtil;
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import com.tencent.supersonic.semantic.api.model.request.DomainReq;
import com.tencent.supersonic.semantic.api.model.response.DimensionResp;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.common.pojo.enums.StatusEnum;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Domain;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -41,7 +37,6 @@ public class DomainConvert {
domainDO.setAdminOrg(String.join(",", domain.getAdminOrgs()));
domainDO.setViewer(String.join(",", domain.getViewers()));
domainDO.setViewOrg(String.join(",", domain.getViewOrgs()));
domainDO.setEntity(JsonUtil.toString(domain.getEntity()));
return domainDO;
}
@@ -57,12 +52,11 @@ public class DomainConvert {
? Lists.newArrayList() : Arrays.asList(domainDO.getViewer().split(",")));
domainResp.setViewOrgs(StringUtils.isBlank(domainDO.getViewOrg())
? Lists.newArrayList() : Arrays.asList(domainDO.getViewOrg().split(",")));
domainResp.setEntity(JsonUtil.toObject(domainDO.getEntity(), Entity.class));
return domainResp;
}
public static DomainResp convert(DomainDO domainDO, Map<Long, String> domainFullPathMap,
Map<Long, List<DimensionResp>> dimensionMap, Map<Long, List<MetricResp>> metricMap) {
Map<Long, List<DimensionResp>> dimensionMap, Map<Long, List<MetricResp>> metricMap) {
DomainResp domainResp = convert(domainDO, domainFullPathMap);
domainResp.setDimensionCnt(dimensionMap.getOrDefault(domainResp.getId(), Lists.newArrayList()).size());
domainResp.setMetricCnt(metricMap.getOrDefault(domainResp.getId(), Lists.newArrayList()).size());

View File

@@ -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;

View File

@@ -3,15 +3,15 @@ package com.tencent.supersonic.semantic.model.domain.utils;
import com.alibaba.fastjson.JSONObject;
import com.google.common.collect.Lists;
import com.tencent.supersonic.common.pojo.DataFormat;
import com.tencent.supersonic.common.util.BeanMapper;
import com.tencent.supersonic.semantic.api.model.pojo.Measure;
import com.tencent.supersonic.semantic.api.model.pojo.MetricTypeParams;
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.api.model.yaml.MeasureYamlTpl;
import com.tencent.supersonic.semantic.api.model.yaml.MetricTypeParamsYamlTpl;
import com.tencent.supersonic.semantic.api.model.yaml.MetricYamlTpl;
import com.tencent.supersonic.semantic.api.model.request.MetricReq;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.MetricResp;
import com.tencent.supersonic.common.util.BeanMapper;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Metric;
import java.util.ArrayList;
@@ -54,15 +54,14 @@ public class MetricConverter {
}
public static MetricResp convert2MetricDesc(MetricDO metricDO, Map<Long, DomainResp> domainMap) {
public static MetricResp convert2MetricDesc(MetricDO metricDO, Map<Long, ModelResp> modelMap) {
MetricResp metricDesc = new MetricResp();
BeanUtils.copyProperties(metricDO, metricDesc);
metricDesc.setTypeParams(JSONObject.parseObject(metricDO.getTypeParams(), MetricTypeParams.class));
metricDesc.setDataFormat(JSONObject.parseObject(metricDO.getDataFormat(), DataFormat.class));
DomainResp domainResp = domainMap.get(metricDO.getDomainId());
if (domainResp != null) {
metricDesc.setFullPath(domainMap.get(metricDO.getDomainId()).getFullPath() + metricDO.getBizName());
metricDesc.setDomainName(domainMap.get(metricDO.getDomainId()).getName());
ModelResp modelResp = modelMap.get(metricDO.getModelId());
if (modelResp != null) {
metricDesc.setModelName(modelResp.getName());
}
return metricDesc;
}

View File

@@ -0,0 +1,71 @@
package com.tencent.supersonic.semantic.model.domain.utils;
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.JsonUtil;
import com.tencent.supersonic.semantic.api.model.pojo.Entity;
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
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 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 {
public static Model convert(ModelReq modelReq) {
Model model = new Model();
BeanUtils.copyProperties(modelReq, model);
model.setStatus(StatusEnum.ONLINE.getCode());
return model;
}
public static ModelDO convert(Model model, User user) {
ModelDO modelDO = new ModelDO();
BeanUtils.copyProperties(model, modelDO);
modelDO.setCreatedBy(user.getName());
modelDO.setUpdatedBy(user.getName());
modelDO.setCreatedAt(new Date());
modelDO.setUpdatedAt(new Date());
modelDO.setAdmin(String.join(",", model.getAdmins()));
modelDO.setAdminOrg(String.join(",", model.getAdminOrgs()));
modelDO.setViewer(String.join(",", model.getViewers()));
modelDO.setViewOrg(String.join(",", model.getViewOrgs()));
modelDO.setEntity(JsonUtil.toString(model.getEntity()));
return modelDO;
}
public static ModelResp convert(ModelDO modelDO) {
ModelResp modelResp = new ModelResp();
BeanUtils.copyProperties(modelDO, modelResp);
modelResp.setAdmins(StringUtils.isBlank(modelDO.getAdmin())
? Lists.newArrayList() : Arrays.asList(modelDO.getAdmin().split(",")));
modelResp.setAdminOrgs(StringUtils.isBlank(modelDO.getAdminOrg())
? Lists.newArrayList() : Arrays.asList(modelDO.getAdminOrg().split(",")));
modelResp.setViewers(StringUtils.isBlank(modelDO.getViewer())
? Lists.newArrayList() : Arrays.asList(modelDO.getViewer().split(",")));
modelResp.setViewOrgs(StringUtils.isBlank(modelDO.getViewOrg())
? Lists.newArrayList() : Arrays.asList(modelDO.getViewOrg().split(",")));
modelResp.setEntity(JsonUtil.toObject(modelDO.getEntity(), Entity.class));
return modelResp;
}
public static ModelResp convert(ModelDO modelDO,
Map<Long, DomainResp> domainRespMap) {
ModelResp modelResp = convert(modelDO);
DomainResp domainResp = domainRespMap.get(modelResp.getDomainId());
if (domainResp != null) {
String fullBizNamePath = domainResp.getFullPath() + modelResp.getBizName();
modelResp.setFullPath(fullBizNamePath);
}
return modelResp;
}
}

View File

@@ -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.semantic.api.model.enums.DataTypeEnum;
import com.tencent.supersonic.common.pojo.QueryColumn;
import com.tencent.supersonic.semantic.api.model.enums.DataTypeEnum;
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;

View File

@@ -2,7 +2,6 @@ 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;

View File

@@ -3,7 +3,6 @@ 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;

View File

@@ -2,7 +2,6 @@ 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;

View File

@@ -1,11 +1,9 @@
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 org.apache.ibatis.annotations.Mapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface DimensionDOMapper {

View File

@@ -2,7 +2,6 @@ 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;
@@ -48,4 +47,4 @@ public interface DomainDOMapper {
* @mbg.generated
*/
int updateByPrimaryKey(DomainDO record);
}
}

View File

@@ -1,13 +1,10 @@
package com.tencent.supersonic.semantic.model.infrastructure.mapper;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
import java.util.List;
import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface MetricDOCustomMapper {

View File

@@ -2,7 +2,6 @@ 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;
@@ -58,4 +57,4 @@ public interface MetricDOMapper {
* @mbg.generated
*/
int updateByPrimaryKey(MetricDO record);
}
}

View File

@@ -0,0 +1,76 @@
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);
}

View File

@@ -2,7 +2,6 @@ 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;

View File

@@ -40,7 +40,6 @@ public class DatabaseRepositoryImpl implements DatabaseRepository {
DatabaseDOExample databaseDOExample = new DatabaseDOExample();
databaseDOExample.createCriteria().andDomainIdEqualTo(domainId);
return databaseDOMapper.selectByExampleWithBLOBs(databaseDOExample);
}

View File

@@ -43,9 +43,9 @@ public class DatasourceRepositoryImpl implements DatasourceRepository {
}
@Override
public List<DatasourceDO> getDatasourceList(Long domainId) {
public List<DatasourceDO> getDatasourceList(Long modelId) {
DatasourceDOExample datasourceExample = new DatasourceDOExample();
datasourceExample.createCriteria().andDomainIdEqualTo(domainId);
datasourceExample.createCriteria().andModelIdEqualTo(modelId);
return datasourceMapper.selectByExampleWithBLOBs(datasourceExample);
}
@@ -76,9 +76,9 @@ public class DatasourceRepositoryImpl implements DatasourceRepository {
@Override
public List<DatasourceRelaDO> getDatasourceRelaList(Long domainId) {
public List<DatasourceRelaDO> getDatasourceRelaList(Long modelId) {
DatasourceRelaDOExample datasourceRelaDOExample = new DatasourceRelaDOExample();
datasourceRelaDOExample.createCriteria().andDomainIdEqualTo(domainId);
datasourceRelaDOExample.createCriteria().andModelIdEqualTo(modelId);
return datasourceRelaDOMapper.selectByExample(datasourceRelaDOExample);
}

View File

@@ -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;

View File

@@ -2,8 +2,8 @@ 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.repository.DimensionRepository;
import com.tencent.supersonic.semantic.model.domain.pojo.DimensionFilter;
import com.tencent.supersonic.semantic.model.domain.repository.DimensionRepository;
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DimensionDOCustomMapper;
import com.tencent.supersonic.semantic.model.infrastructure.mapper.DimensionDOMapper;
import java.util.List;
@@ -28,9 +28,7 @@ public class DimensionRepositoryImpl implements DimensionRepository {
@Override
public void createDimension(DimensionDO dimensionDO) {
dimensionDOMapper.insert(dimensionDO);
}
@Override
@@ -53,7 +51,7 @@ public class DimensionRepositoryImpl implements DimensionRepository {
@Override
public List<DimensionDO> getDimensionListOfDomain(Long domainId) {
DimensionDOExample dimensionDOExample = new DimensionDOExample();
dimensionDOExample.createCriteria().andDomainIdEqualTo(domainId);
dimensionDOExample.createCriteria().andModelIdEqualTo(domainId);
return dimensionDOMapper.selectByExampleWithBLOBs(dimensionDOExample);
}
@@ -98,8 +96,8 @@ public class DimensionRepositoryImpl implements DimensionRepository {
if (dimensionFilter.getCreatedBy() != null) {
dimensionDOExample.getOredCriteria().get(0).andCreatedByEqualTo(dimensionFilter.getCreatedBy());
}
if (CollectionUtils.isNotEmpty(dimensionFilter.getDomainIds())) {
dimensionDOExample.getOredCriteria().get(0).andDomainIdIn(dimensionFilter.getDomainIds());
if (CollectionUtils.isNotEmpty(dimensionFilter.getModelIds())) {
dimensionDOExample.getOredCriteria().get(0).andModelIdIn(dimensionFilter.getModelIds());
}
if (dimensionFilter.getSensitiveLevel() != null) {
dimensionDOExample.getOredCriteria().get(0).andSensitiveLevelEqualTo(dimensionFilter.getSensitiveLevel());

View File

@@ -5,7 +5,6 @@ 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;

View File

@@ -8,7 +8,6 @@ import com.tencent.supersonic.semantic.model.domain.repository.MetricRepository;
import com.tencent.supersonic.semantic.model.infrastructure.mapper.MetricDOCustomMapper;
import com.tencent.supersonic.semantic.model.infrastructure.mapper.MetricDOMapper;
import java.util.List;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;
@@ -45,7 +44,7 @@ public class MetricRepositoryImpl implements MetricRepository {
@Override
public List<MetricDO> getMetricList(Long domainId) {
MetricDOExample metricDOExample = new MetricDOExample();
metricDOExample.createCriteria().andDomainIdEqualTo(domainId);
metricDOExample.createCriteria().andModelIdEqualTo(domainId);
return metricDOMapper.selectByExampleWithBLOBs(metricDOExample);
}

View File

@@ -0,0 +1,43 @@
package com.tencent.supersonic.semantic.model.infrastructure.repository;
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;
@Component
public class ModelRepositoryImpl implements ModelRepository {
private ModelDOMapper modelDOMapper;
public ModelRepositoryImpl(ModelDOMapper modelDOMapper) {
this.modelDOMapper = modelDOMapper;
}
@Override
public void createModel(ModelDO modelDO) {
modelDOMapper.insert(modelDO);
}
@Override
public void updateModel(ModelDO modelDO) {
modelDOMapper.updateByPrimaryKeyWithBLOBs(modelDO);
}
@Override
public void deleteModel(Long id) {
modelDOMapper.deleteByPrimaryKey(id);
}
@Override
public List<ModelDO> getModelList() {
return modelDOMapper.selectByExampleWithBLOBs(new ModelDOExample());
}
@Override
public ModelDO getModelById(Long id) {
return modelDOMapper.selectByPrimaryKey(id);
}
}

View File

@@ -20,7 +20,7 @@ public class ViewInfoRepositoryImpl implements ViewInfoRepository {
@Override
public List<ViewInfoDO> getViewInfoList(Long domainId) {
ViewInfoDOExample viewInfoDOExample = new ViewInfoDOExample();
viewInfoDOExample.createCriteria().andDomainIdEqualTo(domainId);
viewInfoDOExample.createCriteria().andModelIdEqualTo(domainId);
return viewInfoDOMapper.selectByExampleWithBLOBs(viewInfoDOExample);
}

View File

@@ -35,7 +35,6 @@ public class DatabaseController {
return databaseService.testConnect(databaseReq, user);
}
@PostMapping("/createOrUpdateDatabase")
public DatabaseResp createOrUpdateDatabase(@RequestBody DatabaseReq databaseReq,
HttpServletRequest request,
@@ -56,7 +55,7 @@ public class DatabaseController {
@PostMapping("/executeSql")
public QueryResultWithSchemaResp executeSql(@RequestBody SqlExecuteReq sqlExecuteReq) {
return databaseService.executeSql(sqlExecuteReq.getSql(), sqlExecuteReq.getDomainId());
return databaseService.executeSql(sqlExecuteReq.getSql(), sqlExecuteReq.getModelId());
}
@RequestMapping("/getDbNames/{id}")

View File

@@ -49,14 +49,14 @@ public class DatasourceController {
return datasourceService.updateDatasource(datasourceReq, user);
}
@GetMapping("/getDatasourceList/{domainId}")
public List<DatasourceResp> getDatasourceList(@PathVariable("domainId") Long domainId) {
return datasourceService.getDatasourceListNoMeasurePrefix(domainId);
@GetMapping("/getDatasourceList/{modelId}")
public List<DatasourceResp> getDatasourceList(@PathVariable("modelId") Long modelId) {
return datasourceService.getDatasourceListNoMeasurePrefix(modelId);
}
@GetMapping("/getMeasureListOfDomain/{domainId}")
public List<MeasureResp> getMeasureListOfDomain(@PathVariable("domainId") Long domainId) {
return datasourceService.getMeasureListOfDomain(domainId);
@GetMapping("/getMeasureListOfModel/{modelId}")
public List<MeasureResp> getMeasureListOfModel(@PathVariable("modelId") Long modelId) {
return datasourceService.getMeasureListOfModel(modelId);
}
@@ -77,9 +77,9 @@ public class DatasourceController {
return datasourceService.createOrUpdateDatasourceRela(datasourceRelaReq, user);
}
@GetMapping("/getDatasourceRelaList/{domainId}")
public List<DatasourceRelaResp> getDatasourceRelaList(@PathVariable("domainId") Long domainId) {
return datasourceService.getDatasourceRelaList(domainId);
@GetMapping("/getDatasourceRelaList/{modelId}")
public List<DatasourceRelaResp> getDatasourceRelaList(@PathVariable("modelId") Long modelId) {
return datasourceService.getDatasourceRelaList(modelId);
}
@DeleteMapping("/deleteDatasourceRela/{id}")

View File

@@ -57,16 +57,16 @@ public class DimensionController {
}
@GetMapping("/getDimensionList/{domainId}")
public List<DimensionResp> getDimension(@PathVariable("domainId") Long domainId) {
return dimensionService.getDimensions(domainId);
@GetMapping("/getDimensionList/{modelId}")
public List<DimensionResp> getDimension(@PathVariable("modelId") Long modelId) {
return dimensionService.getDimensions(modelId);
}
@GetMapping("/{domainId}/{dimensionName}")
public DimensionResp getDimensionDescByNameAndId(@PathVariable("domainId") Long domainId,
@GetMapping("/{modelId}/{dimensionName}")
public DimensionResp getDimensionDescByNameAndId(@PathVariable("modelId") Long modelId,
@PathVariable("dimensionName") String dimensionBizName) {
return dimensionService.getDimension(dimensionBizName, domainId);
return dimensionService.getDimension(dimensionBizName, modelId);
}

View File

@@ -3,10 +3,8 @@ package com.tencent.supersonic.semantic.model.rest;
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.DomainReq;
import com.tencent.supersonic.semantic.api.model.request.DomainSchemaFilterReq;
import com.tencent.supersonic.semantic.api.model.request.DomainUpdateReq;
import com.tencent.supersonic.semantic.api.model.response.DomainResp;
import com.tencent.supersonic.semantic.api.model.response.DomainSchemaResp;
import com.tencent.supersonic.semantic.model.domain.DomainService;
import java.util.Arrays;
import java.util.List;
@@ -56,26 +54,13 @@ public class DomainController {
return true;
}
/**
* get domain list
*
* @param
*/
@GetMapping("/getDomainList")
public List<DomainResp> getDomainList(HttpServletRequest request,
HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
return domainService.getDomainListForAdmin(user.getName());
return domainService.getDomainListWithAdminAuth(user);
}
/**
* get domain by id
*
* @param id
* @return
*/
@GetMapping("/getDomain/{id}")
public DomainResp getDomain(@PathVariable("id") Long id) {
return domainService.getDomain(id);
@@ -87,13 +72,4 @@ public class DomainController {
.collect(Collectors.toList()));
}
@PostMapping("/schema")
public List<DomainSchemaResp> fetchDomainSchema(@RequestBody DomainSchemaFilterReq filter,
HttpServletRequest request,
HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
return domainService.fetchDomainSchema(filter, user);
}
}

View File

@@ -52,9 +52,9 @@ public class MetricController {
}
@GetMapping("/getMetricList/{domainId}")
public List<MetricResp> getMetricList(@PathVariable("domainId") Long domainId) {
return metricService.getMetrics(domainId);
@GetMapping("/getMetricList/{modelId}")
public List<MetricResp> getMetricList(@PathVariable("modelId") Long modelId) {
return metricService.getMetrics(modelId);
}
@@ -63,9 +63,9 @@ public class MetricController {
return metricService.queryMetric(pageMetrricReq);
}
@GetMapping("getMetric/{domainId}/{bizName}")
public MetricResp getMetric(@PathVariable("domainId") Long domainId, @PathVariable("bizName") String bizName) {
return metricService.getMetric(domainId, bizName);
@GetMapping("getMetric/{modelId}/{bizName}")
public MetricResp getMetric(@PathVariable("modelId") Long modelId, @PathVariable("bizName") String bizName) {
return metricService.getMetric(modelId, bizName);
}

View File

@@ -0,0 +1,77 @@
package com.tencent.supersonic.semantic.model.rest;
import com.tencent.supersonic.auth.api.authentication.pojo.User;
import com.tencent.supersonic.auth.api.authentication.utils.UserHolder;
import com.tencent.supersonic.common.pojo.enums.AuthType;
import com.tencent.supersonic.semantic.api.model.request.ModelReq;
import com.tencent.supersonic.semantic.api.model.response.ModelResp;
import com.tencent.supersonic.semantic.model.domain.ModelService;
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;
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;
@RestController
@RequestMapping("/api/semantic/model")
public class ModelController {
private ModelService modelService;
public ModelController(ModelService modelService) {
this.modelService = modelService;
}
@PostMapping("/createModel")
public Boolean createModel(@RequestBody ModelReq modelReq,
HttpServletRequest request,
HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
modelService.createModel(modelReq, user);
return true;
}
@PostMapping("/updateModel")
public Boolean updateModel(@RequestBody ModelReq modelReq,
HttpServletRequest request,
HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
modelService.updateModel(modelReq, user);
return true;
}
@DeleteMapping("/deleteModel/{modelId}")
public Boolean deleteModel(@PathVariable("modelId") Long modelId) {
modelService.deleteModel(modelId);
return true;
}
@GetMapping("/getModelList/{domainId}")
public List<ModelResp> getModelList(@PathVariable("domainId") Long domainId,
HttpServletRequest request,
HttpServletResponse response) {
User user = UserHolder.findUser(request, response);
return modelService.getModelListWithAuth(user.getName(), domainId, AuthType.ADMIN);
}
@GetMapping("/getModel/{id}")
public ModelResp getModel(@PathVariable("id") Long id) {
return modelService.getModel(id);
}
@GetMapping("/getModelListByIds/{modelIds}")
public List<ModelResp> getModelListByIds(@PathVariable("modelIds") String modelIds) {
return modelService.getModelList(Arrays.stream(modelIds.split(",")).map(Long::parseLong)
.collect(Collectors.toList()));
}
}

View File

@@ -4,10 +4,9 @@ package com.tencent.supersonic.semantic.model.rest;
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.DomainSchemaRelaResp;
import com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO;
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 java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -37,9 +36,9 @@ public class ViewInfoController {
return viewInfoServiceImpl.createOrUpdateViewInfo(viewInfoReq, user);
}
@GetMapping("/getViewInfoList/{domainId}")
public List<ViewInfoDO> getViewInfoList(@PathVariable("domainId") Long domainId) {
return viewInfoServiceImpl.getViewInfoList(domainId);
@GetMapping("/getViewInfoList/{modelId}")
public List<ViewInfoDO> getViewInfoList(@PathVariable("modelId") Long modelId) {
return viewInfoServiceImpl.getViewInfoList(modelId);
}
@DeleteMapping("/deleteViewInfo/{id}")
@@ -47,9 +46,9 @@ public class ViewInfoController {
viewInfoServiceImpl.deleteViewInfo(id);
}
@GetMapping("/getDomainSchemaRela/{domainId}")
public List<DomainSchemaRelaResp> getDomainSchema(@PathVariable("domainId") Long domainId) {
return viewInfoServiceImpl.getDomainSchema(domainId);
@GetMapping("/getDomainSchemaRela/{modelId}")
public List<ModelSchemaRelaResp> getDomainSchema(@PathVariable("modelId") Long modelId) {
return viewInfoServiceImpl.getDomainSchema(modelId);
}

View File

@@ -52,7 +52,8 @@
</sql>
<sql id="Base_Column_List">
id
, domain_id, name, description, version, type, created_at, created_by, updated_at, updated_by
, domain_id, name, description, version, type, created_at, created_by, updated_at,
updated_by
</sql>
<sql id="Blob_Column_List">
config
@@ -110,15 +111,15 @@
<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)
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})
#{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">
@@ -245,7 +246,7 @@
set domain_id = #{domainId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=VARCHAR},
@@ -260,7 +261,7 @@
set domain_id = #{domainId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
version = #{version,jdbcType=VARCHAR},
type = #{type,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=VARCHAR},

View File

@@ -5,7 +5,7 @@
<resultMap id="BaseResultMap"
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
<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"/>
@@ -52,8 +52,8 @@
</sql>
<sql id="Base_Column_List">
id
, domain_id, name, biz_name, description, database_id, created_at, created_by,
updated_at, updated_by
, model_id, name, biz_name, description, database_id, created_at, created_by, updated_at,
updated_by
</sql>
<sql id="Blob_Column_List">
datasource_detail
@@ -110,11 +110,11 @@
</delete>
<insert id="insert"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
insert into s2_datasource (id, domain_id, name,
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}, #{domainId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
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},
@@ -128,8 +128,8 @@
<if test="id != null">
id,
</if>
<if test="domainId != null">
domain_id,
<if test="modelId != null">
model_id,
</if>
<if test="name != null">
name,
@@ -163,8 +163,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="domainId != null">
#{domainId,jdbcType=BIGINT},
<if test="modelId != null">
#{modelId,jdbcType=BIGINT},
</if>
<if test="name != null">
#{name,jdbcType=VARCHAR},
@@ -207,8 +207,8 @@
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
update s2_datasource
<set>
<if test="domainId != null">
domain_id = #{domainId,jdbcType=BIGINT},
<if test="modelId != null">
model_id = #{modelId,jdbcType=BIGINT},
</if>
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
@@ -243,7 +243,7 @@
<update id="updateByPrimaryKeyWithBLOBs"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
update s2_datasource
set domain_id = #{domainId,jdbcType=BIGINT},
set model_id = #{modelId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
biz_name = #{bizName,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},
@@ -258,7 +258,7 @@
<update id="updateByPrimaryKey"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
update s2_datasource
set domain_id = #{domainId,jdbcType=BIGINT},
set model_id = #{modelId,jdbcType=BIGINT},
name = #{name,jdbcType=VARCHAR},
biz_name = #{bizName,jdbcType=VARCHAR},
description = #{description,jdbcType=VARCHAR},

View File

@@ -5,7 +5,7 @@
<resultMap id="BaseResultMap"
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
<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"/>
@@ -47,8 +47,8 @@
</sql>
<sql id="Base_Column_List">
id
, domain_id, datasource_from, datasource_to, join_key, created_at, created_by,
updated_at, updated_by
, 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"
@@ -82,10 +82,10 @@
</delete>
<insert id="insert"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
insert into s2_datasource_rela (id, domain_id, datasource_from,
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}, #{domainId,jdbcType=BIGINT},
values (#{id,jdbcType=BIGINT}, #{modelId,jdbcType=BIGINT},
#{datasourceFrom,jdbcType=BIGINT},
#{datasourceTo,jdbcType=BIGINT}, #{joinKey,jdbcType=VARCHAR},
#{createdAt,jdbcType=TIMESTAMP},
@@ -99,8 +99,8 @@
<if test="id != null">
id,
</if>
<if test="domainId != null">
domain_id,
<if test="modelId != null">
model_id,
</if>
<if test="datasourceFrom != null">
datasource_from,
@@ -128,8 +128,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="domainId != null">
#{domainId,jdbcType=BIGINT},
<if test="modelId != null">
#{modelId,jdbcType=BIGINT},
</if>
<if test="datasourceFrom != null">
#{datasourceFrom,jdbcType=BIGINT},
@@ -166,8 +166,8 @@
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
update s2_datasource_rela
<set>
<if test="domainId != null">
domain_id = #{domainId,jdbcType=BIGINT},
<if test="modelId != null">
model_id = #{modelId,jdbcType=BIGINT},
</if>
<if test="datasourceFrom != null">
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
@@ -196,7 +196,7 @@
<update id="updateByPrimaryKey"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
update s2_datasource_rela
set domain_id = #{domainId,jdbcType=BIGINT},
set model_id = #{modelId,jdbcType=BIGINT},
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
datasource_to = #{datasourceTo,jdbcType=BIGINT},
join_key = #{joinKey,jdbcType=VARCHAR},

View File

@@ -1,355 +1,378 @@
<?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="domain_id" jdbcType="BIGINT" property="domainId" />
<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>
<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>
</foreach>
</trim>
</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>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, domain_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, domain_id, datasource_id,
name, biz_name, description,
status, sensitive_level, type,
created_at, created_by, updated_at,
updated_by, semantic_type, alias,
default_values, type_params, expr,
dim_value_maps
)
values (#{id,jdbcType=BIGINT}, #{domainId,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}, #{typeParams,jdbcType=LONGVARCHAR}, #{expr,jdbcType=LONGVARCHAR},
#{dimValueMaps,jdbcType=VARCHAR}
)
</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="domainId != null">
domain_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="domainId != null">
#{domainId,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="domainId != null">
domain_id = #{domainId,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 domain_id = #{domainId,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 domain_id = #{domainId,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>
<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>

View File

@@ -18,7 +18,6 @@
<result column="is_open" jdbcType="INTEGER" property="isOpen"/>
<result column="viewer" jdbcType="VARCHAR" property="viewer"/>
<result column="view_org" jdbcType="VARCHAR" property="viewOrg"/>
<result column="entity" jdbcType="VARCHAR" property="entity"/>
</resultMap>
<sql id="Example_Where_Clause">
<where>
@@ -54,7 +53,7 @@
<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, entity
admin, admin_org, is_open, viewer, view_org
</sql>
<select id="selectByExample"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample"
@@ -92,14 +91,14 @@
parent_id, status, created_at,
created_by, updated_at, updated_by,
admin, admin_org, is_open,
viewer, view_org, entity)
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}, #{entity,jdbcType=VARCHAR})
#{viewer,jdbcType=VARCHAR}, #{viewOrg,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
@@ -147,9 +146,6 @@
<if test="viewOrg != null">
view_org,
</if>
<if test="entity != null">
entity,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@@ -194,9 +190,6 @@
<if test="viewOrg != null">
#{viewOrg,jdbcType=VARCHAR},
</if>
<if test="entity != null">
#{entity,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample"
@@ -250,9 +243,6 @@
<if test="viewOrg != null">
view_org = #{viewOrg,jdbcType=VARCHAR},
</if>
<if test="entity != null">
entity = #{entity,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@@ -271,8 +261,7 @@
admin_org = #{adminOrg,jdbcType=VARCHAR},
is_open = #{isOpen,jdbcType=INTEGER},
viewer = #{viewer,jdbcType=VARCHAR},
view_org = #{viewOrg,jdbcType=VARCHAR},
entity = #{entity,jdbcType=VARCHAR}
view_org = #{viewOrg,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,316 +1,338 @@
<?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="domain_id" jdbcType="BIGINT" property="domainId" />
<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>
<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>
</foreach>
</trim>
</if>
</foreach>
</where>
</sql>
<sql id="Base_Column_List">
id, domain_id, name, biz_name, description, status, sensitive_level, type, created_at,
</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, domain_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}, #{domainId,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="domainId != null">
domain_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="domainId != null">
#{domainId,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="domainId != null">
domain_id = #{domainId,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 domain_id = #{domainId,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 domain_id = #{domainId,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>

View File

@@ -0,0 +1,430 @@
<?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">
<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>
</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>
</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},
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>

View File

@@ -5,7 +5,7 @@
<resultMap id="BaseResultMap"
type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
<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"/>
@@ -49,7 +49,7 @@
</sql>
<sql id="Base_Column_List">
id
, domain_id, type, created_at, created_by, updated_at, updated_by
, model_id, type, created_at, created_by, updated_at, updated_by
</sql>
<sql id="Blob_Column_List">
config
@@ -106,10 +106,10 @@
</delete>
<insert id="insert"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
insert into s2_view_info (id, domain_id, type,
insert into s2_view_info (id, model_id, type,
created_at, created_by, updated_at,
updated_by, config)
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
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})
@@ -121,8 +121,8 @@
<if test="id != null">
id,
</if>
<if test="domainId != null">
domain_id,
<if test="modelId != null">
model_id,
</if>
<if test="type != null">
type,
@@ -147,8 +147,8 @@
<if test="id != null">
#{id,jdbcType=BIGINT},
</if>
<if test="domainId != null">
#{domainId,jdbcType=BIGINT},
<if test="modelId != null">
#{modelId,jdbcType=BIGINT},
</if>
<if test="type != null">
#{type,jdbcType=VARCHAR},
@@ -182,8 +182,8 @@
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
update s2_view_info
<set>
<if test="domainId != null">
domain_id = #{domainId,jdbcType=BIGINT},
<if test="modelId != null">
model_id = #{modelId,jdbcType=BIGINT},
</if>
<if test="type != null">
type = #{type,jdbcType=VARCHAR},
@@ -209,7 +209,7 @@
<update id="updateByPrimaryKeyWithBLOBs"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
update s2_view_info
set domain_id = #{domainId,jdbcType=BIGINT},
set model_id = #{modelId,jdbcType=BIGINT},
type = #{type,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=VARCHAR},
@@ -221,7 +221,7 @@
<update id="updateByPrimaryKey"
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
update s2_view_info
set domain_id = #{domainId,jdbcType=BIGINT},
set model_id = #{modelId,jdbcType=BIGINT},
type = #{type,jdbcType=VARCHAR},
created_at = #{createdAt,jdbcType=TIMESTAMP},
created_by = #{createdBy,jdbcType=VARCHAR},

View File

@@ -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>

View File

@@ -9,7 +9,7 @@
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
<result column="description" jdbcType="VARCHAR" property="description"/>
<result column="status" jdbcType="INTEGER" property="status"/>
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
<result column="model_id" jdbcType="BIGINT" property="modelId"/>
<result column="type" jdbcType="VARCHAR" property="type"/>
<result column="type_params" jdbcType="VARCHAR" property="typeParams"/>
<result column="expr" jdbcType="VARCHAR" property="expr"/>
@@ -55,13 +55,13 @@
</sql>
<sql id="Base_Column_List">
id
, name, biz_name, description, status, domain_id, type, type_params, expr, datasource_id,
, name, biz_name, description, status, model_id, type, type_params, expr, datasource_id,
created_at, created_by, updated_by, updated_at, semantic_type
</sql>
<insert id="batchInsert" parameterType="java.util.List">
insert into s2_dimension (name, biz_name,
description, status, domain_id,
description, status, model_id,
type, type_params, expr,
datasource_id, created_at, created_by,
updated_by, updated_at, semantic_type,sensitive_level)
@@ -69,7 +69,7 @@
<foreach collection="list" item="dimension" separator=",">
(#{dimension.name,jdbcType=VARCHAR}, #{dimension.bizName,jdbcType=VARCHAR},
#{dimension.description,jdbcType=VARCHAR}, #{dimension.status,jdbcType=INTEGER},
#{dimension.domainId,jdbcType=BIGINT},
#{dimension.modelId,jdbcType=BIGINT},
#{dimension.type,jdbcType=VARCHAR}, #{dimension.typeParams,jdbcType=VARCHAR},
#{dimension.expr,jdbcType=VARCHAR},
#{dimension.datasourceId,jdbcType=BIGINT}, #{dimension.createdAt,jdbcType=TIMESTAMP},
@@ -87,7 +87,7 @@
biz_name = #{dimension.bizName,jdbcType=VARCHAR},
description = #{dimension.description,jdbcType=VARCHAR},
status = #{dimension.status,jdbcType=INTEGER},
domain_id = #{dimension.domainId,jdbcType=BIGINT},
model_id = #{dimension.modelId,jdbcType=BIGINT},
type = #{dimension.type,jdbcType=VARCHAR},
type_params = #{dimension.typeParams,jdbcType=VARCHAR},
datasource_id = #{dimension.datasourceId,jdbcType=BIGINT},

View File

@@ -5,7 +5,7 @@
<resultMap id="BaseResultMap"
type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
<id column="id" jdbcType="BIGINT" property="id"/>
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
<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"/>
@@ -52,7 +52,7 @@
</sql>
<sql id="Base_Column_List">
id
, domain_id, name, biz_name, description, type, created_at, created_by, updated_at,
, model_id, name, biz_name, description, type, created_at, created_by, updated_at,
updated_by
</sql>
<sql id="Blob_Column_List">
@@ -60,14 +60,14 @@
</sql>
<insert id="batchInsert" parameterType="java.util.List">
insert into s2_metric (domain_id, name,
insert into s2_metric (model_id, name,
biz_name, description, type,status,sensitive_level,
created_at, created_by, updated_at,
updated_by, type_params
)
values
<foreach collection="list" item="metric" separator=",">
( #{metric.domainId,jdbcType=BIGINT}, #{metric.name,jdbcType=VARCHAR},
( #{metric.modelId,jdbcType=BIGINT}, #{metric.name,jdbcType=VARCHAR},
#{metric.bizName,jdbcType=VARCHAR}, #{metric.description,jdbcType=VARCHAR},
#{metric.type,jdbcType=VARCHAR},
#{metric.status,jdbcType=VARCHAR},#{metric.sensitiveLevel,jdbcType=VARCHAR},
@@ -81,7 +81,7 @@
<update id="batchUpdate" parameterType="java.util.List">
<foreach collection="list" item="metric" separator=";">
update s2_metric
set domain_id = #{metric.domainId,jdbcType=BIGINT},
set model_id = #{metric.modelId,jdbcType=BIGINT},
name = #{metric.name,jdbcType=VARCHAR},
biz_name = #{metric.bizName,jdbcType=VARCHAR},
description = #{metric.description,jdbcType=VARCHAR},
@@ -98,26 +98,35 @@
</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>
<if test="name != null and name != ''">
and ( id like CONCAT('%',#{name , jdbcType=VARCHAR},'%') or
name like CONCAT('%',#{name , jdbcType=VARCHAR},'%') or
biz_name like CONCAT('%',#{name , jdbcType=VARCHAR},'%') or
description like CONCAT('%',#{name , jdbcType=VARCHAR},'%') )
<if test="key != null and key != ''">
and ( id like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
name like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
biz_name like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
description like CONCAT('%',#{key , jdbcType=VARCHAR},'%') )
</if>
<if test="sensitiveLevel != null">
<if test="id != null">
and id like CONCAT('%',#{id , jdbcType=VARCHAR},'%')
</if>
<if test="name != null and name != '' ">
and name like CONCAT('%',#{name , jdbcType=VARCHAR},'%')
</if>
<if test="bizName != null and bizName != ''">
and biz_name like CONCAT('%',#{bizName , jdbcType=VARCHAR},'%')
</if>
<if test="sensitiveLevel != null and sensitiveLevel != ''">
and sensitive_level = #{sensitiveLevel}
</if>
<if test="domainIds != null and domainIds.size >0">
and domain_id in
<foreach collection="domainIds" index="index" item="domain" open="(" close=")"
separator=",">
#{domain}
<if test="modelIds != null and modelIds.size >0">
and model_id in
<foreach collection="modelIds" index="index" item="model" open="(" close=")"
separator=",">
#{model}
</foreach>
</if>
</select>

View File

@@ -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 '创建时间',