You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@linkis.apache.org by ca...@apache.org on 2022/10/18 01:58:25 UTC

[incubator-linkis] branch dev-1.3.1 updated: [ResourceDao]The sql annotation form is optimized to XML (#3647)

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

casion pushed a commit to branch dev-1.3.1
in repository https://gitbox.apache.org/repos/asf/incubator-linkis.git


The following commit(s) were added to refs/heads/dev-1.3.1 by this push:
     new e3c7f393b [ResourceDao]The sql annotation form is optimized to XML  (#3647)
e3c7f393b is described below

commit e3c7f393bcaf59194f1b2ea456d588a693481fec
Author: 成彬彬 <10...@users.noreply.github.com>
AuthorDate: Tue Oct 18 09:58:20 2022 +0800

    [ResourceDao]The sql annotation form is optimized to XML  (#3647)
---
 .../src/main/java/org/apache/linkis/bml/dao/ResourceDao.java   |  7 -------
 .../java/org/apache/linkis/bml/dao/impl/ResourceMapper.xml     | 10 ++++++++++
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/ResourceDao.java b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/ResourceDao.java
index 5fb770c65..c056b2ed4 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/ResourceDao.java
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/ResourceDao.java
@@ -20,8 +20,6 @@ package org.apache.linkis.bml.dao;
 import org.apache.linkis.bml.entity.Resource;
 
 import org.apache.ibatis.annotations.Param;
-import org.apache.ibatis.annotations.Select;
-import org.apache.ibatis.annotations.Update;
 
 import java.util.List;
 import java.util.Map;
@@ -36,17 +34,12 @@ public interface ResourceDao {
 
   long uploadResource(Resource resource);
 
-  @Select(
-      "select exists(select * from `linkis_ps_bml_resources` where resource_id = #{resourceId}  and enable_flag = 1 )")
   int checkExists(@Param("resourceId") String resourceId);
 
   Resource getResource(@Param("resourceId") String resourceId);
 
-  @Select("select owner from `linkis_ps_bml_resources` where resource_id = #{resourceId} ")
   String getUserByResourceId(@Param("resourceId") String resourceId);
 
-  @Update(
-      "update `linkis_ps_bml_resources` set owner = #{newOwner} where resource_id = #{resourceId} and owner=#{oldOwner}")
   void changeOwner(
       @Param("resourceId") String resourceId,
       @Param("oldOwner") String oldOwner,
diff --git a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/impl/ResourceMapper.xml b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/impl/ResourceMapper.xml
index df11ce22e..0234e49b8 100644
--- a/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/impl/ResourceMapper.xml
+++ b/linkis-public-enhancements/linkis-bml/linkis-bml-server/src/main/java/org/apache/linkis/bml/dao/impl/ResourceMapper.xml
@@ -92,6 +92,16 @@
                     #{updator},#{enableFlag})
     </insert>
 
+    <select id="checkExists" resultType="java.lang.Integer">
+        select exists(select * from `linkis_ps_bml_resources` where resource_id = #{resourceId}  and enable_flag = 1 )
+    </select>
+
+    <select id="getUserByResourceId"  resultType="java.lang.String">
+        select owner from `linkis_ps_bml_resources` where resource_id = #{resourceId}
+    </select>
 
+    <update id="changeOwner">
+        update `linkis_ps_bml_resources` set owner = #{newOwner} where resource_id = #{resourceId} and owner=#{oldOwner}
+    </update>
 </mapper>
 


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@linkis.apache.org
For additional commands, e-mail: commits-help@linkis.apache.org