mirror of
https://github.com/tencentmusic/supersonic.git
synced 2025-12-31 06:18:04 +08:00
[improvement]Use QueryWrapper in place of hard-coded SQLs (#1944)
Some checks are pending
supersonic CentOS CI / build (11) (push) Waiting to run
supersonic CentOS CI / build (21) (push) Waiting to run
supersonic CentOS CI / build (8) (push) Waiting to run
supersonic mac CI / build (11) (push) Waiting to run
supersonic mac CI / build (21) (push) Waiting to run
supersonic mac CI / build (8) (push) Waiting to run
supersonic ubuntu CI / build (11) (push) Waiting to run
supersonic ubuntu CI / build (21) (push) Waiting to run
supersonic ubuntu CI / build (8) (push) Waiting to run
supersonic windows CI / build (11) (push) Waiting to run
supersonic windows CI / build (21) (push) Waiting to run
supersonic windows CI / build (8) (push) Waiting to run
Some checks are pending
supersonic CentOS CI / build (11) (push) Waiting to run
supersonic CentOS CI / build (21) (push) Waiting to run
supersonic CentOS CI / build (8) (push) Waiting to run
supersonic mac CI / build (11) (push) Waiting to run
supersonic mac CI / build (21) (push) Waiting to run
supersonic mac CI / build (8) (push) Waiting to run
supersonic ubuntu CI / build (11) (push) Waiting to run
supersonic ubuntu CI / build (21) (push) Waiting to run
supersonic ubuntu CI / build (8) (push) Waiting to run
supersonic windows CI / build (11) (push) Waiting to run
supersonic windows CI / build (21) (push) Waiting to run
supersonic windows CI / build (8) (push) Waiting to run
* [improvement][launcher]Use API to get element ID avoiding hard-code. * [fix][launcher]Fix mysql scripts. * [improvement][launcher]Support DuckDB database and refactor translator code structure. * [improvement][headless-fe] Revamped the interaction for semantic modeling routing and successfully implemented the switching between dimension and dataset management. * [improvement][Headless] Add table ddl in Dbschema * [improvement][Headless] Add get database by type * [improvement][Headless] Supports automatic batch creation of models based on db table names. * [improvement][Headless] Supports getting domain by bizName * [improvement][launcher]Refactor unit tests and demo data. * [fix][launcher]Change default vector dimension to 512. * [improvement](Dict) add dimValueAliasMap info for KnowledgeBaseService * [improvement][headless]Use QueryWrapper to replace hard-code SQL in mapper xml. * [improvement][chat]Introduce ChatMemory to delegate ChatMemoryDO. * [fix][common]Fix embedding store sys configs. * [fix][common]Fix postgres schema, using varchar instead of char. * [improvement][launcher]Change supersonic docker deployment from mysql to postgres. * [Fix][launcher]Fix a number of issues related to semantic modeling. * [Fix][headless]Fix the evaluation logic of agg type. * [fix][assembly]Fix Dockerfile and add docker compose run script. * [fix][chat]Fix "multiple assignments to same column "similar_queries". * [improvement][headless]Use LamdaQueryWrapper to avoid hard-coded column names. * [improvement][headless]Refactor headless infra to support advanced semantic modelling. * [improvement][headless]Change class name `Dim` to `Dimension`. * [improvement][chat]Introduce `TimeFieldMapper` to always map time field. * [fix][headless]Remove unnecessary dimension existence check. * [fix][chat]Fix adjusted filters don't take effect. ---------
This commit is contained in:
@@ -116,63 +116,6 @@
|
||||
</foreach>
|
||||
</update>
|
||||
|
||||
<select id="query" resultMap="ResultMapWithBLOBs">
|
||||
select t.*, (case when t1.id is not null then 1 else 0 end) as isTag
|
||||
from s2_dimension t
|
||||
left join (
|
||||
select *
|
||||
from s2_tag
|
||||
where type = 'DIMENSION'
|
||||
) t1 on t.id = t1.item_id
|
||||
where status != 3
|
||||
<if test="key != null and key != ''">
|
||||
and ( t.id like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
|
||||
t.name like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
|
||||
t.biz_name like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
|
||||
t.alias like CONCAT('%',#{key , jdbcType=VARCHAR},'%') or
|
||||
t.description like CONCAT('%',#{key , jdbcType=VARCHAR},'%') )
|
||||
</if>
|
||||
<if test="id != null">
|
||||
and t.id like CONCAT('%',#{id , jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="name != null and name != '' ">
|
||||
and t.name like CONCAT('%',#{name , jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="bizName != null and bizName != ''">
|
||||
and t.biz_name like CONCAT('%',#{bizName , jdbcType=VARCHAR},'%')
|
||||
</if>
|
||||
<if test="sensitiveLevel != null">
|
||||
and t.sensitive_level = #{sensitiveLevel}
|
||||
</if>
|
||||
<if test="status != null">
|
||||
and t.status = #{status}
|
||||
</if>
|
||||
<if test="modelIds != null and modelIds.size >0">
|
||||
and t.model_id in
|
||||
<foreach collection="modelIds" index="index" item="model" open="(" close=")"
|
||||
separator=",">
|
||||
#{model}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="ids != null and ids.size >0">
|
||||
and t.id in
|
||||
<foreach collection="ids" index="index" item="id" open="(" close=")"
|
||||
separator=",">
|
||||
#{id}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="createdBy != null">
|
||||
and t.created_by = #{createdBy}
|
||||
</if>
|
||||
<if test="isTag != null and isTag == 1">
|
||||
and t1.id is not null
|
||||
</if>
|
||||
<if test="isTag != null and isTag == 0">
|
||||
and t1.id is null
|
||||
</if>
|
||||
</select>
|
||||
|
||||
|
||||
<select id="queryDimensions" resultMap="ResultMapWithBLOBs">
|
||||
select *
|
||||
from s2_dimension
|
||||
|
||||
Reference in New Issue
Block a user