Files
supersonic/semantic/model/src/main/resources/mapper/MetricDOMapper.xml
2023-10-16 16:43:09 +08:00

342 lines
13 KiB
XML

<?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">
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>