Prechádzať zdrojové kódy

update FileMetaMapper

reghao 2 rokov pred
rodič
commit
a803cb16b9

+ 3 - 9
dfs-store/src/main/java/cn/reghao/dfs/store/db/mapper/FileMetaMapper.java

@@ -19,24 +19,19 @@ import java.util.List;
 public interface FileMetaMapper extends BaseMapper<FileMeta> {
     void updateScopeByObjectIds(@Param("scope") int scope, @Param("list") List<String> list);
 
+    List<FileMeta> findFileMetaByPage(Page page);
     FileMeta findBySha256sum(String sha256sum);
     FileMeta findByObjectName(String objectName);
     FileMeta findByObjectId(String objectId);
     List<FileMeta> findByContentId(String contentId);
+    ObjectMeta findObjectMeta(String objectName);
 
+    /******************************************************************************************************************/
     List<FileMeta> findAll0(@Param("bucket") String bucket, @Param("max") Integer max, @Param("regex") String regex);
     List<FileMeta> findAll1(@Param("bucket") String bucket, @Param("prefix") String prefix, @Param("max") Integer max);
     List<FileMeta> findAll2(@Param("bucket") String bucket, @Param("prefix") String prefix, @Param("start") String start, @Param("max") Integer max);
-
-    List<FileMeta> findFileMetaByPage(Page page);
-    ObjectMeta findObjectMeta(String objectName);
-    List<ObjectMeta> findObjectMetaByPage(Page page);
-
-    /******************************************************************************************************************/
-    void updateSetAcl(@Param("objectId") String objectId, @Param("scope") int scope);
     void updateFilename(@Param("objectId") String objectId, @Param("filename") String filename);
     void updateParent(@Param("objectId") String objectId, @Param("pid") String pid);
-    void updateSetDelete(String objectId);
     void updateBatch(List<FileMeta> list);
 
     int countByPid(String pid);
@@ -53,5 +48,4 @@ public interface FileMetaMapper extends BaseMapper<FileMeta> {
     List<FileMeta> findByFilename(@Param("pid") String pid, @Param("filename") String filename);
     List<FileMeta> findByPid(String pid);
     List<String> findObjectPrefix();
-    Integer findAclByObjectPrefix(String objectPrefix);
 }

+ 10 - 27
dfs-store/src/main/resources/mapper/FileMetaMapper.xml

@@ -17,6 +17,16 @@
         </foreach>
     </insert>
 
+    <delete id="delete">
+        delete from file_meta
+        where object_id=#{objectId}
+    </delete>
+
+    <update id="update">
+        update file_meta
+        set object_name=#{objectName}
+        where object_id=#{objectId}
+    </update>
     <update id="updateScopeByObjectIds">
         update file_meta
         set scope=#{scope}
@@ -25,16 +35,6 @@
             #{item.objectId}
         </foreach>
     </update>
-    <update id="updateSetAcl">
-        update file_meta
-        set update_time=now() and scope=#{scope}
-        where object_id=#{objectId}
-    </update>
-    <update id="update">
-        update file_meta
-        set object_name=#{objectName}
-        where object_id=#{objectId}
-    </update>
     <update id="updateBatch">
         update file_meta
         <trim prefix="set" suffixOverrides=",">
@@ -111,13 +111,6 @@
         on file_meta.content_id=data_block.content_id
         and file_meta.object_name=#{objectName}
     </select>
-    <select id="findObjectMetaByPage" resultType="cn.reghao.oss.api.dto.ObjectMeta">
-        select file_meta.size,file_meta.content_type,file_meta.object_name,file_meta.object_id,file_meta.scope as scope,file_meta.upload_by,
-        data_block.absolute_path
-        from file_meta
-        inner join data_block
-        on file_meta.object_id=data_block.object_id
-    </select>
 
     <!--*************************************************************************************************************-->
     <update id="updateFilename">
@@ -130,11 +123,6 @@
         set update_time=now() and pid=#{pid}
         where object_id=#{objectId}
     </update>
-    <update id="updateSetDelete">
-        update file_meta
-        set update_time=now() and deleted=1
-        where object_id=#{objectId}
-    </update>
 
     <select id="countByPid" resultType="java.lang.Integer">
         select count(*)
@@ -216,9 +204,4 @@
         select * from file_meta
         where file_type==1000
     </select>
-    <select id="findAclByObjectPrefix" resultType="java.lang.Integer">
-        select scope
-        from file_meta
-        where object_prefix=#{objectPrefix}
-    </select>
 </mapper>