This is an automated email from the ASF dual-hosted git repository.
benjobs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-streampark.git
The following commit(s) were added to refs/heads/dev by this push:
new 203c7516e [improve] update sql in xml for cross-compatibility with
mysql, h2, and pgsql in like concat expressions (#3457)
203c7516e is described below
commit 203c7516ecfe5f0ca659cdd5b1ea96a458e4c126
Author: VampireAchao <[email protected]>
AuthorDate: Sat Jan 6 18:31:47 2024 +0800
[improve] update sql in xml for cross-compatibility with mysql, h2, and
pgsql in like concat expressions (#3457)
---
.../src/main/resources/mapper/core/ApplicationMapper.xml | 6 +++---
.../src/main/resources/mapper/core/ProjectMapper.xml | 2 +-
.../src/main/resources/mapper/core/ResourceMapper.xml | 4 ++--
.../src/main/resources/mapper/core/VariableMapper.xml | 6 +++---
.../src/main/resources/mapper/core/YarnQueueMapper.xml | 2 +-
.../src/main/resources/mapper/system/MemberMapper.xml | 2 +-
.../src/main/resources/mapper/system/RoleMapper.xml | 2 +-
.../src/main/resources/mapper/system/TeamMapper.xml | 2 +-
.../src/main/resources/mapper/system/UserMapper.xml | 2 +-
9 files changed, 14 insertions(+), 14 deletions(-)
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
index 00e03ae7e..60d5b5b90 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ApplicationMapper.xml
@@ -150,10 +150,10 @@
and t.execution_mode = #{app.executionMode}
</if>
<if test="app.jobName != null and app.jobName != ''">
- and t.job_name like concat('%',#{app.jobName},'%')
+ and t.job_name like concat('%', CAST(#{app.jobName} AS CHAR),
'%')
</if>
<if test="app.projectName != null and app.projectName != ''">
- and p.name like concat('%',#{app.projectName},'%')
+ and p.name like concat('%', CAST(#{app.projectName} AS CHAR),
'%')
</if>
<if test="app.appId != null and app.appId != ''">
and t.app_id = #{app.appId}
@@ -172,7 +172,7 @@
</foreach>
</if>
<if test="app.tags != null and app.tags != ''">
- and t.tags like concat('%',#{app.tags},'%')
+ and t.tags like concat('%', CAST(#{app.tags} AS CHAR), '%')
</if>
</where>
</select>
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ProjectMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ProjectMapper.xml
index a53aa7886..ca651f92f 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ProjectMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ProjectMapper.xml
@@ -82,7 +82,7 @@
<where>
t.team_id = #{project.teamId}
<if test="project.name != null and project.name != ''">
- and t.name like concat('%',#{project.name},'%')
+ and t.name like concat('%', CAST(#{project.name} AS CHAR), '%')
</if>
<if test="project.buildState != null">
and t.build_state = #{project.buildState}
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
index 5c7b8db42..7f476a377 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/ResourceMapper.xml
@@ -42,10 +42,10 @@
on v.creator_id = u.user_id
and v.team_id = ${resource.teamId}
<if test="resource.resourceName != null and resource.resourceName !=
''">
- and v.resourceName like concat('%',#{resource.resourceName},'%')
+ and v.resourceName like concat('%', CAST(#{resource.resourceName}
AS CHAR), '%')
</if>
<if test="resource.description != null and resource.description != ''">
- and v.description like concat('%',#{resource.description},'%')
+ and v.description like concat('%', CAST(#{resource.description} AS
CHAR), '%')
</if>
</select>
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
index 4ac335a5d..7f77e119f 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/VariableMapper.xml
@@ -38,10 +38,10 @@
on v.creator_id = u.user_id
and v.team_id = ${variable.teamId}
<if test="variable.description != null and variable.description != ''">
- and v.description like concat('%',#{variable.description},'%')
+ and v.description like concat('%', CAST(#{variable.description} AS
CHAR), '%')
</if>
<if test="variable.variableCode != null and variable.variableCode !=
''">
- and v.variable_code like concat('%',#{variable.variableCode},'%')
+ and v.variable_code like concat('%', CAST(#{variable.variableCode}
AS CHAR), '%')
</if>
</select>
@@ -61,7 +61,7 @@
<where>
team_id = #{teamId}
<if test="keyword != null and keyword != ''">
- and variable_code like concat('%', #{keyword}, '%') or
description like concat('%', #{keyword}, '%')
+ and variable_code like concat('%', CAST(#{keyword} AS CHAR),
'%') or description like concat('%', CAST(#{keyword} AS CHAR), '%')
</if>
</where>
</select>
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
index 5063c1a0f..af9b53980 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/core/YarnQueueMapper.xml
@@ -33,7 +33,7 @@
team_id = #{yarnQueue.teamId}
</if>
<if test="yarnQueue.queueLabel != null and yarnQueue.queueLabel !=
''">
- and queue_label like concat('%',#{yarnQueue.queueLabel},'%')
+ and queue_label like concat('%', CAST(#{yarnQueue.queueLabel}
AS CHAR), '%')
</if>
<if test="yarnQueue.createTimeFrom != null and
yarnQueue.createTimeFrom !=''">
and create_time > #{yarnQueue.createTimeFrom}
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
index eb060fbd2..f4a1a8397 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/MemberMapper.xml
@@ -51,7 +51,7 @@
<where>
tur.team_id = ${member.teamId}
<if test="member.userName != null and member.userName != ''">
- and u.username like concat('%',#{member.userName},'%')
+ and u.username like concat('%', CAST(#{member.userName} AS
CHAR), '%')
</if>
<if test="member.roleName != null and member.roleName != ''">
and r.role_name = ${member.roleName}
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
index ada6a327f..d5d132280 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/RoleMapper.xml
@@ -29,7 +29,7 @@
select * from t_role
<where>
<if test="role.roleName != null and role.roleName != ''">
- and role_name like concat('%',#{role.roleName},'%')
+ and role_name like concat('%', CAST(#{role.roleName} AS CHAR),
'%')
</if>
<if test="role.createTimeFrom != null and role.createTimeFrom
!=''">
and create_time > #{role.createTimeFrom}
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
index 38d1c4a27..0b15412b3 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/TeamMapper.xml
@@ -29,7 +29,7 @@
select * from t_team
<where>
<if test="team.teamName != null and team.teamName != ''">
- and team_name like concat('%',#{team.teamName},'%')
+ and team_name like concat('%', CAST(#{team.teamName} AS CHAR),
'%')
</if>
<if test="team.createTimeFrom != null and team.createTimeFrom
!=''">
and create_time > #{team.createTimeFrom}
diff --git
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
index a4f2c0a44..20b83f61d 100644
---
a/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
+++
b/streampark-console/streampark-console-service/src/main/resources/mapper/system/UserMapper.xml
@@ -38,7 +38,7 @@
select * from t_user
<where>
<if test="user.username != null and user.username != ''">
- and username like concat('%',#{user.username},'%')
+ and username like concat('%', CAST(#{user.username} AS CHAR),
'%')
</if>
<if test="user.createTimeFrom != null and user.createTimeFrom
!=''">
and create_time > #{user.createTimeFrom}