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 34f650950 [Improve] query sql bug fixed. (#4106)
34f650950 is described below

commit 34f650950ec40ce3379ceac2f0dab5e126222ce8
Author: benjobs <[email protected]>
AuthorDate: Wed Oct 23 22:26:50 2024 +0800

    [Improve] query sql bug fixed. (#4106)
---
 .../src/main/resources/mapper/core/ResourceMapper.xml  | 18 ++++++++++++++----
 .../resources/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 ba95f5e07..af7d50543 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}
         <if test="resource.resourceName != null and resource.resourceName != 
''">
-            and v.resourceName like concat('%', '${resource.resourceName}', 
'%')
+            <if test="_databaseId == 'mysql'">
+                and v.resourceName like concat('%', 
#{resource.resourceName},'%')
+            </if>
+            <if test="_databaseId == 'pgsql'">
+                and v.resourceName like '%' || #{resource.resourceName} || '%'
+            </if>
         </if>
         <if test="resource.description != null and resource.description != ''">
-            and v.description like concat('%', '${resource.description}', '%')
+            <if test="_databaseId == 'mysql'">
+                and v.description like concat('%', #{resource.description},'%')
+            </if>
+            <if test="_databaseId == 'pgsql'">
+                and v.description like '%' || #{resource.description} || '%'
+            </if>
         </if>
     </select>
 
@@ -40,7 +50,7 @@
                 END
         from t_resource
         where creator_id = #{userId}
-        limit 1
+         limit 1
     </select>
 
 
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 f1011cb9b..40e76f06a 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}
             </if>
             <if test="app.appName != null and app.appName != ''">
-                and t.app_name like concat('%', '${app.appName}', '%')
+                <if test="_databaseId == 'mysql'">
+                    and t.app_name like concat('%', #{app.appName},'%')
+                </if>
+                <if test="_databaseId == 'pgsql'">
+                    and t.app_name like '%' || #{app.appName} || '%'
+                </if>
             </if>
             <if test="app.clusterId != null and app.clusterId != ''">
                 and t.cluster_id = #{app.clusterId}
@@ -63,7 +68,12 @@
                 and t.user_id = #{app.userId}
             </if>
             <if test="app.tags != null and app.tags != ''">
-                and t.tags like concat('%', '${app.tags}', '%')
+                <if test="_databaseId == 'mysql'">
+                    and t.tags like concat('%', #{app.tags},'%')
+                </if>
+                <if test="_databaseId == 'pgsql'">
+                    and t.tags like '%' || #{app.tags} || '%'
+                </if>
             </if>
         </where>
     </select>

Reply via email to