mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-16 06:56:57 +00:00
[improvement][project] supersonic 0.7.0 version backend update (#20)
Co-authored-by: kanedai <kanedai@tencent.com>
This commit is contained in:
271
semantic/model/src/main/resources/mapper/DatabaseDOMapper.xml
Normal file
271
semantic/model/src/main/resources/mapper/DatabaseDOMapper.xml
Normal file
@@ -0,0 +1,271 @@
|
||||
<?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.DatabaseDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="domain_id" jdbcType="BIGINT" property="domainId"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="version" jdbcType="VARCHAR" property="version"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, domain_id, name, description, version, type, created_at, created_by, updated_at, updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_database
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database (id, domain_id, name,
|
||||
description, version, type, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
config)
|
||||
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR},
|
||||
#{description,jdbcType=VARCHAR},#{version,jdbcType=VARCHAR}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
#{config,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
insert into s2_database
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description,
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
#{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
#{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
#{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_database
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
<set>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="description != null">
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="version != null">
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatabaseDO">
|
||||
update s2_database
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
version = #{version,jdbcType=VARCHAR},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
272
semantic/model/src/main/resources/mapper/DatasourceDOMapper.xml
Normal file
272
semantic/model/src/main/resources/mapper/DatasourceDOMapper.xml
Normal file
@@ -0,0 +1,272 @@
|
||||
<?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.DatasourceDOMapper">
|
||||
<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="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="description" jdbcType="VARCHAR" property="description"/>
|
||||
<result column="database_id" jdbcType="BIGINT" property="databaseId"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
<result column="datasource_detail" jdbcType="LONGVARCHAR" property="datasourceDetail"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, domain_id, name, biz_name, description, database_id, created_at, created_by,
|
||||
updated_at, updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
datasource_detail
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_datasource
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource (id, domain_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},
|
||||
#{bizName,jdbcType=VARCHAR}, #{description,jdbcType=VARCHAR},
|
||||
#{databaseId,jdbcType=BIGINT},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{datasourceDetail,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
insert into s2_datasource
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="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="databaseId != null">
|
||||
database_id,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="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="databaseId != null">
|
||||
#{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
#{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
<set>
|
||||
<if test="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="databaseId != null">
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="datasourceDetail != null">
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
datasource_detail = #{datasourceDetail,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceDO">
|
||||
update s2_datasource
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
description = #{description,jdbcType=VARCHAR},
|
||||
database_id = #{databaseId,jdbcType=BIGINT},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,209 @@
|
||||
<?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.DatasourceRelaDOMapper">
|
||||
<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="datasource_from" jdbcType="BIGINT" property="datasourceFrom"/>
|
||||
<result column="datasource_to" jdbcType="BIGINT" property="datasourceTo"/>
|
||||
<result column="join_key" jdbcType="VARCHAR" property="joinKey"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, domain_id, datasource_from, datasource_to, join_key, created_at, created_by,
|
||||
updated_at, updated_by
|
||||
</sql>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_datasource_rela
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela (id, domain_id, datasource_from,
|
||||
datasource_to, join_key, created_at,
|
||||
created_by, updated_at, updated_by)
|
||||
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT},
|
||||
#{datasourceFrom,jdbcType=BIGINT},
|
||||
#{datasourceTo,jdbcType=BIGINT}, #{joinKey,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
#{createdBy,jdbcType=VARCHAR}, #{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
insert into s2_datasource_rela
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from,
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to,
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
#{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
#{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
#{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_datasource_rela
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
<set>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceFrom != null">
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="datasourceTo != null">
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="joinKey != null">
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DatasourceRelaDO">
|
||||
update s2_datasource_rela
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
datasource_from = #{datasourceFrom,jdbcType=BIGINT},
|
||||
datasource_to = #{datasourceTo,jdbcType=BIGINT},
|
||||
join_key = #{joinKey,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
355
semantic/model/src/main/resources/mapper/DimensionDOMapper.xml
Normal file
355
semantic/model/src/main/resources/mapper/DimensionDOMapper.xml
Normal file
@@ -0,0 +1,355 @@
|
||||
<?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="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>
|
||||
</foreach>
|
||||
</trim>
|
||||
</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>
|
||||
</mapper>
|
||||
278
semantic/model/src/main/resources/mapper/DomainDOMapper.xml
Normal file
278
semantic/model/src/main/resources/mapper/DomainDOMapper.xml
Normal file
@@ -0,0 +1,278 @@
|
||||
<?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.DomainDOMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="name" jdbcType="VARCHAR" property="name"/>
|
||||
<result column="biz_name" jdbcType="VARCHAR" property="bizName"/>
|
||||
<result column="parent_id" jdbcType="BIGINT" property="parentId"/>
|
||||
<result column="status" jdbcType="INTEGER" property="status"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="admin" jdbcType="VARCHAR" property="admin"/>
|
||||
<result column="admin_org" jdbcType="VARCHAR" property="adminOrg"/>
|
||||
<result column="is_open" jdbcType="INTEGER" property="isOpen"/>
|
||||
<result column="viewer" jdbcType="VARCHAR" property="viewer"/>
|
||||
<result column="view_org" jdbcType="VARCHAR" property="viewOrg"/>
|
||||
<result column="entity" jdbcType="VARCHAR" 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="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
|
||||
</sql>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_domain
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain (id, name, biz_name,
|
||||
parent_id, status, created_at,
|
||||
created_by, updated_at, updated_by,
|
||||
admin, admin_org, is_open,
|
||||
viewer, view_org, entity)
|
||||
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})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
insert into s2_domain
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="name != null">
|
||||
name,
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name,
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id,
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin,
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org,
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open,
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer,
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org,
|
||||
</if>
|
||||
<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="parentId != null">
|
||||
#{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
#{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
#{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
#{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
#{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
#{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
#{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
#{entity,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_domain
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
<set>
|
||||
<if test="name != null">
|
||||
name = #{name,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="bizName != null">
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="parentId != null">
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="status != null">
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="admin != null">
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="adminOrg != null">
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="isOpen != null">
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
</if>
|
||||
<if test="viewer != null">
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="viewOrg != null">
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="entity != null">
|
||||
entity = #{entity,jdbcType=VARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.DomainDO">
|
||||
update s2_domain
|
||||
set name = #{name,jdbcType=VARCHAR},
|
||||
biz_name = #{bizName,jdbcType=VARCHAR},
|
||||
parent_id = #{parentId,jdbcType=BIGINT},
|
||||
status = #{status,jdbcType=INTEGER},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
admin = #{admin,jdbcType=VARCHAR},
|
||||
admin_org = #{adminOrg,jdbcType=VARCHAR},
|
||||
is_open = #{isOpen,jdbcType=INTEGER},
|
||||
viewer = #{viewer,jdbcType=VARCHAR},
|
||||
view_org = #{viewOrg,jdbcType=VARCHAR},
|
||||
entity = #{entity,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
316
semantic/model/src/main/resources/mapper/MetricDOMapper.xml
Normal file
316
semantic/model/src/main/resources/mapper/MetricDOMapper.xml
Normal file
@@ -0,0 +1,316 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<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>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
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
|
||||
</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>
|
||||
</mapper>
|
||||
232
semantic/model/src/main/resources/mapper/ViewInfoDOMapper.xml
Normal file
232
semantic/model/src/main/resources/mapper/ViewInfoDOMapper.xml
Normal file
@@ -0,0 +1,232 @@
|
||||
<?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.ViewInfoDOMapper">
|
||||
<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="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
<result column="config" jdbcType="LONGVARCHAR" property="config"/>
|
||||
</resultMap>
|
||||
<sql id="Example_Where_Clause">
|
||||
<where>
|
||||
<foreach collection="oredCriteria" item="criteria" separator="or">
|
||||
<if test="criteria.valid">
|
||||
<trim prefix="(" prefixOverrides="and" suffix=")">
|
||||
<foreach collection="criteria.criteria" item="criterion">
|
||||
<choose>
|
||||
<when test="criterion.noValue">
|
||||
and ${criterion.condition}
|
||||
</when>
|
||||
<when test="criterion.singleValue">
|
||||
and ${criterion.condition} #{criterion.value}
|
||||
</when>
|
||||
<when test="criterion.betweenValue">
|
||||
and ${criterion.condition} #{criterion.value} and
|
||||
#{criterion.secondValue}
|
||||
</when>
|
||||
<when test="criterion.listValue">
|
||||
and ${criterion.condition}
|
||||
<foreach close=")" collection="criterion.value" item="listItem"
|
||||
open="(" separator=",">
|
||||
#{listItem}
|
||||
</foreach>
|
||||
</when>
|
||||
</choose>
|
||||
</foreach>
|
||||
</trim>
|
||||
</if>
|
||||
</foreach>
|
||||
</where>
|
||||
</sql>
|
||||
<sql id="Base_Column_List">
|
||||
id
|
||||
, domain_id, type, created_at, created_by, updated_at, updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
config
|
||||
</sql>
|
||||
<select id="selectByExampleWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultMap="BaseResultMap">
|
||||
select
|
||||
<if test="distinct">
|
||||
distinct
|
||||
</if>
|
||||
<include refid="Base_Column_List"/>
|
||||
from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
<if test="orderByClause != null">
|
||||
order by ${orderByClause}
|
||||
</if>
|
||||
<if test="limitStart != null and limitStart>=0">
|
||||
limit #{limitStart} , #{limitEnd}
|
||||
</if>
|
||||
</select>
|
||||
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="ResultMapWithBLOBs">
|
||||
select
|
||||
<include refid="Base_Column_List"/>
|
||||
,
|
||||
<include refid="Blob_Column_List"/>
|
||||
from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</select>
|
||||
<delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
|
||||
delete
|
||||
from s2_view_info
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</delete>
|
||||
<insert id="insert"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info (id, domain_id, type,
|
||||
created_at, created_by, updated_at,
|
||||
updated_by, config)
|
||||
values (#{id,jdbcType=BIGINT}, #{domainId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR},
|
||||
#{createdAt,jdbcType=TIMESTAMP}, #{createdBy,jdbcType=VARCHAR},
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
#{updatedBy,jdbcType=VARCHAR}, #{config,jdbcType=LONGVARCHAR})
|
||||
</insert>
|
||||
<insert id="insertSelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
insert into s2_view_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
id,
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
domain_id,
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type,
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at,
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by,
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at,
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by,
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config,
|
||||
</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">
|
||||
#{id,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="domainId != null">
|
||||
#{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
#{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
#{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
#{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
#{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
#{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
#{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<select id="countByExample"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDOExample"
|
||||
resultType="java.lang.Long">
|
||||
select count(*) from s2_view_info
|
||||
<if test="_parameter != null">
|
||||
<include refid="Example_Where_Clause"/>
|
||||
</if>
|
||||
</select>
|
||||
<update id="updateByPrimaryKeySelective"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
<set>
|
||||
<if test="domainId != null">
|
||||
domain_id = #{domainId,jdbcType=BIGINT},
|
||||
</if>
|
||||
<if test="type != null">
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="createdAt != null">
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="updatedAt != null">
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
</if>
|
||||
<if test="updatedBy != null">
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
</if>
|
||||
<if test="config != null">
|
||||
config = #{config,jdbcType=LONGVARCHAR},
|
||||
</if>
|
||||
</set>
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKeyWithBLOBs"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR},
|
||||
config = #{config,jdbcType=LONGVARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
<update id="updateByPrimaryKey"
|
||||
parameterType="com.tencent.supersonic.semantic.model.domain.dataobject.ViewInfoDO">
|
||||
update s2_view_info
|
||||
set domain_id = #{domainId,jdbcType=BIGINT},
|
||||
type = #{type,jdbcType=VARCHAR},
|
||||
created_at = #{createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{updatedBy,jdbcType=VARCHAR}
|
||||
where id = #{id,jdbcType=BIGINT}
|
||||
</update>
|
||||
</mapper>
|
||||
@@ -0,0 +1,56 @@
|
||||
<?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.DateInfoMapper">
|
||||
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DateInfoDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<result column="type" jdbcType="BIGINT" property="type"/>
|
||||
<result column="item_id" jdbcType="VARCHAR" property="itemId"/>
|
||||
<result column="date_format" jdbcType="VARCHAR" property="dateFormat"/>
|
||||
<result column="start_date" jdbcType="VARCHAR" property="startDate"/>
|
||||
<result column="end_date" jdbcType="VARCHAR" property="endDate"/>
|
||||
<result column="unavailable_date" jdbcType="INTEGER" property="unavailableDateList"/>
|
||||
<result column="created_by" jdbcType="TIMESTAMP" property="createdBy"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="date_period" jdbcType="VARCHAR" property="datePeriod"/>
|
||||
</resultMap>
|
||||
|
||||
<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)
|
||||
values (#{type}, #{itemId}, #{dateFormat}, #{startDate}, #{endDate}, #{unavailableDateList},
|
||||
#{createdBy}, #{updatedBy}, #{datePeriod}) ON DUPLICATE KEY
|
||||
UPDATE
|
||||
date_format = #{dateFormat},
|
||||
start_date = #{startDate},
|
||||
end_date = #{endDate},
|
||||
unavailable_date = #{unavailableDateList},
|
||||
created_by = #{createdBy},
|
||||
updated_by = #{updatedBy},
|
||||
date_period = #{datePeriod}
|
||||
</insert>
|
||||
|
||||
<select id="getDateInfos" resultMap="BaseResultMap">
|
||||
select e.*
|
||||
from s2_available_date_info e
|
||||
inner join
|
||||
(
|
||||
select item_id, max(created_at) as created_at
|
||||
from s2_available_date_info
|
||||
where `type` = #{type}
|
||||
<if test="itemIds != null and itemIds.size >0">
|
||||
and item_id in
|
||||
<foreach collection="itemIds" index="index" item="item" open="(" close=")"
|
||||
separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
group by item_id
|
||||
) t
|
||||
on e.item_id=t.item_id and e.created_at=t.created_at
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@@ -0,0 +1,106 @@
|
||||
<?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.DimensionDOCustomMapper">
|
||||
<resultMap id="BaseResultMap"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.DimensionDO">
|
||||
<id column="id" jdbcType="BIGINT" property="id"/>
|
||||
<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="domain_id" jdbcType="BIGINT" property="domainId"/>
|
||||
<result column="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="type_params" jdbcType="VARCHAR" property="typeParams"/>
|
||||
<result column="expr" jdbcType="VARCHAR" property="expr"/>
|
||||
<result column="datasource_id" jdbcType="BIGINT" property="datasourceId"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="semantic_type" jdbcType="VARCHAR" property="semanticType"/>
|
||||
</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
|
||||
, name, biz_name, description, status, domain_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,
|
||||
type, type_params, expr,
|
||||
datasource_id, created_at, created_by,
|
||||
updated_by, updated_at, semantic_type,sensitive_level)
|
||||
values
|
||||
<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.type,jdbcType=VARCHAR}, #{dimension.typeParams,jdbcType=VARCHAR},
|
||||
#{dimension.expr,jdbcType=VARCHAR},
|
||||
#{dimension.datasourceId,jdbcType=BIGINT}, #{dimension.createdAt,jdbcType=TIMESTAMP},
|
||||
#{dimension.createdBy,jdbcType=VARCHAR},
|
||||
#{dimension.updatedBy,jdbcType=VARCHAR}, #{dimension.updatedAt,jdbcType=TIMESTAMP},
|
||||
#{dimension.semanticType,jdbcType=VARCHAR},
|
||||
#{dimension.sensitiveLevel,jdbcType=INTEGER})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
<foreach collection="list" item="dimension" separator=";">
|
||||
update s2_dimension
|
||||
set name = #{dimension.name,jdbcType=VARCHAR},
|
||||
biz_name = #{dimension.bizName,jdbcType=VARCHAR},
|
||||
description = #{dimension.description,jdbcType=VARCHAR},
|
||||
status = #{dimension.status,jdbcType=INTEGER},
|
||||
domain_id = #{dimension.domainId,jdbcType=BIGINT},
|
||||
type = #{dimension.type,jdbcType=VARCHAR},
|
||||
type_params = #{dimension.typeParams,jdbcType=VARCHAR},
|
||||
datasource_id = #{dimension.datasourceId,jdbcType=BIGINT},
|
||||
created_at = #{dimension.createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{dimension.createdBy,jdbcType=VARCHAR},
|
||||
updated_by = #{dimension.updatedBy,jdbcType=VARCHAR},
|
||||
updated_at = #{dimension.updatedAt,jdbcType=TIMESTAMP},
|
||||
semantic_type = #{dimension.semanticType,jdbcType=VARCHAR},
|
||||
sensitive_level = #{dimension.sensitiveLevel,jdbcType=INTEGER},
|
||||
expr = #{dimension.expr,jdbcType=LONGVARCHAR}
|
||||
where id = #{dimension.id,jdbcType=BIGINT}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,100 @@
|
||||
<?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.MetricDOCustomMapper">
|
||||
<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="type" jdbcType="VARCHAR" property="type"/>
|
||||
<result column="created_at" jdbcType="TIMESTAMP" property="createdAt"/>
|
||||
<result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
|
||||
<result column="updated_at" jdbcType="TIMESTAMP" property="updatedAt"/>
|
||||
<result column="updated_by" jdbcType="VARCHAR" property="updatedBy"/>
|
||||
</resultMap>
|
||||
<resultMap extends="BaseResultMap" id="ResultMapWithBLOBs"
|
||||
type="com.tencent.supersonic.semantic.model.domain.dataobject.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
|
||||
, domain_id, name, biz_name, description, type, created_at, created_by, updated_at,
|
||||
updated_by
|
||||
</sql>
|
||||
<sql id="Blob_Column_List">
|
||||
typeParams
|
||||
</sql>
|
||||
|
||||
<insert id="batchInsert" parameterType="java.util.List">
|
||||
insert into s2_metric (domain_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.bizName,jdbcType=VARCHAR}, #{metric.description,jdbcType=VARCHAR},
|
||||
#{metric.type,jdbcType=VARCHAR},
|
||||
#{metric.status,jdbcType=VARCHAR},#{metric.sensitiveLevel,jdbcType=VARCHAR},
|
||||
#{metric.createdAt,jdbcType=TIMESTAMP}, #{metric.createdBy,jdbcType=VARCHAR},
|
||||
#{metric.updatedAt,jdbcType=TIMESTAMP},
|
||||
#{metric.updatedBy,jdbcType=VARCHAR}, #{metric.typeParams,jdbcType=LONGVARCHAR}
|
||||
)
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
<update id="batchUpdate" parameterType="java.util.List">
|
||||
<foreach collection="list" item="metric" separator=";">
|
||||
update s2_metric
|
||||
set domain_id = #{metric.domainId,jdbcType=BIGINT},
|
||||
name = #{metric.name,jdbcType=VARCHAR},
|
||||
biz_name = #{metric.bizName,jdbcType=VARCHAR},
|
||||
description = #{metric.description,jdbcType=VARCHAR},
|
||||
type = #{metric.type,jdbcType=VARCHAR},
|
||||
status = #{metric.status,jdbcType=VARCHAR},
|
||||
created_at = #{metric.createdAt,jdbcType=TIMESTAMP},
|
||||
created_by = #{metric.createdBy,jdbcType=VARCHAR},
|
||||
updated_at = #{metric.updatedAt,jdbcType=TIMESTAMP},
|
||||
updated_by = #{metric.updatedBy,jdbcType=VARCHAR},
|
||||
sensitive_level = #{metric.sensitiveLevel,jdbcType=INTEGER},
|
||||
type_params = #{metric.typeParams,jdbcType=LONGVARCHAR}
|
||||
where id = #{metric.id,jdbcType=BIGINT}
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
</mapper>
|
||||
14
semantic/model/src/main/resources/sql.ddl/s2_database.sql
Normal file
14
semantic/model/src/main/resources/sql.ddl/s2_database.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE `s2_database`
|
||||
(
|
||||
`id` bigint(20) PRIMARY KEY NOT NULL AUTO_INCREMENT,
|
||||
`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 '版本',
|
||||
`type` varchar(20) NOT NULL COMMENT '类型 mysql,clickhouse,tdw',
|
||||
`config` text NOT NULL COMMENT '配置信息',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
`created_by` varchar(100) NOT NULL COMMENT '创建人',
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
`updated_by` varchar(100) NOT NULL COMMENT '更新人'
|
||||
) comment '数据库实例表'
|
||||
38
semantic/model/src/main/resources/sql.ddl/s2_datasource.sql
Normal file
38
semantic/model/src/main/resources/sql.ddl/s2_datasource.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
CREATE TABLE IF NOT EXISTS `s2_datasource`
|
||||
(
|
||||
`id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
`domain_id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL COMMENT '主题域ID',
|
||||
`name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '数据源名称',
|
||||
`biz_name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '内部名称',
|
||||
`description` varchar
|
||||
(
|
||||
500
|
||||
) DEFAULT NULL COMMENT '数据源描述',
|
||||
`database_id` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '数据库实例ID',
|
||||
`datasource_detail` mediumtext NOT NULL COMMENT '数据源配置',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
`created_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '创建人',
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
`updated_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '更新人'
|
||||
) comment '数据源表'
|
||||
55
semantic/model/src/main/resources/sql.ddl/s2_dimension.sql
Normal file
55
semantic/model/src/main/resources/sql.ddl/s2_dimension.sql
Normal file
@@ -0,0 +1,55 @@
|
||||
CREATE TABLE IF NOT EXISTS `s2_dimension`
|
||||
(
|
||||
`id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL PRIMARY KEY AUTO_INCREMENT COMMENT '维度ID',
|
||||
`domain_id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL COMMENT '主题域id',
|
||||
`datasource_id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL COMMENT '所属数据源id',
|
||||
`name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '维度名称',
|
||||
`biz_name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '字段名称',
|
||||
`description` varchar
|
||||
(
|
||||
500
|
||||
) NOT NULL COMMENT '描述',
|
||||
`status` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '维度状态,0正常,1下架,2删除',
|
||||
`sensitive_level` int
|
||||
(
|
||||
10
|
||||
) DEFAULT NULL COMMENT '敏感级别',
|
||||
`type` varchar
|
||||
(
|
||||
50
|
||||
) NOT NULL COMMENT '维度类型 categorical,time',
|
||||
`type_params` text NOT NULL COMMENT '类型参数',
|
||||
`expr` text NOT NULL COMMENT '表达式',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
`created_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '创建人',
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
`updated_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '更新人',
|
||||
`semantic_type` varchar
|
||||
(
|
||||
20
|
||||
) NOT NULL COMMENT '语义类型DATE, ID, CATEGORY'
|
||||
) comment '维度表'
|
||||
61
semantic/model/src/main/resources/sql.ddl/s2_domain.sql
Normal file
61
semantic/model/src/main/resources/sql.ddl/s2_domain.sql
Normal file
@@ -0,0 +1,61 @@
|
||||
CREATE TABLE IF NOT EXISTS `s2_domain`
|
||||
(
|
||||
`id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL AUTO_INCREMENT COMMENT '自增ID',
|
||||
`name` varchar
|
||||
(
|
||||
255
|
||||
) DEFAULT NULL COMMENT '主题域名称',
|
||||
`biz_name` varchar
|
||||
(
|
||||
255
|
||||
) DEFAULT NULL COMMENT '内部名称',
|
||||
`parent_id` bigint
|
||||
(
|
||||
20
|
||||
) DEFAULT '0' COMMENT '父主题域ID',
|
||||
`status` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '主题域状态',
|
||||
`created_at` datetime DEFAULT NULL COMMENT '创建时间',
|
||||
`created_by` varchar
|
||||
(
|
||||
100
|
||||
) DEFAULT NULL COMMENT '创建人',
|
||||
`updated_at` datetime DEFAULT NULL COMMENT '更新时间',
|
||||
`updated_by` varchar
|
||||
(
|
||||
100
|
||||
) DEFAULT NULL COMMENT '更新人',
|
||||
`is_unique` int
|
||||
(
|
||||
10
|
||||
) DEFAULT NULL COMMENT '0为非唯一,1为唯一',
|
||||
`admin` varchar
|
||||
(
|
||||
3000
|
||||
) DEFAULT NULL COMMENT '主题域管理员',
|
||||
`admin_org` varchar
|
||||
(
|
||||
3000
|
||||
) DEFAULT NULL COMMENT '主题域管理员组织',
|
||||
`is_open` tinyint
|
||||
(
|
||||
1
|
||||
) DEFAULT NULL COMMENT '主题域是否公开',
|
||||
`viewer` varchar
|
||||
(
|
||||
3000
|
||||
) DEFAULT NULL COMMENT '主题域可用用户',
|
||||
`view_org` varchar
|
||||
(
|
||||
3000
|
||||
) DEFAULT NULL COMMENT '主题域可用组织',
|
||||
PRIMARY KEY
|
||||
(
|
||||
`id`
|
||||
)
|
||||
) COMMENT='主题域基础信息表'
|
||||
@@ -0,0 +1,36 @@
|
||||
CREATE TABLE IF NOT EXISTS `s2_chat_config`
|
||||
(
|
||||
`id` bigint
|
||||
(
|
||||
20
|
||||
) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`domain_id` bigint
|
||||
(
|
||||
20
|
||||
) DEFAULT NULL COMMENT '主题域id',
|
||||
`default_metrics` varchar
|
||||
(
|
||||
655
|
||||
) DEFAULT NULL COMMENT '默认指标',
|
||||
`visibility` mediumtext COMMENT '不可见的维度/指标信息',
|
||||
`entity_info` mediumtext COMMENT '实体信息',
|
||||
`dictionary_info` mediumtext COMMENT '字典相关的维度设置信息',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
`created_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '创建人',
|
||||
`updated_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '更新人',
|
||||
`status` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '主题域扩展信息状态, 0-删除,1-生效',
|
||||
PRIMARY KEY
|
||||
(
|
||||
`id`
|
||||
)
|
||||
) COMMENT='主题域扩展信息表'
|
||||
54
semantic/model/src/main/resources/sql.ddl/s2_metric.sql
Normal file
54
semantic/model/src/main/resources/sql.ddl/s2_metric.sql
Normal file
@@ -0,0 +1,54 @@
|
||||
CREATE TABLE IF NOT EXISTS `s2_metric`
|
||||
(
|
||||
`id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL PRIMARY KEY AUTO_INCREMENT,
|
||||
`domain_id` bigint
|
||||
(
|
||||
20
|
||||
) NOT NULL COMMENT '主体域ID',
|
||||
`name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '指标名称',
|
||||
`biz_name` varchar
|
||||
(
|
||||
255
|
||||
) NOT NULL COMMENT '字段名称',
|
||||
`description` varchar
|
||||
(
|
||||
500
|
||||
) DEFAULT NULL COMMENT '描述',
|
||||
`status` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '指标状态,0正常,1下架,2删除',
|
||||
`sensitive_level` int
|
||||
(
|
||||
10
|
||||
) NOT NULL COMMENT '敏感级别',
|
||||
`type` varchar
|
||||
(
|
||||
50
|
||||
) NOT NULL COMMENT '指标类型 proxy,expr',
|
||||
`type_params` text NOT NULL COMMENT '类型参数',
|
||||
`created_at` datetime NOT NULL COMMENT '创建时间',
|
||||
`created_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '创建人',
|
||||
`updated_at` datetime NOT NULL COMMENT '更新时间',
|
||||
`updated_by` varchar
|
||||
(
|
||||
100
|
||||
) NOT NULL COMMENT '更新人',
|
||||
`data_format_type` varchar
|
||||
(
|
||||
50
|
||||
) NOT NULL COMMENT '数值类型',
|
||||
`data_format` varchar
|
||||
(
|
||||
500
|
||||
) NOT NULL COMMENT '数值类型参数'
|
||||
) comment '指标表'
|
||||
Reference in New Issue
Block a user