| 123456789101112131415161718192021222324252627282930313233343536373839 |
- <?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.FileUrlMapper">
- <insert id="save" useGeneratedKeys="true" keyProperty="id">
- insert into file_url
- (`id`,`deleted`,`create_time`,`update_time`,`file_id`,`block_id`,`absolute_path`,`url`,`path`,`group`,`node`)
- values
- (#{id},#{deleted},#{createTime},#{updateTime},#{fileId},#{blockId},#{absolutePath},#{url},#{path},#{group},#{node})
- </insert>
- <update id="updateSetFileUrl">
- update file_url set update_time=now(),block_id=#{blockId},absolute_path=#{absolutePath}
- where file_id=#{fileId}
- </update>
- <select id="findAllVideoUrl" resultType="cn.reghao.dfs.store.model.po.FileUrl">
- select * from file_url
- where `group`=0 and node=0 and path like '%video/playback%';
- </select>
- <select id="findAllImageUrl" resultType="cn.reghao.dfs.store.model.po.FileUrl">
- select * from file_url
- where `group`=0 and node=0 and path like '%image%';
- </select>
- <select id="findByUploadId" resultType="cn.reghao.dfs.store.model.dto.FileUrlDto">
- select info.id,info.filename,url.path,url.url,url.absolute_path as absolutePath from file_url url
- inner join file_user fileUser
- inner join file_info info
- on fileUser.file_id=url.file_id and info.file_id=url.file_id and fileUser.upload_id=#{uploadId}
- limit 1
- </select>
- <select id="findByFileId" resultType="cn.reghao.dfs.store.model.po.FileUrl">
- select * from file_url where file_id=#{fileId}
- </select>
- <select id="findFileUrl" resultType="cn.reghao.dfs.store.model.po.FileUrl">
- select * from file_url where file_id=#{fileId} and `group`=#{group} and node=#{node}
- </select>
- </mapper>
|