Ver código fonte

数据迁移

wangyunpeng 9 meses atrás
pai
commit
f82e32b29b
13 arquivos alterados com 520 adições e 0 exclusões
  1. 19 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/crawler/CrawlerBaseMapper.java
  2. 13 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/LongArticleBaseMapper.java
  3. 22 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/ArticleMatchVideos.java
  4. 13 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/GetOffVideos.java
  5. 27 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesCrawlerVideos.java
  6. 21 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesMatchVideos.java
  7. 15 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesRootSourceId.java
  8. 14 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesText.java
  9. 30 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesVideo.java
  10. 217 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataFlushService.java
  11. 43 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/DataFlushController.java
  12. 26 0
      long-article-recommend-service/src/main/resources/mapper/crawler/CrawlerBaseMapper.xml
  13. 60 0
      long-article-recommend-service/src/main/resources/mapper/longArticle/LongArticleBaseMapper.xml

+ 19 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/crawler/CrawlerBaseMapper.java

@@ -1,5 +1,9 @@
 package com.tzld.longarticle.recommend.server.mapper.crawler;
 
+import com.tzld.longarticle.recommend.server.model.dto.ArticleMatchVideos;
+import com.tzld.longarticle.recommend.server.model.dto.GetOffVideos;
+import com.tzld.longarticle.recommend.server.model.dto.LongArticlesRootSourceId;
+import com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideo;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.AccountCorrelation;
 
 import java.util.List;
@@ -8,4 +12,19 @@ public interface CrawlerBaseMapper {
 
     void batchInsertAccountCorrelation(List<AccountCorrelation> list);
 
+    Integer countGetOffVideos();
+
+    List<GetOffVideos> pageGetOffVideos(int offset, int pageSize);
+
+    Integer countLongArticlesRootSourceId();
+
+    List<LongArticlesRootSourceId> pageLongArticlesRootSourceId(int offset, int pageSize);
+
+    Integer countArticleMatchVideos();
+
+    List<ArticleMatchVideos> pageArticleMatchVideos(int offset, int pageSize);
+
+    Integer countLongArticlesVideos();
+
+    List<LongArticlesVideo> pageLongArticlesVideos(int offset, int pageSize);
 }

+ 13 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/LongArticleBaseMapper.java

@@ -1,5 +1,6 @@
 package com.tzld.longarticle.recommend.server.mapper.longArticle;
 
+import com.tzld.longarticle.recommend.server.model.dto.*;
 import com.tzld.longarticle.recommend.server.model.entity.longArticle.DatastatSortStrategy;
 import org.apache.ibatis.annotations.Mapper;
 
@@ -12,4 +13,16 @@ public interface LongArticleBaseMapper {
 
     void batchInsertDatastatSortStrategy(List<DatastatSortStrategy> list);
 
+    void batchInsertGetOffVideos(List<GetOffVideos> list);
+
+    int batchInsertLongArticlesRootSourceId(List<LongArticlesRootSourceId> list);
+
+    int batchInsertLongArticlesCrawlerVideos(List<LongArticlesCrawlerVideos> list);
+
+    int batchInsertLongArticlesText(List<LongArticlesText> list);
+
+    List<String> getLongArticlesTextByContentIds(List<String> contentIds);
+
+    int batchInsertLongArticlesMatchVideos(List<LongArticlesMatchVideos> list);
+
 }

+ 22 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/ArticleMatchVideos.java

@@ -0,0 +1,22 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class ArticleMatchVideos {
+    private String videoId;
+    private String traceId;
+    private String contentId;
+    private String rootSourceId;
+    private String videoPath;
+    private Long requestTime;
+    private Date updateTime;
+    private Integer videoStatus;
+    private Integer ossStatus;
+    private String coverPath;
+    private String platform;
+    private String uid;
+    private String videoTitle;
+}

+ 13 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/GetOffVideos.java

@@ -0,0 +1,13 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+@Data
+public class GetOffVideos {
+    private Long videoId; // 视频id
+    private Long publishTime; // 视频发布时间
+    private Integer videoStatus; // 视频状态
+    private String traceId; // 最终id
+    private Long getOffTime; // 视频下架时间
+    private Integer checkStatus; // 校验状态,默认为0
+}

+ 27 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesCrawlerVideos.java

@@ -0,0 +1,27 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LongArticlesCrawlerVideos {
+    private Integer id;
+    private String contentId;
+    private String outVideoId;
+    private String platform;
+    private String videoTitle;
+    private Integer playCount;
+    private Integer likeCount;
+    private Integer shareCount;
+    private Date publishTime;
+    private Date crawlerTime;
+    private Integer duration;
+    private String videoUrl;
+    private String coverUrl;
+    private Integer downloadStatus;
+    private String videoOssPath;
+    private String coverOssPath;
+    private String userId;
+    private String traceId;
+}

+ 21 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesMatchVideos.java

@@ -0,0 +1,21 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LongArticlesMatchVideos {
+    private Integer id;
+    private String traceId;
+    private String contentId;
+    private String flowPoolLevel;
+    private String ghId;
+    private String accountName;
+    private Integer contentStatus;
+    private Integer successStatus;
+    private Integer requestTimestamp;
+    private Date updateTime;
+    private String response;
+    private Integer processTimes;
+}

+ 15 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesRootSourceId.java

@@ -0,0 +1,15 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+@Data
+public class LongArticlesRootSourceId {
+    private String rootSourceId;
+    private String accountName;
+    private String ghId;
+    private String articleTitle;
+    private Integer requestTime;
+    private String traceId;
+    private Integer pushType;
+    private Long videoId;
+}

+ 14 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesText.java

@@ -0,0 +1,14 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+@Data
+public class LongArticlesText {
+    private String contentId;
+    private String articleTitle;
+    private String articleText;
+    private String kimiTitle;
+    private String kimiSummary;
+    private String kimiKeys;
+    private Integer kimiStatus;
+}

+ 30 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/LongArticlesVideo.java

@@ -0,0 +1,30 @@
+package com.tzld.longarticle.recommend.server.model.dto;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class LongArticlesVideo {
+    private Long id;
+    private String traceId;
+    private String contentId;
+    private String ghId;
+    private String accountName;
+    private String articleTitle;
+    private String articleText;
+    private Integer contentStatus;
+    private String kimiTitle;
+    private String kimiSummary;
+    private String kimiKeys;
+    private Integer recallVideoId1;
+    private Integer recallVideoId2;
+    private Integer recallVideoId3;
+    private String result1;
+    private String result2;
+    private String result3;
+    private Integer success;
+    private Date updateTime;
+    private Integer requestTimeStamp;
+    private Integer processTimes;
+}

+ 217 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/DataFlushService.java

@@ -0,0 +1,217 @@
+package com.tzld.longarticle.recommend.server.service;
+
+import cn.hutool.core.collection.CollectionUtil;
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
+import com.tzld.longarticle.recommend.server.model.dto.*;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.util.CollectionUtils;
+import org.springframework.util.StringUtils;
+
+import java.net.URLDecoder;
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class DataFlushService {
+
+    @Autowired
+    private LongArticleBaseMapper longArticleBaseMapper;
+    @Autowired
+    private CrawlerBaseMapper crawlerBaseMapper;
+
+
+    public void flushGetOffVideos(Integer pageNum) {
+        int pageSize = 1000;
+        if (pageNum == null) {
+            pageNum = 1;
+        }
+        int count = crawlerBaseMapper.countGetOffVideos();
+        int totalPage = count / pageSize + 1;
+        while (pageNum <= totalPage) {
+            int offset = (pageNum - 1) * pageSize;
+            List<GetOffVideos> list = crawlerBaseMapper.pageGetOffVideos(offset, pageSize);
+            longArticleBaseMapper.batchInsertGetOffVideos(list);
+            log.info("flushGetOffVideos pageNum:{} totalPage:{}", pageNum, totalPage);
+            pageNum++;
+        }
+    }
+
+    public void flushLongArticlesRootSourceId(Integer pageNum) {
+        int pageSize = 1000;
+        if (pageNum == null) {
+            pageNum = 1;
+        }
+        int count = crawlerBaseMapper.countLongArticlesRootSourceId();
+        int totalPage = count / pageSize + 1;
+        while (pageNum <= totalPage) {
+            int offset = (pageNum - 1) * pageSize;
+            List<LongArticlesRootSourceId> list = crawlerBaseMapper.pageLongArticlesRootSourceId(offset, pageSize);
+            longArticleBaseMapper.batchInsertLongArticlesRootSourceId(list);
+            log.info("flushLongArticlesRootSourceId pageNum:{} totalPage:{}", pageNum, totalPage);
+            pageNum++;
+        }
+    }
+
+    public void flushLongArticlesCrawlerVideos(Integer pageNum) {
+        int pageSize = 1000;
+        if (pageNum == null) {
+            pageNum = 1;
+        }
+        int count = crawlerBaseMapper.countArticleMatchVideos();
+        int totalPage = count / pageSize + 1;
+        while (pageNum <= totalPage) {
+            int offset = (pageNum - 1) * pageSize;
+            List<ArticleMatchVideos> list = crawlerBaseMapper.pageArticleMatchVideos(offset, pageSize);
+            List<LongArticlesCrawlerVideos> batchSaveList = new ArrayList<>();
+            for (ArticleMatchVideos video : list) {
+                if (!StringUtils.hasText(video.getVideoPath())) {
+                    continue;
+                }
+                LongArticlesCrawlerVideos saveItem = new LongArticlesCrawlerVideos();
+                saveItem.setContentId(video.getContentId());
+                saveItem.setPlatform(video.getPlatform());
+                saveItem.setVideoTitle(video.getVideoTitle());
+                saveItem.setCrawlerTime(video.getUpdateTime());
+                saveItem.setVideoOssPath(video.getVideoPath());
+                saveItem.setCoverOssPath(video.getCoverPath());
+                saveItem.setUserId(video.getUid());
+                saveItem.setTraceId(video.getTraceId());
+                saveItem.setDownloadStatus(2);
+                batchSaveList.add(saveItem);
+            }
+            if (!CollectionUtils.isEmpty(batchSaveList)) {
+                longArticleBaseMapper.batchInsertLongArticlesCrawlerVideos(batchSaveList);
+            }
+            log.info("flushLongArticlesCrawlerVideos pageNum:{} totalPage:{}", pageNum, totalPage);
+            pageNum++;
+        }
+    }
+
+    public void flushLongArticlesVideos(Integer pageNum) {
+        int pageSize = 1000;
+        if (pageNum == null) {
+            pageNum = 1;
+        }
+        int count = crawlerBaseMapper.countLongArticlesVideos();
+        int totalPage = count / pageSize + 1;
+        while (pageNum <= totalPage) {
+            int offset = (pageNum - 1) * pageSize;
+            List<LongArticlesVideo> list = crawlerBaseMapper.pageLongArticlesVideos(offset, pageSize);
+            List<LongArticlesText> batchSaveLongArticlesTextList = new ArrayList<>();
+            List<LongArticlesMatchVideos> batchSaveLongArticlesMatchVideosList = new ArrayList<>();
+            Set<String> existsIdSet = new HashSet<>();
+            for (LongArticlesVideo video : list) {
+                if (video.getContentId().endsWith("lehuo")) {
+                    continue;
+                }
+                if (!existsIdSet.contains(video.getContentId())) {
+                    LongArticlesText longArticlesText = new LongArticlesText();
+                    longArticlesText.setContentId(video.getContentId());
+                    longArticlesText.setArticleTitle(video.getArticleTitle());
+                    longArticlesText.setArticleText(video.getArticleText());
+                    if (StringUtils.hasText(video.getArticleText())) {
+                        longArticlesText.setKimiTitle(video.getKimiTitle().replace("\"", ""));
+                    }
+                    longArticlesText.setKimiSummary(video.getKimiSummary());
+                    longArticlesText.setKimiKeys(video.getKimiKeys());
+                    longArticlesText.setKimiStatus(1);
+                    batchSaveLongArticlesTextList.add(longArticlesText);
+                    existsIdSet.add(video.getContentId());
+                }
+                if (Objects.isNull(video.getRequestTimeStamp())) {
+                    continue;
+                }
+                LongArticlesMatchVideos longArticlesMatchVideos = new LongArticlesMatchVideos();
+                longArticlesMatchVideos.setContentId(video.getContentId());
+                longArticlesMatchVideos.setTraceId(video.getTraceId());
+                longArticlesMatchVideos.setGhId(video.getGhId());
+                longArticlesMatchVideos.setAccountName(video.getAccountName());
+                longArticlesMatchVideos.setContentStatus(video.getContentStatus());
+                longArticlesMatchVideos.setSuccessStatus(video.getSuccess());
+                longArticlesMatchVideos.setRequestTimestamp(video.getRequestTimeStamp());
+                longArticlesMatchVideos.setUpdateTime(video.getUpdateTime());
+                longArticlesMatchVideos.setProcessTimes(video.getProcessTimes());
+                longArticlesMatchVideos.setResponse(getLongArticleVideoResponse(video));
+                batchSaveLongArticlesMatchVideosList.add(longArticlesMatchVideos);
+            }
+            if (CollectionUtil.isNotEmpty(batchSaveLongArticlesTextList)) {
+                List<String> contentIds = batchSaveLongArticlesTextList.stream()
+                        .map(LongArticlesText::getContentId).distinct().collect(Collectors.toList());
+                List<String> existsContentIds = longArticleBaseMapper.getLongArticlesTextByContentIds(contentIds);
+                if (CollectionUtil.isNotEmpty(existsContentIds)) {
+                    batchSaveLongArticlesTextList = batchSaveLongArticlesTextList.stream()
+                            .filter(o -> !existsContentIds.contains(o.getContentId())).collect(Collectors.toList());
+                }
+                if (CollectionUtil.isNotEmpty(batchSaveLongArticlesTextList)) {
+                    longArticleBaseMapper.batchInsertLongArticlesText(batchSaveLongArticlesTextList);
+                }
+            }
+            if (CollectionUtil.isNotEmpty(batchSaveLongArticlesMatchVideosList)) {
+                longArticleBaseMapper.batchInsertLongArticlesMatchVideos(batchSaveLongArticlesMatchVideosList);
+            }
+            log.info("flushLongArticlesVideos pageNum:{} totalPage:{}", pageNum, totalPage);
+            pageNum++;
+        }
+    }
+
+    private String getLongArticleVideoResponse(LongArticlesVideo video) {
+        JSONArray jsonArray = new JSONArray();
+        if (StringUtils.hasText(video.getResult1())) {
+            if (StringUtils.hasText(video.getKimiTitle()) && video.getKimiTitle().contains("\"")) {
+                video.setResult1(video.getResult1().replace(video.getKimiTitle(), video.getKimiTitle().replace("\"", "")));
+            }
+            jsonArray.add(resultToResponse(video.getResult1()));
+        }
+        if (StringUtils.hasText(video.getResult2())) {
+            if (StringUtils.hasText(video.getKimiTitle()) && video.getKimiTitle().contains("\"")) {
+                video.setResult2(video.getResult2().replace(video.getKimiTitle(), video.getKimiTitle().replace("\"", "")));
+            }
+            jsonArray.add(resultToResponse(video.getResult2()));
+        }
+        if (StringUtils.hasText(video.getResult3())) {
+            if (StringUtils.hasText(video.getKimiTitle()) && video.getKimiTitle().contains("\"")) {
+                video.setResult3(video.getResult3().replace(video.getKimiTitle(), video.getKimiTitle().replace("\"", "")));
+            }
+            jsonArray.add(resultToResponse(video.getResult3()));
+        }
+        return JSONObject.toJSONString(jsonArray);
+    }
+
+    private JSONObject resultToResponse(String result) {
+        JSONObject jsonObject = new JSONObject();
+        JSONObject fromJSON = JSONObject.parseObject(result);
+        jsonObject.put("kimiTitle", fromJSON.getString("productionName"));
+        jsonObject.put("videoCover", fromJSON.getString("productionCover"));
+        jsonObject.put("videoPath", fromJSON.getString("videoUrl"));
+        jsonObject.put("source", fromJSON.getString("source"));
+        String productionPath = fromJSON.getString("productionPath");
+        String uid = getParamFromPath(productionPath, "su");
+        String videoId = getParamFromPath(productionPath, "id");
+        jsonObject.put("uid", uid);
+        if (StringUtils.hasText(videoId)) {
+            jsonObject.put("videoId", Long.valueOf(videoId));
+        }
+        return jsonObject;
+    }
+
+    private String getParamFromPath(String productionPath, String param) {
+        String decode = URLDecoder.decode(productionPath);
+        String[] sss = decode.split("\\?");
+        for (String ss : sss) {
+            String[] split = ss.split("&");
+            for (String s : split) {
+                if (s.startsWith(param)) {
+                    String[] uid = s.split("=");
+                    return uid[1];
+                }
+            }
+        }
+        return null;
+    }
+}

+ 43 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/DataFlushController.java

@@ -0,0 +1,43 @@
+package com.tzld.longarticle.recommend.server.web;
+
+import com.tzld.longarticle.recommend.server.service.DataFlushService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/data")
+@Slf4j
+public class DataFlushController {
+
+    @Autowired
+    private DataFlushService service;
+
+    @GetMapping("/flush/get_off_videos")
+    public void flushGetOffVideos(Integer pageNum) {
+        new Thread(() -> {
+            service.flushGetOffVideos(pageNum);
+        }).start();
+    }
+    @GetMapping("/flush/long_articles_root_source_id")
+    public void flushLongArticlesRootSourceId(Integer pageNum) {
+        new Thread(() -> {
+            service.flushLongArticlesRootSourceId(pageNum);
+        }).start();
+    }
+    @GetMapping("/flush/long_articles_crawler_videos")
+    public void flushLongArticlesCrawlerVideos(Integer pageNum) {
+        new Thread(() -> {
+            service.flushLongArticlesCrawlerVideos(pageNum);
+        }).start();
+    }
+    @GetMapping("/flush/long_articles_video")
+    public void flushLongArticlesVideos(Integer pageNum) {
+        new Thread(() -> {
+            service.flushLongArticlesVideos(pageNum);
+        }).start();
+    }
+
+}

+ 26 - 0
long-article-recommend-service/src/main/resources/mapper/crawler/CrawlerBaseMapper.xml

@@ -9,5 +9,31 @@
             (#{item.dateStr}, #{item.ghId}, #{item.accountName}, #{item.relGhId}, #{item.relAccountName}, #{item.status}, #{item.correlation})
         </foreach>
     </insert>
+    <select id="countGetOffVideos" resultType="java.lang.Integer">
+        select count(1) from get_off_videos
+    </select>
+    <select id="pageGetOffVideos" resultType="com.tzld.longarticle.recommend.server.model.dto.GetOffVideos">
+        select * from get_off_videos order by video_id limit #{offset}, #{pageSize}
+    </select>
+    <select id="countLongArticlesRootSourceId" resultType="java.lang.Integer">
+        select count(1) from long_articles_root_source_id
+    </select>
+    <select id="pageLongArticlesRootSourceId" resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesRootSourceId">
+        select * from long_articles_root_source_id order by rootSourceId limit #{offset}, #{pageSize}
+    </select>
+    <select id="countArticleMatchVideos" resultType="java.lang.Integer">
+        select count(1) from article_match_videos where DATE(update_time) &gt;= '2024-09-20'
+    </select>
+    <select id="pageArticleMatchVideos"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.ArticleMatchVideos">
+        select * from article_match_videos where DATE(update_time) &gt;= '2024-09-20' and success = 1 and content_status = 2 order by video_id limit #{offset}, #{pageSize}
+    </select>
+    <select id="countLongArticlesVideos" resultType="java.lang.Integer">
+        select count(1) from long_articles_video where DATE(update_time) &lt; '2024-09-20'
+    </select>
+    <select id="pageLongArticlesVideos"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.LongArticlesVideo">
+        select * from long_articles_video where DATE(update_time) &lt; '2024-09-20' and success = 1 and content_status = 2 order by id limit #{offset}, #{pageSize}
+    </select>
 
 </mapper>

+ 60 - 0
long-article-recommend-service/src/main/resources/mapper/longArticle/LongArticleBaseMapper.xml

@@ -5,6 +5,9 @@
     <delete id="deleteByDateStrGreaterThanEqual">
         delete from datastat_sort_strategy where date_str >= #{dateStr}
     </delete>
+    <select id="countGetOffVideos" resultType="java.lang.Long">
+        select count(1) from get_off_videos limit #{offset}, #{pageSize}
+    </select>
 
     <insert id="batchInsertDatastatSortStrategy">
         INSERT INTO datastat_sort_strategy
@@ -35,4 +38,61 @@
         </foreach>
     </insert>
 
+    <insert id="batchInsertGetOffVideos">
+        INSERT INTO get_off_videos_copy1 (video_id, publish_time, video_status, trace_id, get_off_time, check_status)
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+            (#{item.videoId}, #{item.publishTime}, #{item.videoStatus}, #{item.traceId}, #{item.getOffTime}, #{item.checkStatus})
+        </foreach>
+    </insert>
+    <insert id="batchInsertLongArticlesRootSourceId" parameterType="list">
+        INSERT INTO long_articles_root_source_id_copy1 (root_source_id, account_name, gh_id, article_title, request_time,
+        trace_id, push_type, video_id)
+        VALUES
+        <foreach collection="list" item="item" index="index" separator=",">
+            (#{item.rootSourceId}, #{item.accountName}, #{item.ghId}, #{item.articleTitle}, #{item.requestTime},
+             #{item.traceId}, #{item.pushType}, #{item.videoId})
+        </foreach>
+    </insert>
+    <insert id="batchInsertLongArticlesCrawlerVideos" parameterType="list">
+        INSERT INTO long_articles_crawler_videos_copy1 (content_id, out_video_id, platform, video_title, play_count,
+                                                  like_count, share_count, publish_time, crawler_time, duration,
+                                                  video_url, cover_url, download_status, video_oss_path, cover_oss_path,
+                                                  user_id, trace_id)
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+            (#{item.contentId}, #{item.outVideoId}, #{item.platform}, #{item.videoTitle}, #{item.playCount},
+             #{item.likeCount}, #{item.shareCount}, #{item.publishTime}, #{item.crawlerTime}, #{item.duration},
+             #{item.videoUrl}, #{item.coverUrl}, #{item.downloadStatus}, #{item.videoOssPath}, #{item.coverOssPath},
+             #{item.userId}, #{item.traceId})
+        </foreach>
+    </insert>
+    <insert id="batchInsertLongArticlesText" parameterType="list">
+        INSERT INTO long_articles_text_copy1 (content_id, article_title, article_text, kimi_title, kimi_summary,
+                                              kimi_keys, kimi_status)
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+            (#{item.contentId}, #{item.articleTitle}, #{item.articleText}, #{item.kimiTitle}, #{item.kimiSummary},
+             #{item.kimiKeys}, #{item.kimiStatus})
+        </foreach>
+    </insert>
+
+    <select id="getLongArticlesTextByContentIds" resultType="java.lang.String">
+        select content_id from long_articles_text_copy1 where content_id in
+        <foreach collection="contentIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+    <insert id="batchInsertLongArticlesMatchVideos" parameterType="list">
+        INSERT INTO long_articles_match_videos_copy1 (trace_id, content_id, flow_pool_level, gh_id, account_name,
+                                                      content_status, success_status, request_timestamp, response,
+                                                      process_times)
+        VALUES
+        <foreach collection="list" item="item" separator=",">
+            (#{item.traceId}, #{item.contentId}, #{item.flowPoolLevel}, #{item.ghId}, #{item.accountName},
+             #{item.contentStatus}, #{item.successStatus}, #{item.requestTimestamp}, #{item.response},
+             #{item.processTimes})
+        </foreach>
+    </insert>
+
 </mapper>