30天之前的数据访问minio,30天之后的数据访问oss
This commit is contained in:
@@ -3,31 +3,31 @@
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.central.file.mapper.FileMapper">
|
||||
|
||||
<sql id="where">
|
||||
<where>
|
||||
<if test="f.name != null and f.name != ''">
|
||||
and t.name like concat('%', #{f.name}, '%')
|
||||
</if>
|
||||
<if test="f.beginTime != null and f.beginTime != ''">
|
||||
and t.create_time >= #{f.beginTime}
|
||||
</if>
|
||||
<if test="f.endTime != null and f.endTime != ''">
|
||||
and t.create_time <= #{f.endTime}
|
||||
</if>
|
||||
<sql id="where">
|
||||
<where>
|
||||
<if test="f.name != null and f.name != ''">
|
||||
and t.name like concat('%', #{f.name}, '%')
|
||||
</if>
|
||||
<if test="f.beginTime != null and f.beginTime != ''">
|
||||
and t.create_time >= #{f.beginTime}
|
||||
</if>
|
||||
<if test="f.endTime != null and f.endTime != ''">
|
||||
and t.create_time <= #{f.endTime}
|
||||
</if>
|
||||
<if test="f.searchKey != null and f.searchKey != ''">
|
||||
and t.name like concat('%', #{f.searchKey}, '%')
|
||||
</if>
|
||||
</where>
|
||||
</sql>
|
||||
</where>
|
||||
</sql>
|
||||
|
||||
<select id="findList" resultType="com.central.common.model.FileInfo">
|
||||
select * from file_info t
|
||||
<include refid= "where" />
|
||||
order by t.create_time desc
|
||||
</select>
|
||||
<select id="findList" resultType="com.central.common.model.FileInfo">
|
||||
select * from file_info t
|
||||
<include refid= "where" />
|
||||
order by t.create_time desc
|
||||
</select>
|
||||
|
||||
<select id="findById" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info WHERE id = #{id}
|
||||
<select id="findById" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info WHERE id = #{id}
|
||||
</select>
|
||||
|
||||
<!-- 查询文件列表 -->
|
||||
@@ -50,34 +50,6 @@
|
||||
ORDER BY createTime DESC
|
||||
</select>
|
||||
|
||||
<!-- 查询热数据文件列表 -->
|
||||
<select id="selectHotDataFiles" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info
|
||||
WHERE create_time >= #{hotDataThreshold}
|
||||
AND size > 0
|
||||
AND (storage_type IS NULL OR storage_type NOT LIKE '%S3%' OR storage_type NOT LIKE '%MINIO%')
|
||||
AND (path IS NULL OR path NOT LIKE '%s3://%' OR path NOT LIKE '%minio%')
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
|
||||
<!-- 根据存储类型查询文件 -->
|
||||
<select id="selectFilesByStorageType" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info
|
||||
WHERE storage_type = #{storageType}
|
||||
AND size > 0
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
|
||||
<!-- 查询需要同步的文件(不在S3中的OSS文件) -->
|
||||
<select id="selectFilesNeedSync" resultType="com.central.common.model.FileInfo">
|
||||
SELECT * FROM file_info
|
||||
WHERE (storage_type IS NULL OR storage_type NOT LIKE '%S3%' OR storage_type NOT LIKE '%MINIO%')
|
||||
AND (path IS NULL OR path NOT LIKE '%s3://%' OR path NOT LIKE '%minio%')
|
||||
AND size > 0
|
||||
ORDER BY create_time DESC
|
||||
LIMIT #{limit}
|
||||
</select>
|
||||
<!-- 热数据同步相关查询已移除(外部同步) -->
|
||||
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user