From 5e82aa5f39981e6ba0909a493f091954cebd24c8 Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: 星期四, 20 六月 2024 20:04:48 +0800 Subject: [PATCH] 优化拉流代理国标级联点播 --- src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 52 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java index 49ba89e..a654ea0 100644 --- a/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java +++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/CloudRecordServiceMapper.java @@ -1,11 +1,8 @@ package com.genersoft.iot.vmp.storager.dao; -import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem; +import com.genersoft.iot.vmp.media.bean.MediaServer; import com.genersoft.iot.vmp.service.bean.CloudRecordItem; -import org.apache.ibatis.annotations.Insert; -import org.apache.ibatis.annotations.Mapper; -import org.apache.ibatis.annotations.Param; -import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.annotations.*; import java.util.List; @@ -53,12 +50,15 @@ " <if test= 'mediaServerItemList != null ' > and media_server_id in " + " <foreach collection='mediaServerItemList' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" + " </if>" + + " <if test= 'ids != null ' > and id in " + + " <foreach collection='ids' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + + " </if>" + " order by start_time DESC" + - " </script>") List<CloudRecordItem> getList(@Param("query") String query, @Param("app") String app, @Param("stream") String stream, @Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp, - @Param("callId")String callId, List<MediaServerItem> mediaServerItemList); + @Param("callId")String callId, List<MediaServer> mediaServerItemList, + List<Integer> ids); @Select(" <script>" + @@ -76,6 +76,50 @@ " </script>") List<String> queryRecordFilePathList(@Param("app") String app, @Param("stream") String stream, @Param("startTimeStamp")Long startTimeStamp, @Param("endTimeStamp")Long endTimeStamp, - @Param("callId")String callId, List<MediaServerItem> mediaServerItemList); + @Param("callId")String callId, List<MediaServer> mediaServerItemList); + @Update(" <script>" + + "update wvp_cloud_record set collect = #{collect} where file_path in " + + " <foreach collection='cloudRecordItemList' item='item' open='(' separator=',' close=')' > #{item.filePath}</foreach>" + + " </script>") + int updateCollectList(@Param("collect") boolean collect, List<CloudRecordItem> cloudRecordItemList); + + @Delete(" <script>" + + "delete from wvp_cloud_record where media_server_id=#{mediaServerId} and file_path in " + + " <foreach collection='filePathList' item='item' open='(' separator=',' close=')' > #{item}</foreach>" + + " </script>") + void deleteByFileList(List<String> filePathList, @Param("mediaServerId") String mediaServerId); + + + @Select(" <script>" + + "select *" + + " from wvp_cloud_record " + + " where collect = false and end_time <= #{endTimeStamp} and media_server_id = #{mediaServerId} " + + " </script>") + List<CloudRecordItem> queryRecordListForDelete(@Param("endTimeStamp")Long endTimeStamp, String mediaServerId); + + @Update(" <script>" + + "update wvp_cloud_record set collect = #{collect} where id = #{recordId} " + + " </script>") + int changeCollectById(@Param("collect") boolean collect, @Param("recordId") Integer recordId); + + @Delete(" <script>" + + "delete from wvp_cloud_record where id in " + + " <foreach collection='cloudRecordItemIdList' item='item' open='(' separator=',' close=')' > #{item.id}</foreach>" + + " </script>") + int deleteList(List<CloudRecordItem> cloudRecordItemIdList); + + @Select(" <script>" + + "select *" + + " from wvp_cloud_record " + + "where call_id = #{callId}" + + " </script>") + List<CloudRecordItem> getListByCallId(@Param("callId") String callId); + + @Select(" <script>" + + "select *" + + " from wvp_cloud_record " + + "where id = #{id}" + + " </script>") + CloudRecordItem queryOne(@Param("id") Integer id); } -- Gitblit v1.8.0