(improvement)(semantic) Add is_tag label to the dimension and Specify entity alias on datasource primary-key (#411)

Co-authored-by: jolunoluo
This commit is contained in:
LXW
2023-11-21 11:44:27 +08:00
committed by GitHub
parent 6d9a8095eb
commit 91718592d4
19 changed files with 73 additions and 1486 deletions

View File

@@ -234,7 +234,9 @@ public class LoadModelDataDemo implements CommandLineRunner {
datasourceReq.setDatabaseId(1L);
List<Identify> identifiers = new ArrayList<>();
identifiers.add(new Identify("歌手名", IdentifyTypeEnum.primary.name(), "singer_name"));
Identify identify = new Identify("歌手名", IdentifyTypeEnum.primary.name(), "singer_name");
identify.setEntityNames(Lists.newArrayList("歌手", "艺人"));
identifiers.add(identify);
datasourceReq.setIdentifiers(identifiers);
List<Dim> dimensions = new ArrayList<>();
@@ -242,11 +244,11 @@ public class LoadModelDataDemo implements CommandLineRunner {
dimension1.setTypeParams(new DimensionTimeTypeParams());
dimensions.add(dimension1);
dimensions.add(new Dim("活跃区域", "act_area",
DimensionTypeEnum.categorical.name(), 1));
DimensionTypeEnum.categorical.name(), 1, 1));
dimensions.add(new Dim("代表作", "song_name",
DimensionTypeEnum.categorical.name(), 1));
dimensions.add(new Dim("风格", "genre",
DimensionTypeEnum.categorical.name(), 1));
DimensionTypeEnum.categorical.name(), 1, 1));
datasourceReq.setDimensions(dimensions);
Measure measure1 = new Measure("播放量", "js_play_cnt", "sum", 1);

View File

@@ -226,6 +226,7 @@ CREATE TABLE IF NOT EXISTS `s2_dimension` (
`alias` varchar(500) DEFAULT NULL,
`default_values` varchar(500) DEFAULT NULL,
`dim_value_maps` varchar(500) DEFAULT NULL,
`is_tag` INT DEFAULT NULL,
PRIMARY KEY (`id`)
);
COMMENT ON TABLE s2_dimension IS 'dimension information table';

View File

@@ -219,6 +219,7 @@ CREATE TABLE `s2_dimension` (
`alias` varchar(500) CHARACTER SET utf8 COLLATE utf8_unicode_ci DEFAULT NULL,
`default_values` varchar(500) DEFAULT NULL,
`dim_value_maps` varchar(5000) DEFAULT NULL,
`is_tag` int(10) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='维度表';

View File

@@ -93,4 +93,7 @@ CREATE TABLE s2_sys_parameter
alter table s2_chat_config add column `llm_examples` text COMMENT 'llm examples';
--20231116
alter table s2_datasource add column `filter_sql` varchar(1000) COMMENT 'filter_sql' after depends;
alter table s2_datasource add column `filter_sql` varchar(1000) COMMENT 'filter_sql' after depends;
--20231120
alter table s2_dimension add column `is_tag` int(10) DEFAULT NULL;

View File

@@ -241,6 +241,7 @@ CREATE TABLE IF NOT EXISTS `s2_dimension` (
`alias` varchar(500) DEFAULT NULL,
`default_values` varchar(500) DEFAULT NULL,
`dim_value_maps` varchar(500) DEFAULT NULL,
`is_tag` INT DEFAULT NULL,
PRIMARY KEY (`id`)
);
COMMENT ON TABLE s2_dimension IS 'dimension information table';

View File

@@ -27,6 +27,8 @@ public class Dim {
private String description;
private int isTag;
public Dim(String name, String bizName, String type, Integer isCreateDimension) {
this.name = name;
this.type = type;
@@ -34,6 +36,14 @@ public class Dim {
this.bizName = bizName;
}
public Dim(String name, String bizName, String type, Integer isCreateDimension, int isTag) {
this.name = name;
this.type = type;
this.isCreateDimension = isCreateDimension;
this.bizName = bizName;
this.isTag = isTag;
}
public Dim(String name, String type, String expr, String dateFormat, DimensionTimeTypeParams typeParams,
Integer isCreateDimension, String bizName) {
this.name = name;
@@ -45,6 +55,8 @@ public class Dim {
this.bizName = bizName;
}
public static Dim getDefault() {
return new Dim("日期", "time", "2023-05-28",
Constants.DAY_FORMAT,

View File

@@ -4,6 +4,7 @@ import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
@Data
@AllArgsConstructor
@@ -13,10 +14,17 @@ public class Identify {
private String name;
/**
* like primary, foreign
* primary, foreign
*/
private String type;
private String bizName;
private List<String> entityNames;
public Identify(String name, String type, String bizName) {
this.name = name;
this.type = type;
this.bizName = bizName;
}
}

View File

@@ -3,11 +3,9 @@ package com.tencent.supersonic.semantic.api.model.request;
import com.tencent.supersonic.common.pojo.enums.DataTypeEnums;
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
import javax.validation.constraints.NotNull;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.List;
@Data
@@ -33,4 +31,6 @@ public class DimensionReq extends SchemaItem {
private List<DimValueMap> dimValueMaps;
private DataTypeEnums dataType;
private int isTag;
}

View File

@@ -4,12 +4,11 @@ package com.tencent.supersonic.semantic.api.model.response;
import com.tencent.supersonic.common.pojo.enums.DataTypeEnums;
import com.tencent.supersonic.semantic.api.model.pojo.DimValueMap;
import com.tencent.supersonic.semantic.api.model.pojo.SchemaItem;
import java.util.List;
import lombok.Data;
import lombok.ToString;
import java.util.List;
@Data
@ToString(callSuper = true)
@@ -41,4 +40,6 @@ public class DimensionResp extends SchemaItem {
private DataTypeEnums dataType;
private int isTag;
}

View File

@@ -1,11 +1,18 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName("s2_dimension")
public class DimensionDO {
/**
* 维度ID
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
@@ -103,345 +110,5 @@ public class DimensionDO {
*/
private String dataType;
/**
* 维度ID
*
* @return id 维度ID
*/
public Long getId() {
return id;
}
/**
* 维度ID
*
* @param id 维度ID
*/
public void setId(Long id) {
this.id = id;
}
/**
* 主题域id
*
* @return model_id 主题域id
*/
public Long getModelId() {
return modelId;
}
/**
* 主题域id
*
* @param modelId 主题域id
*/
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**
* 所属数据源id
*
* @return datasource_id 所属数据源id
*/
public Long getDatasourceId() {
return datasourceId;
}
/**
* 所属数据源id
*
* @param datasourceId 所属数据源id
*/
public void setDatasourceId(Long datasourceId) {
this.datasourceId = datasourceId;
}
/**
* 维度名称
*
* @return name 维度名称
*/
public String getName() {
return name;
}
/**
* 维度名称
*
* @param name 维度名称
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 字段名称
*
* @return biz_name 字段名称
*/
public String getBizName() {
return bizName;
}
/**
* 字段名称
*
* @param bizName 字段名称
*/
public void setBizName(String bizName) {
this.bizName = bizName == null ? null : bizName.trim();
}
/**
* 描述
*
* @return description 描述
*/
public String getDescription() {
return description;
}
/**
* 描述
*
* @param description 描述
*/
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
/**
* 维度状态,0正常,1下架,2删除
*
* @return status 维度状态,0正常,1下架,2删除
*/
public Integer getStatus() {
return status;
}
/**
* 维度状态,0正常,1下架,2删除
*
* @param status 维度状态,0正常,1下架,2删除
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 敏感级别
*
* @return sensitive_level 敏感级别
*/
public Integer getSensitiveLevel() {
return sensitiveLevel;
}
/**
* 敏感级别
*
* @param sensitiveLevel 敏感级别
*/
public void setSensitiveLevel(Integer sensitiveLevel) {
this.sensitiveLevel = sensitiveLevel;
}
/**
* 维度类型 categorical,time
*
* @return type 维度类型 categorical,time
*/
public String getType() {
return type;
}
/**
* 维度类型 categorical,time
*
* @param type 维度类型 categorical,time
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* 创建时间
*
* @return created_at 创建时间
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* 创建时间
*
* @param createdAt 创建时间
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* 创建人
*
* @return created_by 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 创建人
*
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 更新时间
*
* @return updated_at 更新时间
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* 更新时间
*
* @param updatedAt 更新时间
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* 更新人
*
* @return updated_by 更新人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 更新人
*
* @param updatedBy 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 语义类型DATE, ID, CATEGORY
*
* @return semantic_type 语义类型DATE, ID, CATEGORY
*/
public String getSemanticType() {
return semanticType;
}
/**
* 语义类型DATE, ID, CATEGORY
*
* @param semanticType 语义类型DATE, ID, CATEGORY
*/
public void setSemanticType(String semanticType) {
this.semanticType = semanticType == null ? null : semanticType.trim();
}
/**
* @return alias
*/
public String getAlias() {
return alias;
}
/**
* @param alias
*/
public void setAlias(String alias) {
this.alias = alias == null ? null : alias.trim();
}
/**
* default values of dimension when query
*
* @return default_values default values of dimension when query
*/
public String getDefaultValues() {
return defaultValues;
}
/**
* default values of dimension when query
*
* @param defaultValues default values of dimension when query
*/
public void setDefaultValues(String defaultValues) {
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();
}
/**
* 类型参数
*
* @return type_params 类型参数
*/
public String getTypeParams() {
return typeParams;
}
/**
* 类型参数
*
* @param typeParams 类型参数
*/
public void setTypeParams(String typeParams) {
this.typeParams = typeParams == null ? null : typeParams.trim();
}
/**
* 表达式
*
* @return expr 表达式
*/
public String getExpr() {
return expr;
}
/**
* 表达式
*
* @param expr 表达式
*/
public void setExpr(String expr) {
this.expr = expr == null ? null : expr.trim();
}
public String getDataType() {
return dataType;
}
public void setDataType(String dataType) {
this.dataType = dataType;
}
private int isTag;
}

View File

@@ -1,11 +1,16 @@
package com.tencent.supersonic.semantic.model.domain.dataobject;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import java.util.Date;
@Data
@TableName("s2_metric")
public class MetricDO {
/**
*
*/
@TableId(type = IdType.AUTO)
private Long id;
/**
@@ -93,291 +98,4 @@ public class MetricDO {
*/
private String typeParams;
/**
*
* @return id
*/
public Long getId() {
return id;
}
/**
*
* @param id
*/
public void setId(Long id) {
this.id = id;
}
/**
* 主体域ID
* @return model_id 主体域ID
*/
public Long getModelId() {
return modelId;
}
/**
* 主体域ID
* @param modelId 主体域ID
*/
public void setModelId(Long modelId) {
this.modelId = modelId;
}
/**
* 指标名称
* @return name 指标名称
*/
public String getName() {
return name;
}
/**
* 指标名称
* @param name 指标名称
*/
public void setName(String name) {
this.name = name == null ? null : name.trim();
}
/**
* 字段名称
* @return biz_name 字段名称
*/
public String getBizName() {
return bizName;
}
/**
* 字段名称
* @param bizName 字段名称
*/
public void setBizName(String bizName) {
this.bizName = bizName == null ? null : bizName.trim();
}
/**
* 描述
* @return description 描述
*/
public String getDescription() {
return description;
}
/**
* 描述
* @param description 描述
*/
public void setDescription(String description) {
this.description = description == null ? null : description.trim();
}
/**
* 指标状态,0正常,1下架,2删除
* @return status 指标状态,0正常,1下架,2删除
*/
public Integer getStatus() {
return status;
}
/**
* 指标状态,0正常,1下架,2删除
* @param status 指标状态,0正常,1下架,2删除
*/
public void setStatus(Integer status) {
this.status = status;
}
/**
* 敏感级别
* @return sensitive_level 敏感级别
*/
public Integer getSensitiveLevel() {
return sensitiveLevel;
}
/**
* 敏感级别
* @param sensitiveLevel 敏感级别
*/
public void setSensitiveLevel(Integer sensitiveLevel) {
this.sensitiveLevel = sensitiveLevel;
}
/**
* 指标类型 proxy,expr
* @return type 指标类型 proxy,expr
*/
public String getType() {
return type;
}
/**
* 指标类型 proxy,expr
* @param type 指标类型 proxy,expr
*/
public void setType(String type) {
this.type = type == null ? null : type.trim();
}
/**
* 创建时间
* @return created_at 创建时间
*/
public Date getCreatedAt() {
return createdAt;
}
/**
* 创建时间
* @param createdAt 创建时间
*/
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
/**
* 创建人
* @return created_by 创建人
*/
public String getCreatedBy() {
return createdBy;
}
/**
* 创建人
* @param createdBy 创建人
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy == null ? null : createdBy.trim();
}
/**
* 更新时间
* @return updated_at 更新时间
*/
public Date getUpdatedAt() {
return updatedAt;
}
/**
* 更新时间
* @param updatedAt 更新时间
*/
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
/**
* 更新人
* @return updated_by 更新人
*/
public String getUpdatedBy() {
return updatedBy;
}
/**
* 更新人
* @param updatedBy 更新人
*/
public void setUpdatedBy(String updatedBy) {
this.updatedBy = updatedBy == null ? null : updatedBy.trim();
}
/**
* 数值类型
* @return data_format_type 数值类型
*/
public String getDataFormatType() {
return dataFormatType;
}
/**
* 数值类型
* @param dataFormatType 数值类型
*/
public void setDataFormatType(String dataFormatType) {
this.dataFormatType = dataFormatType == null ? null : dataFormatType.trim();
}
/**
* 数值类型参数
* @return data_format 数值类型参数
*/
public String getDataFormat() {
return dataFormat;
}
/**
* 数值类型参数
* @param dataFormat 数值类型参数
*/
public void setDataFormat(String dataFormat) {
this.dataFormat = dataFormat == null ? null : dataFormat.trim();
}
/**
*
* @return alias
*/
public String getAlias() {
return alias;
}
/**
*
* @param alias
*/
public void setAlias(String alias) {
this.alias = alias == null ? null : alias.trim();
}
/**
*
* @return tags
*/
public String getTags() {
return tags;
}
/**
*
* @param tags
*/
public void setTags(String tags) {
this.tags = tags == null ? null : tags.trim();
}
/**
*
* @return relate_dimensions
*/
public String getRelateDimensions() {
return relateDimensions;
}
/**
*
* @param relateDimensions
*/
public void setRelateDimensions(String relateDimensions) {
this.relateDimensions = relateDimensions == null ? null : relateDimensions.trim();
}
/**
* 类型参数
* @return type_params 类型参数
*/
public String getTypeParams() {
return typeParams;
}
/**
* 类型参数
* @param typeParams 类型参数
*/
public void setTypeParams(String typeParams) {
this.typeParams = typeParams == null ? null : typeParams.trim();
}
}

View File

@@ -18,13 +18,13 @@ import com.tencent.supersonic.semantic.api.model.response.DatasourceResp;
import com.tencent.supersonic.semantic.api.model.response.MeasureResp;
import com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO;
import com.tencent.supersonic.semantic.model.domain.pojo.Datasource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
import java.util.Date;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.util.CollectionUtils;
public class DatasourceConverter {
@@ -79,6 +79,7 @@ public class DatasourceConverter {
dimensionReq.setExpr(dim.getBizName());
dimensionReq.setType("categorical");
dimensionReq.setDescription(Objects.isNull(dim.getDescription()) ? "" : dim.getDescription());
dimensionReq.setIsTag(dim.getIsTag());
return dimensionReq;
}

View File

@@ -1,70 +1,10 @@
package com.tencent.supersonic.semantic.model.infrastructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
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;
@Mapper
public interface DimensionDOMapper {
/**
*
* @mbg.generated
*/
long countByExample(DimensionDOExample example);
public interface DimensionDOMapper extends BaseMapper<DimensionDO> {
/**
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
*
* @mbg.generated
*/
int insert(DimensionDO record);
/**
*
* @mbg.generated
*/
int insertSelective(DimensionDO record);
/**
*
* @mbg.generated
*/
List<DimensionDO> selectByExampleWithBLOBs(DimensionDOExample example);
/**
*
* @mbg.generated
*/
List<DimensionDO> selectByExample(DimensionDOExample example);
/**
*
* @mbg.generated
*/
DimensionDO selectByPrimaryKey(Long id);
/**
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(DimensionDO record);
/**
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(DimensionDO record);
/**
*
* @mbg.generated
*/
int updateByPrimaryKey(DimensionDO record);
}

View File

@@ -1,70 +1,10 @@
package com.tencent.supersonic.semantic.model.infrastructure.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO;
import com.tencent.supersonic.semantic.model.domain.dataobject.MetricDOExample;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
@Mapper
public interface MetricDOMapper {
/**
*
* @mbg.generated
*/
long countByExample(MetricDOExample example);
public interface MetricDOMapper extends BaseMapper<MetricDO> {
/**
*
* @mbg.generated
*/
int deleteByPrimaryKey(Long id);
/**
*
* @mbg.generated
*/
int insert(MetricDO record);
/**
*
* @mbg.generated
*/
int insertSelective(MetricDO record);
/**
*
* @mbg.generated
*/
List<MetricDO> selectByExampleWithBLOBs(MetricDOExample example);
/**
*
* @mbg.generated
*/
List<MetricDO> selectByExample(MetricDOExample example);
/**
*
* @mbg.generated
*/
MetricDO selectByPrimaryKey(Long id);
/**
*
* @mbg.generated
*/
int updateByPrimaryKeySelective(MetricDO record);
/**
*
* @mbg.generated
*/
int updateByPrimaryKeyWithBLOBs(MetricDO record);
/**
*
* @mbg.generated
*/
int updateByPrimaryKey(MetricDO record);
}

View File

@@ -1,12 +1,12 @@
package com.tencent.supersonic.semantic.model.infrastructure.repository;
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.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;
import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class DimensionRepositoryImpl implements DimensionRepository {
@@ -33,7 +33,7 @@ public class DimensionRepositoryImpl implements DimensionRepository {
@Override
public void updateDimension(DimensionDO dimensionDO) {
dimensionDOMapper.updateByPrimaryKeySelective(dimensionDO);
dimensionDOMapper.updateById(dimensionDO);
}
@Override
@@ -43,7 +43,7 @@ public class DimensionRepositoryImpl implements DimensionRepository {
@Override
public DimensionDO getDimensionById(Long id) {
return dimensionDOMapper.selectByPrimaryKey(id);
return dimensionDOMapper.selectById(id);
}
@Override

View File

@@ -5,8 +5,8 @@ import com.tencent.supersonic.semantic.model.domain.pojo.MetricFilter;
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.springframework.stereotype.Component;
import java.util.List;
@Component
@@ -36,7 +36,7 @@ public class MetricRepositoryImpl implements MetricRepository {
@Override
public void updateMetric(MetricDO metricDO) {
metricDOMapper.updateByPrimaryKeySelective(metricDO);
metricDOMapper.updateById(metricDO);
}
@Override
@@ -46,7 +46,7 @@ public class MetricRepositoryImpl implements MetricRepository {
@Override
public MetricDO getMetricById(Long id) {
return metricDOMapper.selectByPrimaryKey(id);
return metricDOMapper.selectById(id);
}
@Override

View File

@@ -1,366 +0,0 @@
<?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.DimensionDOMapper">
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="model_id" jdbcType="BIGINT" property="modelId" />
<result column="datasource_id" jdbcType="BIGINT" property="datasourceId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="semantic_type" jdbcType="VARCHAR" property="semanticType" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="default_values" jdbcType="VARCHAR" property="defaultValues" />
<result column="dim_value_maps" jdbcType="VARCHAR" property="dimValueMaps" />
<result column="data_type" jdbcType="VARCHAR" property="dataType"/>
</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>
</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, data_type
</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" useGeneratedKeys="true" keyProperty="id">
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, data_type)
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}, #{dataType,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="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>
<if test="data_type != null">
data_type,
</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>
<if test="dataType != null">
#{dataType,jdbcType=VARCHAR},
</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>
<if test="dataType != null">
data_type = #{dataType,jdbcType=VARCHAR},
</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},
data_type = #{dataType,jdbcType=VARCHAR}
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},
data_type = #{dataType,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -1,342 +0,0 @@
<?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.MetricDOMapper">
<resultMap id="BaseResultMap" type="com.tencent.supersonic.semantic.model.domain.dataobject.MetricDO">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="model_id" jdbcType="BIGINT" property="modelId" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="biz_name" jdbcType="VARCHAR" property="bizName" />
<result column="description" jdbcType="VARCHAR" property="description" />
<result column="status" jdbcType="INTEGER" property="status" />
<result column="sensitive_level" jdbcType="INTEGER" property="sensitiveLevel" />
<result column="type" jdbcType="VARCHAR" property="type" />
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt" />
<result column="created_by" jdbcType="VARCHAR" property="createdBy" />
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt" />
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
<result column="data_format_type" jdbcType="VARCHAR" property="dataFormatType" />
<result column="data_format" jdbcType="VARCHAR" property="dataFormat" />
<result column="alias" jdbcType="VARCHAR" property="alias" />
<result column="tags" jdbcType="VARCHAR" property="tags" />
<result column="relate_dimensions" jdbcType="VARCHAR" property="relateDimensions" />
</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>
</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, tags, relate_dimensions
</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" useGeneratedKeys="true" keyProperty="id">
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,
tags, relate_dimensions, 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},
#{tags,jdbcType=VARCHAR}, #{relateDimensions,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="tags != null">
tags,
</if>
<if test="relateDimensions != null">
relate_dimensions,
</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="tags != null">
#{tags,jdbcType=VARCHAR},
</if>
<if test="relateDimensions != null">
#{relateDimensions,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="tags != null">
tags = #{tags,jdbcType=VARCHAR},
</if>
<if test="relateDimensions != null">
relate_dimensions = #{relateDimensions,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},
tags = #{tags,jdbcType=VARCHAR},
relate_dimensions = #{relateDimensions,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},
tags = #{tags,jdbcType=VARCHAR},
relate_dimensions = #{relateDimensions,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

View File

@@ -69,7 +69,7 @@
description, status, model_id,
type, type_params, expr,
datasource_id, created_at, created_by,
updated_by, updated_at, semantic_type,sensitive_level)
updated_by, updated_at, semantic_type,sensitive_level, is_tag)
values
<foreach collection="list" item="dimension" separator=",">
(#{dimension.name,jdbcType=VARCHAR}, #{dimension.bizName,jdbcType=VARCHAR},
@@ -81,7 +81,7 @@
#{dimension.createdBy,jdbcType=VARCHAR},
#{dimension.updatedBy,jdbcType=VARCHAR}, #{dimension.updatedAt,jdbcType=TIMESTAMP},
#{dimension.semanticType,jdbcType=VARCHAR},
#{dimension.sensitiveLevel,jdbcType=INTEGER})
#{dimension.sensitiveLevel,jdbcType=INTEGER}, #{dimension.isTag, jdbcType=INTEGER})
</foreach>
</insert>