|
|
@@ -1,7 +1,7 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
|
|
|
-<mapper namespace="cn.reghao.dfs.store.db.mapper.FileMetaMapper">
|
|
|
+<mapper namespace="cn.reghao.oss.store.db.mapper.FileMetaMapper">
|
|
|
<insert id="save" useGeneratedKeys="true" keyProperty="id">
|
|
|
insert into file_meta
|
|
|
(`id`,`deleted`,`create_time`,`update_time`,`object_name`,`object_id`,`content_id`,`pid`,`filename`,`size`,`file_type`,`content_type`,`sha256sum`,`upload_by`,`disk_file`,`scope`)
|
|
|
@@ -63,10 +63,10 @@
|
|
|
<select id="count" resultType="java.lang.Integer">
|
|
|
select count(*) from file_meta
|
|
|
</select>
|
|
|
- <select id="findAll" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findAll" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select * from file_meta
|
|
|
</select>
|
|
|
- <select id="findAll0" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findAll0" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select file_meta.* from file_meta
|
|
|
inner join bucket
|
|
|
on bucket.name=#{bucket}
|
|
|
@@ -74,14 +74,14 @@
|
|
|
limit #{max}
|
|
|
</select>
|
|
|
<!-- TODO ${prefix} 和 #{prefix} 的区别 -->
|
|
|
- <select id="findAll1" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findAll1" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select file_meta.* from file_meta
|
|
|
inner join bucket
|
|
|
on bucket.name=#{bucket}
|
|
|
and object_name regexp concat_ws('', '^', '${prefix}', '([^/])+/?$')
|
|
|
limit #{max}
|
|
|
</select>
|
|
|
- <select id="findAll2" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findAll2" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select file_meta.* from file_meta
|
|
|
inner join bucket
|
|
|
on bucket.name=#{bucket}
|
|
|
@@ -90,18 +90,18 @@
|
|
|
limit #{max}
|
|
|
</select>
|
|
|
|
|
|
- <select id="findBySha256sum" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findBySha256sum" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select * from file_meta
|
|
|
where sha256sum=#{sha256sum}
|
|
|
order by create_time asc
|
|
|
limit 1
|
|
|
</select>
|
|
|
- <select id="findByObjectName" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByObjectName" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where object_name=#{objectName}
|
|
|
</select>
|
|
|
- <select id="findByObjectNames" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByObjectNames" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where object_name in
|
|
|
@@ -110,12 +110,12 @@
|
|
|
</foreach>
|
|
|
</select>
|
|
|
|
|
|
- <select id="findByObjectId" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByObjectId" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where object_id=#{objectId}
|
|
|
</select>
|
|
|
- <select id="findByContentId" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByContentId" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where content_id=#{contentId}
|
|
|
@@ -197,12 +197,12 @@
|
|
|
on file_meta.deleted=0 and file_meta.file_type=file_type.id and file_meta.file_type=1000 and file_meta.pid=#{pid}
|
|
|
order by file_type asc
|
|
|
</select>
|
|
|
- <select id="findByFilename" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByFilename" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where pid=#{pid} and filename like concat(#{filename},'%')
|
|
|
</select>
|
|
|
- <select id="findFileInfos" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findFileInfos" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where object_id in
|
|
|
@@ -210,7 +210,7 @@
|
|
|
#{id}
|
|
|
</foreach>
|
|
|
</select>
|
|
|
- <select id="findByPid" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findByPid" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select *
|
|
|
from file_meta
|
|
|
where pid=#{pid}
|
|
|
@@ -229,7 +229,7 @@
|
|
|
order by file_type asc
|
|
|
</select>
|
|
|
|
|
|
- <select id="findFileMetaByPage" resultType="cn.reghao.dfs.store.model.po.FileMeta">
|
|
|
+ <select id="findFileMetaByPage" resultType="cn.reghao.oss.store.model.po.FileMeta">
|
|
|
select * from file_meta
|
|
|
where file_type!=1000
|
|
|
</select>
|