This is an automated email from the ASF dual-hosted git repository.

xiaoyu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shenyu.git


The following commit(s) were added to refs/heads/master by this push:
     new 79f33b409 fix sql problem (#4291)
79f33b409 is described below

commit 79f33b40903f00ad08d79dda34aa11c0b255a3e0
Author: mahaitao <[email protected]>
AuthorDate: Thu Dec 29 10:30:51 2022 +0800

    fix sql problem (#4291)
    
    Co-authored-by: mahaitao617 <[email protected]>
---
 .../main/java/org/apache/shenyu/admin/mapper/TagMapper.java   | 11 +++++++++++
 .../org/apache/shenyu/admin/mapper/TagRelationMapper.java     | 10 ++++++++++
 .../src/main/resources/mappers/tag-relation-sqlmap.xml        |  7 +++++++
 shenyu-admin/src/main/resources/mappers/tag-sqlmap.xml        |  7 +++++++
 4 files changed, 35 insertions(+)

diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagMapper.java 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagMapper.java
index d042666dd..b01b9b57d 100644
--- a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagMapper.java
+++ b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagMapper.java
@@ -17,7 +17,9 @@
 
 package org.apache.shenyu.admin.mapper;
 
+import java.io.Serializable;
 import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
 import org.apache.shenyu.admin.model.entity.TagDO;
 import org.apache.shenyu.admin.model.query.TagQuery;
 import org.apache.shenyu.admin.validation.ExistProvider;
@@ -30,6 +32,15 @@ import java.util.List;
 @Mapper
 public interface TagMapper extends ExistProvider {
 
+    /**
+     * tag existed.
+     *
+     * @param id id
+     * @return existed
+     */
+    @Override
+    Boolean existed(@Param("id") Serializable id);
+
     /**
      * delete by primary key.
      *
diff --git 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagRelationMapper.java
 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagRelationMapper.java
index 78d1d415f..ceb95a8f6 100644
--- 
a/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagRelationMapper.java
+++ 
b/shenyu-admin/src/main/java/org/apache/shenyu/admin/mapper/TagRelationMapper.java
@@ -17,6 +17,7 @@
 
 package org.apache.shenyu.admin.mapper;
 
+import java.io.Serializable;
 import java.util.List;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
@@ -30,6 +31,15 @@ import org.apache.shenyu.admin.validation.ExistProvider;
 @Mapper
 public interface TagRelationMapper extends ExistProvider {
 
+    /**
+     * tag_relation existed.
+     *
+     * @param id id
+     * @return existed
+     */
+    @Override
+    Boolean existed(@Param("id") Serializable id);
+
     /**
      * delete by primary key.
      *
diff --git a/shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml 
b/shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml
index 6fd464c06..13e973fbe 100644
--- a/shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml
+++ b/shenyu-admin/src/main/resources/mappers/tag-relation-sqlmap.xml
@@ -34,6 +34,13 @@
         tag_id
     </sql>
 
+    <select id="existed" resultType="java.lang.Boolean">
+        SELECT TRUE
+        FROM tag_relation
+        WHERE id = #{id}
+        LIMIT 1
+    </select>
+
     <select id="selectByPrimaryKey" parameterType="java.lang.String" 
resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>
diff --git a/shenyu-admin/src/main/resources/mappers/tag-sqlmap.xml 
b/shenyu-admin/src/main/resources/mappers/tag-sqlmap.xml
index f303e4ab2..cf3f4beae 100644
--- a/shenyu-admin/src/main/resources/mappers/tag-sqlmap.xml
+++ b/shenyu-admin/src/main/resources/mappers/tag-sqlmap.xml
@@ -38,6 +38,13 @@
         ext
     </sql>
 
+    <select id="existed" resultType="java.lang.Boolean">
+        SELECT TRUE
+        FROM tag
+        WHERE id = #{id}
+        LIMIT 1
+    </select>
+
     <select id="selectByPrimaryKey" parameterType="java.lang.String" 
resultMap="BaseResultMap">
         SELECT
         <include refid="Base_Column_List"/>

Reply via email to