From 34f650950ec40ce3379ceac2f0dab5e126222ce8 Mon Sep 17 00:00:00 2001 From: benjobs Date: Wed, 23 Oct 2024 22:26:50 +0800 Subject: [PATCH] [Improve] query sql bug fixed. (#4106) --- .../resources/mapper/core/ResourceMapper.xml | 18 ++++++++++++++---- .../mapper/core/SparkApplicationMapper.xml | 14 ++++++++++++-- 2 files changed, 26 insertions(+), 6 deletions(-) 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 ba95f5e07e..af7d505436 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 @@ -24,12 +24,22 @@ from t_resource v inner join t_user u on v.creator_id = u.user_id - and v.team_id = ${resource.teamId} + and v.team_id = #{resource.teamId} - and v.resourceName like concat('%', '${resource.resourceName}', '%') + + and v.resourceName like concat('%', #{resource.resourceName},'%') + + + and v.resourceName like '%' || #{resource.resourceName} || '%' + - and v.description like concat('%', '${resource.description}', '%') + + and v.description like concat('%', #{resource.description},'%') + + + and v.description like '%' || #{resource.description} || '%' + @@ -40,7 +50,7 @@ END from t_resource where creator_id = #{userId} - limit 1 + limit 1 diff --git a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml index f1011cb9b6..40e76f06aa 100644 --- a/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml +++ b/streampark-console/streampark-console-service/src/main/resources/mapper/core/SparkApplicationMapper.xml @@ -51,7 +51,12 @@ and t.deploy_mode = #{app.deployMode} - and t.app_name like concat('%', '${app.appName}', '%') + + and t.app_name like concat('%', #{app.appName},'%') + + + and t.app_name like '%' || #{app.appName} || '%' + and t.cluster_id = #{app.clusterId} @@ -63,7 +68,12 @@ and t.user_id = #{app.userId} - and t.tags like concat('%', '${app.tags}', '%') + + and t.tags like concat('%', #{app.tags},'%') + + + and t.tags like '%' || #{app.tags} || '%' +