wangyunpeng 2 週間 前
コミット
d3438e4b51

+ 11 - 11
core/src/main/java/com/tzld/supply/dao/mapper/supply/spider/ProduceVideoMaterialMapper.java

@@ -10,7 +10,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     long countByExample(ProduceVideoMaterialExample example);
 
@@ -18,7 +18,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int deleteByExample(ProduceVideoMaterialExample example);
 
@@ -26,7 +26,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int deleteByPrimaryKey(String id);
 
@@ -34,7 +34,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int insert(ProduceVideoMaterial record);
 
@@ -42,7 +42,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int insertSelective(ProduceVideoMaterial record);
 
@@ -50,7 +50,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     List<ProduceVideoMaterial> selectByExample(ProduceVideoMaterialExample example);
 
@@ -58,7 +58,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     ProduceVideoMaterial selectByPrimaryKey(String id);
 
@@ -66,7 +66,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int updateByExampleSelective(@Param("record") ProduceVideoMaterial record, @Param("example") ProduceVideoMaterialExample example);
 
@@ -74,7 +74,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int updateByExample(@Param("record") ProduceVideoMaterial record, @Param("example") ProduceVideoMaterialExample example);
 
@@ -82,7 +82,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int updateByPrimaryKeySelective(ProduceVideoMaterial record);
 
@@ -90,7 +90,7 @@ public interface ProduceVideoMaterialMapper {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     int updateByPrimaryKey(ProduceVideoMaterial record);
 }

+ 47 - 13
core/src/main/java/com/tzld/supply/job/VideoGenerateJob.java

@@ -32,10 +32,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Component;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-import java.util.stream.Collectors;
+import java.util.*;
 
 @Slf4j
 @Component
@@ -171,9 +168,9 @@ public class VideoGenerateJob {
                 // 现仅一种效果,后更改为多种效果随机
                 String outputVideoName = String.format("%s_%d.mp4", produceVideo.getContentId(), System.currentTimeMillis());
                 String command = String.format("ffmpeg -loop 1 -i %s -t 3 -r 25 -filter_complex " +
-                        "\"[0:v]scale=1080:1920:force_original_aspect_ratio=increase,crop=1080:1920,gblur=sigma=5[bg];" +
-                        "[0:v]scale=1080:1920:force_original_aspect_ratio=decrease,pad=1080:1920:(ow-iw)/2:(oh-ih)/2:color=black@0[fg];" +
-                        "[fg]zoompan=z='min(1.00+0.000266*on,1.02)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s=1080x1920[fg_anim];" +
+                        "\"[0:v]scale=720:1280:force_original_aspect_ratio=increase,crop=720:1280,gblur=sigma=5[bg];" +
+                        "[0:v]scale=720:1280:force_original_aspect_ratio=decrease,pad=720:1280:(ow-iw)/2:(oh-ih)/2:color=black@0[fg];" +
+                        "[fg]zoompan=z='min(1.00+0.000266*on,1.02)':d=1:x='iw/2-(iw/zoom/2)':y='ih/2-(ih/zoom/2)':s=720x1280[fg_anim];" +
                         "[bg][fg_anim]overlay=0:0:format=auto\" " +
                         "-c:v libx264 -pix_fmt yuv420p -movflags +faststart \"%s\"",
                         CdnUtil.getOssHttpUrl(image.getOssKey()), outputVideoName);
@@ -189,7 +186,7 @@ public class VideoGenerateJob {
                 // 获取视频信息
                 MediaInfo mediaInfo = getMediaInfo(imageToVideoOssUrl);
                 // 保存视频素材
-                saveVideoMaterial(produceVideo, imageToVideoOssUrl, mediaInfo);
+                saveVideoMaterial(produceVideo, image.getId(), imageToVideoOssUrl, mediaInfo, 1);
             }
         }
     }
@@ -199,11 +196,13 @@ public class VideoGenerateJob {
         return JSONObject.parseObject(mediaInfo, MediaInfo.class);
     }
 
-    private void saveVideoMaterial(ProduceVideo produceVideo, String imageToVideoOssUrl, MediaInfo videoInfo) {
+    private void saveVideoMaterial(ProduceVideo produceVideo, Long mediaId, String imageToVideoOssUrl, MediaInfo videoInfo, Integer sourceType) {
         Long now = System.currentTimeMillis();
         ProduceVideoMaterial material = new ProduceVideoMaterial();
         material.setId(DistributedIdGenerator.generate());
         material.setProduceVideoId(produceVideo.getId());
+        material.setSourceMediaId(mediaId);
+        material.setSourceType(sourceType);
         material.setUrl(imageToVideoOssUrl);
         material.setDuration(videoInfo.getDuration());
         material.setCreateTime(now);
@@ -240,7 +239,7 @@ public class VideoGenerateJob {
                     // 获取视频信息
                     MediaInfo mediaInfo = getMediaInfo(videoCutOssUrl);
                     // 保存视频素材
-                    saveVideoMaterial(produceVideo, videoCutOssUrl, mediaInfo);
+                    saveVideoMaterial(produceVideo, video.getId(), videoCutOssUrl, mediaInfo, 2);
                 }
             }
         }
@@ -309,16 +308,26 @@ public class VideoGenerateJob {
                 continue;
             }
             // short video to long video
-             // 视频素材拼接长视频
+            // 视频素材拼接长视频 随机排序
+            Collections.shuffle(materialList);
+            // 时长大于音频停止 拼接视频
+            List<String> videoUrls = selectMaterial(materialList, audio);
             VideoUrlsParam concatParam = VideoUrlsParam.builder()
-                    .videoUrls(materialList.stream().map(ProduceVideoMaterial::getUrl).collect(Collectors.toList()))
+                    .videoUrls(videoUrls)
                     .pretreatmentSwitch(1)
                     .build();
             String concatVideoUrl = ffmpegApiService.videoConcat(concatParam);
+            // 按音频时长剪切
+            VideoTimeCutParam timeCutParam = VideoTimeCutParam.builder()
+                    .videoUrl(concatVideoUrl)
+                    .startTime("00:00:00")
+                    .endTime(formatSecondsToTime(audio.getDuration() / 1000))
+                    .build();
+            String cutVideoUrl = ffmpegApiService.timeCutVideo(timeCutParam);
             // add audio
             String videoName = String.format("%s_%d.mp4", produceVideo.getId(), System.currentTimeMillis());
             String command = String.format("ffmpeg -i %s -i %s -c:v copy -map 0:v:0 -map 1:a:0 -shortest -y %s",
-                    concatVideoUrl, audio.getUrl(), videoName);
+                    cutVideoUrl, audio.getUrl(), videoName);
             CommandParam commandParam = CommandParam.builder()
                     .ffmpegCommand(command)
                     .outputFile(videoName)
@@ -335,6 +344,31 @@ public class VideoGenerateJob {
         return ReturnT.SUCCESS;
     }
 
+    private List<String> selectMaterial(List<ProduceVideoMaterial> materialList, ProduceVideoAudio audio) {
+        Integer duration = audio.getDuration();
+        List<String> videoUrls = new ArrayList<>();
+        // 开头素材使用图片生成视频 固定生成视频比例
+        Iterator<ProduceVideoMaterial> iterator = materialList.iterator();
+        while (iterator.hasNext()) {
+            ProduceVideoMaterial material = iterator.next();
+            if (material.getSourceType() == 1) {
+                videoUrls.add(material.getUrl());
+                duration -= material.getDuration();
+                iterator.remove();
+                break;
+            }
+        }
+        while (iterator.hasNext()) {
+            ProduceVideoMaterial material = iterator.next();
+            if (duration < 0) {
+                break;
+            }
+            videoUrls.add(material.getUrl());
+            duration -= material.getDuration();
+        }
+        return videoUrls;
+    }
+
     private ProduceVideoAudio getProduceAudio(ProduceVideo produceVideo) {
         ProduceVideoAudioExample example = new ProduceVideoAudioExample();
         example.createCriteria().andProduceVideoIdEqualTo(produceVideo.getId()).andStatusEqualTo(1);

+ 94 - 22
core/src/main/java/com/tzld/supply/model/po/supply/spider/ProduceVideoMaterial.java

@@ -13,7 +13,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private String id;
 
@@ -24,10 +24,32 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.produce_video_id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private String produceVideoId;
 
+    /**
+     * Database Column Remarks:
+     *   来源媒体资源id
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column produce_video_material.source_media_id
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    private Long sourceMediaId;
+
+    /**
+     * Database Column Remarks:
+     *   来源 1-图片 2-视频剪切
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column produce_video_material.source_type
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    private Integer sourceType;
+
     /**
      * Database Column Remarks:
      *   视频url
@@ -35,7 +57,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.url
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private String url;
 
@@ -46,7 +68,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.duration
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private Integer duration;
 
@@ -57,7 +79,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.status
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private Integer status;
 
@@ -66,7 +88,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.create_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private Long createTime;
 
@@ -75,7 +97,7 @@ public class ProduceVideoMaterial {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database column produce_video_material.update_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     private Long updateTime;
 
@@ -85,7 +107,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public String getId() {
         return id;
@@ -97,7 +119,7 @@ public class ProduceVideoMaterial {
      *
      * @param id the value for produce_video_material.id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setId(String id) {
         this.id = id;
@@ -109,7 +131,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.produce_video_id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public String getProduceVideoId() {
         return produceVideoId;
@@ -121,19 +143,67 @@ public class ProduceVideoMaterial {
      *
      * @param produceVideoId the value for produce_video_material.produce_video_id
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setProduceVideoId(String produceVideoId) {
         this.produceVideoId = produceVideoId;
     }
 
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column produce_video_material.source_media_id
+     *
+     * @return the value of produce_video_material.source_media_id
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    public Long getSourceMediaId() {
+        return sourceMediaId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column produce_video_material.source_media_id
+     *
+     * @param sourceMediaId the value for produce_video_material.source_media_id
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    public void setSourceMediaId(Long sourceMediaId) {
+        this.sourceMediaId = sourceMediaId;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column produce_video_material.source_type
+     *
+     * @return the value of produce_video_material.source_type
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    public Integer getSourceType() {
+        return sourceType;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column produce_video_material.source_type
+     *
+     * @param sourceType the value for produce_video_material.source_type
+     *
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
+     */
+    public void setSourceType(Integer sourceType) {
+        this.sourceType = sourceType;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column produce_video_material.url
      *
      * @return the value of produce_video_material.url
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public String getUrl() {
         return url;
@@ -145,7 +215,7 @@ public class ProduceVideoMaterial {
      *
      * @param url the value for produce_video_material.url
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setUrl(String url) {
         this.url = url;
@@ -157,7 +227,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.duration
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Integer getDuration() {
         return duration;
@@ -169,7 +239,7 @@ public class ProduceVideoMaterial {
      *
      * @param duration the value for produce_video_material.duration
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setDuration(Integer duration) {
         this.duration = duration;
@@ -181,7 +251,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.status
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Integer getStatus() {
         return status;
@@ -193,7 +263,7 @@ public class ProduceVideoMaterial {
      *
      * @param status the value for produce_video_material.status
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setStatus(Integer status) {
         this.status = status;
@@ -205,7 +275,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.create_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Long getCreateTime() {
         return createTime;
@@ -217,7 +287,7 @@ public class ProduceVideoMaterial {
      *
      * @param createTime the value for produce_video_material.create_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setCreateTime(Long createTime) {
         this.createTime = createTime;
@@ -229,7 +299,7 @@ public class ProduceVideoMaterial {
      *
      * @return the value of produce_video_material.update_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Long getUpdateTime() {
         return updateTime;
@@ -241,7 +311,7 @@ public class ProduceVideoMaterial {
      *
      * @param updateTime the value for produce_video_material.update_time
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setUpdateTime(Long updateTime) {
         this.updateTime = updateTime;
@@ -251,7 +321,7 @@ public class ProduceVideoMaterial {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     @Override
     public String toString() {
@@ -261,6 +331,8 @@ public class ProduceVideoMaterial {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", produceVideoId=").append(produceVideoId);
+        sb.append(", sourceMediaId=").append(sourceMediaId);
+        sb.append(", sourceType=").append(sourceType);
         sb.append(", url=").append(url);
         sb.append(", duration=").append(duration);
         sb.append(", status=").append(status);

+ 137 - 17
core/src/main/java/com/tzld/supply/model/po/supply/spider/ProduceVideoMaterialExample.java

@@ -8,7 +8,7 @@ public class ProduceVideoMaterialExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     protected String orderByClause;
 
@@ -16,7 +16,7 @@ public class ProduceVideoMaterialExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     protected boolean distinct;
 
@@ -24,7 +24,7 @@ public class ProduceVideoMaterialExample {
      * This field was generated by MyBatis Generator.
      * This field corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     protected List<Criteria> oredCriteria;
 
@@ -32,7 +32,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public ProduceVideoMaterialExample() {
         oredCriteria = new ArrayList<Criteria>();
@@ -42,7 +42,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setOrderByClause(String orderByClause) {
         this.orderByClause = orderByClause;
@@ -52,7 +52,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public String getOrderByClause() {
         return orderByClause;
@@ -62,7 +62,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void setDistinct(boolean distinct) {
         this.distinct = distinct;
@@ -72,7 +72,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public boolean isDistinct() {
         return distinct;
@@ -82,7 +82,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public List<Criteria> getOredCriteria() {
         return oredCriteria;
@@ -92,7 +92,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void or(Criteria criteria) {
         oredCriteria.add(criteria);
@@ -102,7 +102,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Criteria or() {
         Criteria criteria = createCriteriaInternal();
@@ -114,7 +114,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public Criteria createCriteria() {
         Criteria criteria = createCriteriaInternal();
@@ -128,7 +128,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     protected Criteria createCriteriaInternal() {
         Criteria criteria = new Criteria();
@@ -139,7 +139,7 @@ public class ProduceVideoMaterialExample {
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public void clear() {
         oredCriteria.clear();
@@ -151,7 +151,7 @@ public class ProduceVideoMaterialExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
@@ -334,6 +334,126 @@ public class ProduceVideoMaterialExample {
             return (Criteria) this;
         }
 
+        public Criteria andSourceMediaIdIsNull() {
+            addCriterion("source_media_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdIsNotNull() {
+            addCriterion("source_media_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdEqualTo(Long value) {
+            addCriterion("source_media_id =", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdNotEqualTo(Long value) {
+            addCriterion("source_media_id <>", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdGreaterThan(Long value) {
+            addCriterion("source_media_id >", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("source_media_id >=", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdLessThan(Long value) {
+            addCriterion("source_media_id <", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdLessThanOrEqualTo(Long value) {
+            addCriterion("source_media_id <=", value, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdIn(List<Long> values) {
+            addCriterion("source_media_id in", values, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdNotIn(List<Long> values) {
+            addCriterion("source_media_id not in", values, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdBetween(Long value1, Long value2) {
+            addCriterion("source_media_id between", value1, value2, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceMediaIdNotBetween(Long value1, Long value2) {
+            addCriterion("source_media_id not between", value1, value2, "sourceMediaId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeIsNull() {
+            addCriterion("source_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeIsNotNull() {
+            addCriterion("source_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeEqualTo(Integer value) {
+            addCriterion("source_type =", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeNotEqualTo(Integer value) {
+            addCriterion("source_type <>", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeGreaterThan(Integer value) {
+            addCriterion("source_type >", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("source_type >=", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeLessThan(Integer value) {
+            addCriterion("source_type <", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("source_type <=", value, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeIn(List<Integer> values) {
+            addCriterion("source_type in", values, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeNotIn(List<Integer> values) {
+            addCriterion("source_type not in", values, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeBetween(Integer value1, Integer value2) {
+            addCriterion("source_type between", value1, value2, "sourceType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("source_type not between", value1, value2, "sourceType");
+            return (Criteria) this;
+        }
+
         public Criteria andUrlIsNull() {
             addCriterion("url is null");
             return (Criteria) this;
@@ -649,7 +769,7 @@ public class ProduceVideoMaterialExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table produce_video_material
      *
-     * @mbg.generated do_not_delete_during_merge Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated do_not_delete_during_merge Tue Oct 28 10:44:35 CST 2025
      */
     public static class Criteria extends GeneratedCriteria {
 
@@ -662,7 +782,7 @@ public class ProduceVideoMaterialExample {
      * This class was generated by MyBatis Generator.
      * This class corresponds to the database table produce_video_material
      *
-     * @mbg.generated Mon Oct 27 14:49:52 CST 2025
+     * @mbg.generated Tue Oct 28 10:44:35 CST 2025
      */
     public static class Criterion {
         private String condition;

+ 55 - 22
core/src/main/resources/mapper/supply/spider/ProduceVideoMaterialMapper.xml

@@ -5,10 +5,12 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     <id column="id" jdbcType="VARCHAR" property="id" />
     <result column="produce_video_id" jdbcType="VARCHAR" property="produceVideoId" />
+    <result column="source_media_id" jdbcType="BIGINT" property="sourceMediaId" />
+    <result column="source_type" jdbcType="INTEGER" property="sourceType" />
     <result column="url" jdbcType="VARCHAR" property="url" />
     <result column="duration" jdbcType="INTEGER" property="duration" />
     <result column="status" jdbcType="INTEGER" property="status" />
@@ -19,7 +21,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     <where>
       <foreach collection="oredCriteria" item="criteria" separator="or">
@@ -53,7 +55,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     <where>
       <foreach collection="example.oredCriteria" item="criteria" separator="or">
@@ -87,15 +89,16 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
-    id, produce_video_id, url, duration, `status`, create_time, update_time
+    id, produce_video_id, source_media_id, source_type, url, duration, `status`, create_time, 
+    update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.supply.model.po.supply.spider.ProduceVideoMaterialExample" resultMap="BaseResultMap">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     select
     <if test="distinct">
@@ -114,7 +117,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     select 
     <include refid="Base_Column_List" />
@@ -125,7 +128,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     delete from produce_video_material
     where id = #{id,jdbcType=VARCHAR}
@@ -134,7 +137,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     delete from produce_video_material
     <if test="_parameter != null">
@@ -145,20 +148,22 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
-    insert into produce_video_material (id, produce_video_id, url, 
-      duration, `status`, create_time, 
-      update_time)
-    values (#{id,jdbcType=VARCHAR}, #{produceVideoId,jdbcType=VARCHAR}, #{url,jdbcType=VARCHAR}, 
-      #{duration,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, 
-      #{updateTime,jdbcType=BIGINT})
+    insert into produce_video_material (id, produce_video_id, source_media_id, 
+      source_type, url, duration, 
+      `status`, create_time, update_time
+      )
+    values (#{id,jdbcType=VARCHAR}, #{produceVideoId,jdbcType=VARCHAR}, #{sourceMediaId,jdbcType=BIGINT}, 
+      #{sourceType,jdbcType=INTEGER}, #{url,jdbcType=VARCHAR}, #{duration,jdbcType=INTEGER}, 
+      #{status,jdbcType=INTEGER}, #{createTime,jdbcType=BIGINT}, #{updateTime,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.supply.model.po.supply.spider.ProduceVideoMaterial">
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     insert into produce_video_material
     <trim prefix="(" suffix=")" suffixOverrides=",">
@@ -168,6 +173,12 @@
       <if test="produceVideoId != null">
         produce_video_id,
       </if>
+      <if test="sourceMediaId != null">
+        source_media_id,
+      </if>
+      <if test="sourceType != null">
+        source_type,
+      </if>
       <if test="url != null">
         url,
       </if>
@@ -191,6 +202,12 @@
       <if test="produceVideoId != null">
         #{produceVideoId,jdbcType=VARCHAR},
       </if>
+      <if test="sourceMediaId != null">
+        #{sourceMediaId,jdbcType=BIGINT},
+      </if>
+      <if test="sourceType != null">
+        #{sourceType,jdbcType=INTEGER},
+      </if>
       <if test="url != null">
         #{url,jdbcType=VARCHAR},
       </if>
@@ -212,7 +229,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     select count(*) from produce_video_material
     <if test="_parameter != null">
@@ -223,7 +240,7 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     update produce_video_material
     <set>
@@ -233,6 +250,12 @@
       <if test="record.produceVideoId != null">
         produce_video_id = #{record.produceVideoId,jdbcType=VARCHAR},
       </if>
+      <if test="record.sourceMediaId != null">
+        source_media_id = #{record.sourceMediaId,jdbcType=BIGINT},
+      </if>
+      <if test="record.sourceType != null">
+        source_type = #{record.sourceType,jdbcType=INTEGER},
+      </if>
       <if test="record.url != null">
         url = #{record.url,jdbcType=VARCHAR},
       </if>
@@ -257,11 +280,13 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     update produce_video_material
     set id = #{record.id,jdbcType=VARCHAR},
       produce_video_id = #{record.produceVideoId,jdbcType=VARCHAR},
+      source_media_id = #{record.sourceMediaId,jdbcType=BIGINT},
+      source_type = #{record.sourceType,jdbcType=INTEGER},
       url = #{record.url,jdbcType=VARCHAR},
       duration = #{record.duration,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
@@ -275,13 +300,19 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     update produce_video_material
     <set>
       <if test="produceVideoId != null">
         produce_video_id = #{produceVideoId,jdbcType=VARCHAR},
       </if>
+      <if test="sourceMediaId != null">
+        source_media_id = #{sourceMediaId,jdbcType=BIGINT},
+      </if>
+      <if test="sourceType != null">
+        source_type = #{sourceType,jdbcType=INTEGER},
+      </if>
       <if test="url != null">
         url = #{url,jdbcType=VARCHAR},
       </if>
@@ -304,10 +335,12 @@
     <!--
       WARNING - @mbg.generated
       This element is automatically generated by MyBatis Generator, do not modify.
-      This element was generated on Mon Oct 27 14:49:52 CST 2025.
+      This element was generated on Tue Oct 28 10:44:35 CST 2025.
     -->
     update produce_video_material
     set produce_video_id = #{produceVideoId,jdbcType=VARCHAR},
+      source_media_id = #{sourceMediaId,jdbcType=BIGINT},
+      source_type = #{sourceType,jdbcType=INTEGER},
       url = #{url,jdbcType=VARCHAR},
       duration = #{duration,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},