VideoFileMapper.xml 1.4 KB

123456789101112131415161718192021222324252627
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="cn.reghao.dfs.store.db.mapper.VideoFileMapper">
  4. <insert id="save" useGeneratedKeys="true" keyProperty="id">
  5. insert into video_file
  6. (`id`,`deleted`,`create_time`,`update_time`,`file_id`,`bandwidth`,`frame_rate`,`width`,`height`,`horizontal`,`rotate`,`url_type`,`base_url`,`backup_url`,`duration`,`base_cover_url`)
  7. values
  8. (#{id},#{deleted},#{createTime},#{updateTime},#{fileId},#{bandwidth},#{frameRate},#{width},#{height},#{horizontal},#{rotate},#{urlType},#{baseUrl},#{backupUrl},#{duration},#{baseCoverUrl})
  9. </insert>
  10. <update id="updateSetCover">
  11. update video_file set update_time=now(), base_cover_url=#{coverUrl}
  12. where file_id=#{fileId}
  13. </update>
  14. <update id="updateSetUrl">
  15. update video_file set update_time=now(), base_url=#{baseUrl}, base_cover_url=#{baseCoverUrl}
  16. where file_id=#{fileId}
  17. </update>
  18. <select id="findByFileId" resultType="cn.reghao.dfs.store.model.po.VideoFile">
  19. select * from video_file where file_id=#{fileId} order by create_time desc limit 1
  20. </select>
  21. <select id="findByMatchBaseUrl" resultType="cn.reghao.dfs.store.model.po.VideoFile">
  22. select * from video_file where base_url like concat('%',#{pattern},'%')
  23. </select>
  24. </mapper>