Pārlūkot izejas kodu

内容池交互 标签,猜你喜欢

wangyunpeng 1 nedēļu atpakaļ
vecāks
revīzija
0f6cd0b498
38 mainītis faili ar 3153 papildinājumiem un 141 dzēšanām
  1. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/DeletedStatusEnum.java
  2. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PlanStatusEnum.java
  3. 33 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoRecentNotUsedEnum.java
  4. 29 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoSourceEnum.java
  5. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoStatusEnum.java
  6. 45 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoTagEnum.java
  7. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.java
  8. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoTagMapper.java
  9. 28 1
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  10. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java
  11. 191 62
      api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java
  12. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java
  13. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentListParam.java
  14. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java
  15. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java
  16. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideo.java
  17. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideoExample.java
  18. 79 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRel.java
  19. 581 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRelExample.java
  20. 22 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAgg.java
  21. 130 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAggExample.java
  22. 112 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTag.java
  23. 791 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTagExample.java
  24. 5 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java
  25. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformApiServiceImpl.java
  26. 8 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java
  27. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java
  28. 89 27
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  29. 2 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformSettingServiceImpl.java
  30. 7 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformUploadContentServiceImpl.java
  31. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/util/AliOssFileTool.java
  32. 20 5
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml
  33. 20 3
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml
  34. 231 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.xml
  35. 42 10
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml
  36. 278 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoTagMapper.xml
  37. 92 12
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  38. 3 1
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/DeletedStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum DeletedStatusEnum {
+    NOT_DELETED(0, "未删除"),
+    DELETED(1, "已删除"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    DeletedStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static DeletedStatusEnum from(int val) {
+        for (DeletedStatusEnum statusEnum : DeletedStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PlanStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum PlanStatusEnum {
+    DELETED(0, "已删除"),
+    NORMAL(1, "正常"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    PlanStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static PlanStatusEnum from(int val) {
+        for (PlanStatusEnum statusEnum : PlanStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 33 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoRecentNotUsedEnum.java

@@ -0,0 +1,33 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoRecentNotUsedEnum {
+
+    // 近期未使用 0-历史 1-近30天 2-近14天 3-近7天 4-近3天
+    HISTORY(0, "历史", 0),
+    THIRTY_DAYS(1, "近30天", 30),
+    FOURTEEN_DAYS(2, "近14天", 14),
+    SEVEN_DAYS(3, "近7天", 7),
+    THREE_DAYS(4, "近3天", 3);
+
+    private final Integer val;
+    private final String desc;
+    private final Integer days;
+
+    VideoRecentNotUsedEnum(Integer val, String desc, Integer days) {
+        this.val = val;
+        this.desc = desc;
+        this.days = days;
+    }
+
+    public static VideoRecentNotUsedEnum getByVal(Integer val) {
+        for (VideoRecentNotUsedEnum e : values()) {
+            if (e.getVal().equals(val)) {
+                return e;
+            }
+        }
+        return null;
+    }
+}

+ 29 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoSourceEnum.java

@@ -0,0 +1,29 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoSourceEnum {
+    RANK_HOT(0, "大数据热榜"),
+    ACCOUNT_RECOMMEND(1, "猜你喜欢账号视频"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+
+    VideoSourceEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static VideoSourceEnum from(int val) {
+        for (VideoSourceEnum sourceEnum : VideoSourceEnum.values()) {
+            if (sourceEnum.getVal() == val) {
+                return sourceEnum;
+            }
+        }
+        return other;
+    }
+}

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoStatusEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoStatusEnum {
+    DELETED(0, "已删除"),
+    NORMAL(1, "正常"),
+
+    other(999, "其他");
+
+    private final int val;
+    private final String description;
+
+    VideoStatusEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static VideoStatusEnum from(int val) {
+        for (VideoStatusEnum statusEnum : VideoStatusEnum.values()) {
+            if (statusEnum.getVal() == val) {
+                return statusEnum;
+            }
+        }
+
+        return other;
+    }
+
+
+}

+ 45 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/VideoTagEnum.java

@@ -0,0 +1,45 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum VideoTagEnum {
+    /**
+     * 票圈受欢迎
+     */
+    PLATFORM(1, "票圈受欢迎"),
+    /**
+     * 同类用户喜欢
+     */
+    TYPE(2, "同类用户喜欢"),
+    /**
+     * 你的用户爱看
+     */
+    CHANNEL(3, "你的用户爱看"),
+    /**
+     * 猜TA想看
+     */
+    ACCOUNT(4, "猜TA想看"),
+
+
+    other(999, "其他");
+
+    // 1:票圈受欢迎, 2:同类用户喜欢, 3:你的用户爱看, 4:猜TA想看
+    private final int val;
+    private final String tag;
+
+    VideoTagEnum(int val, String tag) {
+        this.val = val;
+        this.tag = tag;
+    }
+
+    public static VideoTagEnum from(int val) {
+        for (VideoTagEnum tagEnum : VideoTagEnum.values()) {
+            if (tagEnum.getVal() == val) {
+                return tagEnum;
+            }
+        }
+
+        return other;
+    }
+}

+ 30 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContentPlatformVideoAccountRelMapper {
+    long countByExample(ContentPlatformVideoAccountRelExample example);
+
+    int deleteByExample(ContentPlatformVideoAccountRelExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ContentPlatformVideoAccountRel record);
+
+    int insertSelective(ContentPlatformVideoAccountRel record);
+
+    List<ContentPlatformVideoAccountRel> selectByExample(ContentPlatformVideoAccountRelExample example);
+
+    ContentPlatformVideoAccountRel selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") ContentPlatformVideoAccountRel record, @Param("example") ContentPlatformVideoAccountRelExample example);
+
+    int updateByExample(@Param("record") ContentPlatformVideoAccountRel record, @Param("example") ContentPlatformVideoAccountRelExample example);
+
+    int updateByPrimaryKeySelective(ContentPlatformVideoAccountRel record);
+
+    int updateByPrimaryKey(ContentPlatformVideoAccountRel record);
+}

+ 30 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoTagMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform;
+
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface ContentPlatformVideoTagMapper {
+    long countByExample(ContentPlatformVideoTagExample example);
+
+    int deleteByExample(ContentPlatformVideoTagExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(ContentPlatformVideoTag record);
+
+    int insertSelective(ContentPlatformVideoTag record);
+
+    List<ContentPlatformVideoTag> selectByExample(ContentPlatformVideoTagExample example);
+
+    ContentPlatformVideoTag selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") ContentPlatformVideoTag record, @Param("example") ContentPlatformVideoTagExample example);
+
+    int updateByExample(@Param("record") ContentPlatformVideoTag record, @Param("example") ContentPlatformVideoTagExample example);
+
+    int updateByPrimaryKeySelective(ContentPlatformVideoTag record);
+
+    int updateByPrimaryKey(ContentPlatformVideoTag record);
+}

+ 28 - 1
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java

@@ -35,6 +35,17 @@ public interface ContentPlatformPlanMapperExt {
 
     List<String> getVideoCategoryList(@Param("dt") String dt);
 
+    List<ContentPlatformVideo> getApiVideoList(@Param("param") VideoContentListParam param,
+                                            @Param("dt") String dt,
+                                            @Param("datastatDt") String datastatDt,
+                                            @Param("type") String type,
+                                            @Param("channel") String channel,
+                                            @Param("strategy") String strategy,
+                                            @Param("minScore") Double minScore,
+                                            @Param("offset") int offset,
+                                            @Param("pageSize") Integer pageSize,
+                                            @Param("sort") String sort);
+
     List<ContentPlatformVideo> getVideoList(@Param("param") VideoContentListParam param,
                                             @Param("dt") String dt,
                                             @Param("datastatDt") String datastatDt,
@@ -42,6 +53,9 @@ public interface ContentPlatformPlanMapperExt {
                                             @Param("channel") String channel,
                                             @Param("strategy") String strategy,
                                             @Param("minScore") Double minScore,
+                                            @Param("createAccountId") Long createAccountId,
+                                            @Param("excludeVideoTime") Long excludeVideoTime,
+                                            @Param("videoTagFilter") String videoTagFilter,
                                             @Param("offset") int offset,
                                             @Param("pageSize") Integer pageSize,
                                             @Param("sort") String sort);
@@ -100,7 +114,7 @@ public interface ContentPlatformPlanMapperExt {
 
     void deleteContentPlatformVideo(@Param("dt") String dt);
 
-    void deleteContentPlatformVideoAgg(@Param("dt") String dt);
+    void deleteContentPlatformVideoAgg(@Param("dt") String dt, @Param("source") Integer source);
 
     void deleteContentPlatformVideoDatastatAgg(@Param("dt") String aggDt, @Param("strategy") String strategy);
 
@@ -132,4 +146,17 @@ public interface ContentPlatformPlanMapperExt {
                                               @Param("status") Integer status,
                                               @Param("now") Long now);
 
+    void deleteContentPlatformVideoAccountRel(@Param("dt") String aggDt);
+
+    void batchInsertContentPlatformVideoAccountRel(@Param("records") List<ContentPlatformVideoAccountRel> saveAccountRelList);
+
+    List<ContentPlatformVideoTag> getVideoTagList(@Param("dt") String dt,
+                                                  @Param("videoIds") List<Long> videoIds,
+                                                  @Param("accountId") Long accountId,
+                                                  @Param("type") String type,
+                                                  @Param("channel") String channel);
+
+    void deleteContentPlatformVideoTag(@Param("dt") String dt);
+
+    void batchInsertContentPlatformVideoTag(@Param("records") List<ContentPlatformVideoTag> saveList);
 }

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDatastatJob.java

@@ -3,6 +3,7 @@ package com.tzld.piaoquan.api.job.contentplatform;
 import com.alibaba.fastjson.JSONObject;
 import com.aliyun.odps.data.Record;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.BussinessTypeEnum;
 import com.tzld.piaoquan.api.component.AigcApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
@@ -557,13 +558,13 @@ public class ContentPlatformDatastatJob {
 
     private List<ContentPlatformAccount> getAllAccount() {
         ContentPlatformAccountExample example = new ContentPlatformAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return accountMapper.selectByExample(example);
     }
 
     private List<ContentPlatformGzhAccount> getAllGzhAccount() {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(example);
     }
 

+ 191 - 62
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformVideoJob.java

@@ -3,7 +3,7 @@ package com.tzld.piaoquan.api.job.contentplatform;
 import com.aliyun.odps.data.Record;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.collect.Lists;
-import com.tzld.piaoquan.api.common.enums.contentplatform.UploadVideoAuditStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
@@ -91,82 +91,211 @@ public class ContentPlatformVideoJob {
                     saveList.add(item);
                 }
                 // 获取视频封面
-                for (List<ContentPlatformVideo> partition : Lists.partition(saveList, 20)) {
-                    List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
-                    Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
-                    for (ContentPlatformVideo item : partition) {
-                        VideoDetail detail = coverMap.get(item.getVideoId());
-                        if (Objects.nonNull(detail)) {
-                            String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
-                            item.setCover(cover);
-                            if (detail.getAuditStatus() != 5) {
-                                item.setStatus(0);
-                            }
-                        }
-                    }
-                }
+                getVideoCover(saveList);
                 // save
                 if (CollectionUtils.isNotEmpty(saveList)) {
-                    List<ContentPlatformVideo> videoList = getVideoList(dt);
-                    List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
-                    List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
-                    if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
-                        saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
-                    }
-                    if (CollectionUtils.isNotEmpty(videoList)) {
-                        List<Long> tempExistVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
-                        List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
-                        planMapperExt.updateOtherVideoStatus(dt, videoIdList, now);
-                        saveList = saveList.stream().filter(item -> !tempExistVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
-                        if (CollectionUtils.isNotEmpty(saveList)) {
-                            planMapperExt.batchInsertContentPlatformVideo(saveList);
-                        }
-                    } else {
-                        planMapperExt.batchInsertContentPlatformVideo(saveList);
-                    }
+                    saveVideo(dt, saveList, now);
                 }
             }
         }
         // 更新封面
         List<ContentPlatformVideo> nullCoverVideoList = getVideoNullCover();
         if (CollectionUtils.isNotEmpty(nullCoverVideoList)) {
-            for (List<ContentPlatformVideo> partition : Lists.partition(nullCoverVideoList, 20)) {
-                List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
-                Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
-                for (ContentPlatformVideo item : partition) {
-                    VideoDetail detail = coverMap.get(item.getVideoId());
-                    if (Objects.isNull(detail)) {
-                        continue;
-                    }
+            updateVideoCover(nullCoverVideoList);
+        }
+        long videoAggCount = getVideoAggCount(aggDt, VideoSourceEnum.RANK_HOT.getVal());
+        if (videoAggCount > 0) {
+            planMapperExt.deleteContentPlatformVideoAgg(aggDt, VideoSourceEnum.RANK_HOT.getVal());
+        }
+        // 聚合最近14天视频
+        List<ContentPlatformVideoAgg> saveAggList = planMapperExt.getVideoAggList(dtList);
+        if (CollectionUtils.isNotEmpty(saveAggList)) {
+            saveVideoAgg(aggDt, saveAggList);
+        }
+        // 获取猜你喜欢账号视频
+        syncRecommendedForYouVideo(aggDt, saveAggList);
+        // 同步视频标签
+        syncVideoTag(aggDt);
+
+        return ReturnT.SUCCESS;
+    }
+
+    private void getVideoCover(List<ContentPlatformVideo> saveList) {
+        for (List<ContentPlatformVideo> partition : Lists.partition(saveList, 20)) {
+            List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
+            Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+            for (ContentPlatformVideo item : partition) {
+                VideoDetail detail = coverMap.get(item.getVideoId());
+                if (Objects.nonNull(detail)) {
                     String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
-                    if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
-                            && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
-                            && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
-                        cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
-                    }
                     item.setCover(cover);
                     if (detail.getAuditStatus() != 5) {
-                        item.setStatus(0);
+                        item.setStatus(VideoStatusEnum.DELETED.getVal());
                     }
-                    videoMapper.updateByPrimaryKeySelective(item);
                 }
             }
         }
-        long videoAggCount = getVideoAggCount(aggDt);
-        if (videoAggCount > 0) {
-            planMapperExt.deleteContentPlatformVideoAgg(aggDt);
+    }
+
+    private void saveVideo(String dt, List<ContentPlatformVideo> saveList, Long now) {
+        List<ContentPlatformVideo> videoList = getVideoList(dt);
+        List<ContentPlatformIllegalVideo> illegalVideoList = getAllIllegalVideoList();
+        List<Long> illegalVideoIds = illegalVideoList.stream().map(ContentPlatformIllegalVideo::getVideoId).collect(Collectors.toList());
+        if (CollectionUtils.isNotEmpty(illegalVideoIds)) {
+            saveList = saveList.stream().filter(item -> !illegalVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
         }
-        // 聚合最近14天视频
-        List<ContentPlatformVideoAgg> saveAggList = planMapperExt.getVideoAggList(dtList);
-        if (CollectionUtils.isNotEmpty(saveAggList)) {
-            Long now = System.currentTimeMillis();
-            for (ContentPlatformVideoAgg item : saveAggList) {
-                item.setDt(aggDt);
+        if (CollectionUtils.isNotEmpty(videoList)) {
+            List<Long> tempExistVideoIds = videoList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
+            List<Long> videoIdList = saveList.stream().map(ContentPlatformVideo::getVideoId).collect(Collectors.toList());
+            planMapperExt.updateOtherVideoStatus(dt, videoIdList, now);
+            saveList = saveList.stream().filter(item -> !tempExistVideoIds.contains(item.getVideoId())).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        } else {
+            planMapperExt.batchInsertContentPlatformVideo(saveList);
+        }
+    }
+
+    private void updateVideoCover(List<ContentPlatformVideo> nullCoverVideoList) {
+        for (List<ContentPlatformVideo> partition : Lists.partition(nullCoverVideoList, 20)) {
+            List<Long> videoIds = partition.stream().map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
+            Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+            for (ContentPlatformVideo item : partition) {
+                VideoDetail detail = coverMap.get(item.getVideoId());
+                if (Objects.isNull(detail)) {
+                    continue;
+                }
+                String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                if (!cover.startsWith(CdnUtil.VIDEO_CDN_URL_HOST)
+                        && StringUtils.hasText(detail.getVideoCoverSnapshotPath())
+                        && detail.getVideoCoverSnapshotPath().startsWith(CdnUtil.VIDEO_CDN_URL_HOST)) {
+                    cover = detail.getVideoCoverSnapshotPath() + cover.substring(cover.indexOf("?"));
+                }
+                item.setCover(cover);
+                if (detail.getAuditStatus() != 5) {
+                    item.setStatus(VideoStatusEnum.DELETED.getVal());
+                }
+                videoMapper.updateByPrimaryKeySelective(item);
+            }
+        }
+    }
+
+    private void saveVideoAgg(String aggDt, List<ContentPlatformVideoAgg> saveAggList) {
+        Long now = System.currentTimeMillis();
+        for (ContentPlatformVideoAgg item : saveAggList) {
+            item.setLastDt(item.getDt());
+            item.setDt(aggDt);
+            item.setSource(VideoSourceEnum.RANK_HOT.getVal());
+            item.setStatus(VideoStatusEnum.NORMAL.getVal());
+            item.setCreateTimestamp(now);
+        }
+        planMapperExt.batchInsertContentPlatformVideoAgg(saveAggList);
+    }
+
+    private void syncRecommendedForYouVideo(String dt, List<ContentPlatformVideoAgg> existVideoList) {
+        String sql = String.format("SELECT dt, account_id, vid, merge_two_category, title, video_path, base_score, sim_score " +
+                "FROM loghubods.loghubods.new_content_platform_video_recall_i2i_pq WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideoAgg> saveList = new ArrayList<>();
+            List<ContentPlatformVideoAccountRel> saveAccountRelList = new ArrayList<>();
+            for (Record record : dataList) {
+                // 保存视频
+                ContentPlatformVideoAgg item = new ContentPlatformVideoAgg();
+                Long accountId = Long.parseLong((String) record.get(1));
+                Long videoId = Long.parseLong((String) record.get(2));
+                String category = (String) record.get(3);
+                String title = (String) record.get(4);
+                String videoUrl = (String) record.get(5);
+                Double score = Double.parseDouble((String) record.get(6));
+                Double simScore = Double.parseDouble((String) record.get(7));
+                item.setDt(dt);
+                item.setLastDt(dt);
+                item.setVideoId(videoId);
+                item.setCategory(category);
+                item.setTitle(title);
+                item.setVideo(videoUrl);
+                item.setScore(score);
+                item.setSource(VideoSourceEnum.ACCOUNT_RECOMMEND.getVal());
+                item.setStatus(VideoStatusEnum.NORMAL.getVal());
                 item.setCreateTimestamp(now);
+                saveList.add(item);
+                // 保存账号关系
+                ContentPlatformVideoAccountRel accountRel = new ContentPlatformVideoAccountRel();
+                accountRel.setDt(dt);
+                accountRel.setAccountId(accountId);
+                accountRel.setVideoId(videoId);
+                accountRel.setSimScore(simScore);
+                accountRel.setCreateTimestamp(now);
+                saveAccountRelList.add(accountRel);
+            }
+            List<Long> existVideoIds = existVideoList.stream().map(ContentPlatformVideoAgg::getVideoId).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(existVideoIds)) {
+                saveList.removeIf(o -> existVideoIds.contains(o.getVideoId()));
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                // 获取视频封面
+                getAggVideoCover(saveList);
+                planMapperExt.deleteContentPlatformVideoAgg(dt, VideoSourceEnum.ACCOUNT_RECOMMEND.getVal());
+                // save
+                planMapperExt.batchInsertContentPlatformVideoAgg(saveList);
+            }
+            if (CollectionUtils.isNotEmpty(saveAccountRelList)) {
+                planMapperExt.deleteContentPlatformVideoAccountRel(dt);
+                planMapperExt.batchInsertContentPlatformVideoAccountRel(saveAccountRelList);
+            }
+        }
+    }
+
+    private void getAggVideoCover(List<ContentPlatformVideoAgg> saveList) {
+        for (List<ContentPlatformVideoAgg> partition : Lists.partition(saveList, 20)) {
+            List<Long> videoIds = partition.stream().map(ContentPlatformVideoAgg::getVideoId).distinct().collect(Collectors.toList());
+            Map<Long, VideoDetail> coverMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
+            for (ContentPlatformVideoAgg item : partition) {
+                VideoDetail detail = coverMap.get(item.getVideoId());
+                if (Objects.nonNull(detail)) {
+                    String cover = detail.getCover().substring(0, detail.getCover().indexOf("/watermark"));
+                    item.setCover(cover);
+                    if (detail.getAuditStatus() != 5) {
+                        item.setStatus(VideoStatusEnum.DELETED.getVal());
+                    }
+                }
+            }
+        }
+    }
+
+    private void syncVideoTag(String dt) {
+        String sql = String.format("SELECT dt, vid, platform, type, channel, account, tag " +
+                "FROM loghubods.loghubods.new_content_platform_video_display_tags WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideoTag> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                Long videoId = Long.parseLong((String) record.get(1));
+                String platform = (String) record.get(2);
+                String type = (String) record.get(3);
+                String channel = (String) record.get(4);
+                Long accountId = Long.parseLong((String) record.get(5));
+                Integer tag = Integer.valueOf((String) record.get(6));
+                ContentPlatformVideoTag videoTag = new ContentPlatformVideoTag();
+                videoTag.setDt(dt);
+                videoTag.setVideoId(videoId);
+                videoTag.setPlatform(platform);
+                videoTag.setType(type);
+                videoTag.setChannel(channel);
+                videoTag.setAccountId(accountId);
+                videoTag.setTag(tag);
+                videoTag.setCreateTimestamp(now);
+                saveList.add(videoTag);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.deleteContentPlatformVideoTag(dt);
+                planMapperExt.batchInsertContentPlatformVideoTag(saveList);
             }
-            planMapperExt.batchInsertContentPlatformVideoAgg(saveAggList);
         }
-        return ReturnT.SUCCESS;
     }
 
     private List<ContentPlatformIllegalVideo> getAllIllegalVideoList() {
@@ -186,9 +315,9 @@ public class ContentPlatformVideoJob {
         return videoMapper.selectByExample(example);
     }
 
-    private long getVideoAggCount(String dt) {
+    private long getVideoAggCount(String dt, Integer source) {
         ContentPlatformVideoAggExample example = new ContentPlatformVideoAggExample();
-        example.createCriteria().andDtEqualTo(dt);
+        example.createCriteria().andDtEqualTo(dt).andSourceEqualTo(source);
         return videoAggMapper.countByExample(example);
     }
 
@@ -439,7 +568,7 @@ public class ContentPlatformVideoJob {
 
     private List<ContentPlatformAccount> getAllContentPlatformAccount() {
         ContentPlatformAccountExample example = new ContentPlatformAccountExample();
-        example.createCriteria().andStatusEqualTo(1);
+        example.createCriteria().andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return accountMapper.selectByExample(example);
     }
 
@@ -463,7 +592,7 @@ public class ContentPlatformVideoJob {
 
     private List<ContentPlatformUploadVideo> getAllUploadVideo() {
         ContentPlatformUploadVideoExample example = new ContentPlatformUploadVideoExample();
-        example.createCriteria().andIsDeleteEqualTo(0);
+        example.createCriteria().andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         return uploadVideoMapper.selectByExample(example);
     }
 

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComCreateRoomJob.java

@@ -149,7 +149,7 @@ public class WeComCreateRoomJob {
                                List<ThirdPartWeComStaffUser> staffUserList,
                                Integer roomNum) {
         Iterator<ThirdPartWeComStaffUser> iterator = staffUserList.iterator();
-        // todo createRoom 暂时每次任务仅创建一个群
+        // createRoom 暂时每次任务仅创建一个群
         //while (iterator.hasNext()) {
         List<Long> vids = new ArrayList<>();
         List<ThirdPartWeComStaffUser> addUserList = new ArrayList<>();
@@ -206,7 +206,7 @@ public class WeComCreateRoomJob {
             setRoomAntiRequest.setAntiIds(antiSpamRuleList.stream().map(AntiSpamRuleResponse.AntiSpamRule::getId).collect(Collectors.toList()));
             apiClient.setRoomAnti(setRoomAntiRequest);
         }
-        // todo createRoom 设置管理员
+        // createRoom 设置管理员
         //apiClient.addRoomAdmins();
     }
 

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentListParam.java

@@ -16,6 +16,15 @@ public class VideoContentListParam extends PageParam {
     @ApiModelProperty(value = "行业 0-自动回复、1-服务号推送、2-企微-社群、3-企微-自动回复、4-公众号推送")
     private Integer type = 999;
 
+    @ApiModelProperty(value = "排序类型 0-分数排序 1-更新时间")
+    private Integer sortType = 0;
+
     @ApiModelProperty(value = "排序 0-平台推荐 1-行业裂变率 2-本渠道裂变率 3-推荐指数")
     private Integer sort = 0;
+
+    @ApiModelProperty(value = "标签 ")
+    private String tag;
+
+    @ApiModelProperty(value = "近期未使用 0-历史 1-近30天 2-近14天 3-近7天 4-近3天")
+    private Integer recentNotUsed;
 }

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java

@@ -21,6 +21,8 @@ public class ContentPlatformGzhPlanVideo {
 
     private String pageUrl;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -105,6 +107,14 @@ public class ContentPlatformGzhPlanVideo {
         this.pageUrl = pageUrl;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -137,6 +147,7 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
         sb.append(", pageUrl=").append(pageUrl);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java

@@ -775,6 +775,66 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

+ 11 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideo.java

@@ -13,6 +13,8 @@ public class ContentPlatformQwPlanVideo {
 
     private String video;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -65,6 +67,14 @@ public class ContentPlatformQwPlanVideo {
         this.video = video;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -93,6 +103,7 @@ public class ContentPlatformQwPlanVideo {
         sb.append(", title=").append(title);
         sb.append(", cover=").append(cover);
         sb.append(", video=").append(video);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

+ 60 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideoExample.java

@@ -505,6 +505,66 @@ public class ContentPlatformQwPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

+ 79 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRel.java

@@ -0,0 +1,79 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoAccountRel {
+    private Long id;
+
+    private String dt;
+
+    private Long accountId;
+
+    private Long videoId;
+
+    private Double simScore;
+
+    private Long createTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDt() {
+        return dt;
+    }
+
+    public void setDt(String dt) {
+        this.dt = dt;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public Double getSimScore() {
+        return simScore;
+    }
+
+    public void setSimScore(Double simScore) {
+        this.simScore = simScore;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", dt=").append(dt);
+        sb.append(", accountId=").append(accountId);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", simScore=").append(simScore);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 581 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAccountRelExample.java

@@ -0,0 +1,581 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformVideoAccountRelExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoAccountRelExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNull() {
+            addCriterion("dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNotNull() {
+            addCriterion("dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtEqualTo(String value) {
+            addCriterion("dt =", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotEqualTo(String value) {
+            addCriterion("dt <>", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThan(String value) {
+            addCriterion("dt >", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThanOrEqualTo(String value) {
+            addCriterion("dt >=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThan(String value) {
+            addCriterion("dt <", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThanOrEqualTo(String value) {
+            addCriterion("dt <=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLike(String value) {
+            addCriterion("dt like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotLike(String value) {
+            addCriterion("dt not like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIn(List<String> values) {
+            addCriterion("dt in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotIn(List<String> values) {
+            addCriterion("dt not in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtBetween(String value1, String value2) {
+            addCriterion("dt between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotBetween(String value1, String value2) {
+            addCriterion("dt not between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreIsNull() {
+            addCriterion("sim_score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreIsNotNull() {
+            addCriterion("sim_score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreEqualTo(Double value) {
+            addCriterion("sim_score =", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotEqualTo(Double value) {
+            addCriterion("sim_score <>", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreGreaterThan(Double value) {
+            addCriterion("sim_score >", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("sim_score >=", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreLessThan(Double value) {
+            addCriterion("sim_score <", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreLessThanOrEqualTo(Double value) {
+            addCriterion("sim_score <=", value, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreIn(List<Double> values) {
+            addCriterion("sim_score in", values, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotIn(List<Double> values) {
+            addCriterion("sim_score not in", values, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreBetween(Double value1, Double value2) {
+            addCriterion("sim_score between", value1, value2, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andSimScoreNotBetween(Double value1, Double value2) {
+            addCriterion("sim_score not between", value1, value2, "simScore");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 22 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAgg.java

@@ -5,6 +5,10 @@ public class ContentPlatformVideoAgg {
 
     private String dt;
 
+    private String lastDt;
+
+    private Integer source;
+
     private Long videoId;
 
     private String category;
@@ -39,6 +43,22 @@ public class ContentPlatformVideoAgg {
         this.dt = dt;
     }
 
+    public String getLastDt() {
+        return lastDt;
+    }
+
+    public void setLastDt(String lastDt) {
+        this.lastDt = lastDt;
+    }
+
+    public Integer getSource() {
+        return source;
+    }
+
+    public void setSource(Integer source) {
+        this.source = source;
+    }
+
     public Long getVideoId() {
         return videoId;
     }
@@ -119,6 +139,8 @@ public class ContentPlatformVideoAgg {
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
         sb.append(", dt=").append(dt);
+        sb.append(", lastDt=").append(lastDt);
+        sb.append(", source=").append(source);
         sb.append(", videoId=").append(videoId);
         sb.append(", category=").append(category);
         sb.append(", title=").append(title);

+ 130 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoAggExample.java

@@ -245,6 +245,136 @@ public class ContentPlatformVideoAggExample {
             return (Criteria) this;
         }
 
+        public Criteria andLastDtIsNull() {
+            addCriterion("last_dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtIsNotNull() {
+            addCriterion("last_dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtEqualTo(String value) {
+            addCriterion("last_dt =", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotEqualTo(String value) {
+            addCriterion("last_dt <>", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtGreaterThan(String value) {
+            addCriterion("last_dt >", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtGreaterThanOrEqualTo(String value) {
+            addCriterion("last_dt >=", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLessThan(String value) {
+            addCriterion("last_dt <", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLessThanOrEqualTo(String value) {
+            addCriterion("last_dt <=", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtLike(String value) {
+            addCriterion("last_dt like", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotLike(String value) {
+            addCriterion("last_dt not like", value, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtIn(List<String> values) {
+            addCriterion("last_dt in", values, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotIn(List<String> values) {
+            addCriterion("last_dt not in", values, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtBetween(String value1, String value2) {
+            addCriterion("last_dt between", value1, value2, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andLastDtNotBetween(String value1, String value2) {
+            addCriterion("last_dt not between", value1, value2, "lastDt");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIsNull() {
+            addCriterion("`source` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIsNotNull() {
+            addCriterion("`source` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceEqualTo(Integer value) {
+            addCriterion("`source` =", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotEqualTo(Integer value) {
+            addCriterion("`source` <>", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThan(Integer value) {
+            addCriterion("`source` >", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`source` >=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThan(Integer value) {
+            addCriterion("`source` <", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceLessThanOrEqualTo(Integer value) {
+            addCriterion("`source` <=", value, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceIn(List<Integer> values) {
+            addCriterion("`source` in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotIn(List<Integer> values) {
+            addCriterion("`source` not in", values, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceBetween(Integer value1, Integer value2) {
+            addCriterion("`source` between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
+        public Criteria andSourceNotBetween(Integer value1, Integer value2) {
+            addCriterion("`source` not between", value1, value2, "source");
+            return (Criteria) this;
+        }
+
         public Criteria andVideoIdIsNull() {
             addCriterion("video_id is null");
             return (Criteria) this;

+ 112 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTag.java

@@ -0,0 +1,112 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideoTag {
+    private Long id;
+
+    private String dt;
+
+    private Long videoId;
+
+    private String platform;
+
+    private Long accountId;
+
+    private String type;
+
+    private String channel;
+
+    private Integer tag;
+
+    private Long createTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDt() {
+        return dt;
+    }
+
+    public void setDt(String dt) {
+        this.dt = dt;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getPlatform() {
+        return platform;
+    }
+
+    public void setPlatform(String platform) {
+        this.platform = platform;
+    }
+
+    public Long getAccountId() {
+        return accountId;
+    }
+
+    public void setAccountId(Long accountId) {
+        this.accountId = accountId;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public void setType(String type) {
+        this.type = type;
+    }
+
+    public String getChannel() {
+        return channel;
+    }
+
+    public void setChannel(String channel) {
+        this.channel = channel;
+    }
+
+    public Integer getTag() {
+        return tag;
+    }
+
+    public void setTag(Integer tag) {
+        this.tag = tag;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", dt=").append(dt);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", platform=").append(platform);
+        sb.append(", accountId=").append(accountId);
+        sb.append(", type=").append(type);
+        sb.append(", channel=").append(channel);
+        sb.append(", tag=").append(tag);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 791 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoTagExample.java

@@ -0,0 +1,791 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformVideoTagExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoTagExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNull() {
+            addCriterion("dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNotNull() {
+            addCriterion("dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtEqualTo(String value) {
+            addCriterion("dt =", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotEqualTo(String value) {
+            addCriterion("dt <>", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThan(String value) {
+            addCriterion("dt >", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThanOrEqualTo(String value) {
+            addCriterion("dt >=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThan(String value) {
+            addCriterion("dt <", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThanOrEqualTo(String value) {
+            addCriterion("dt <=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLike(String value) {
+            addCriterion("dt like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotLike(String value) {
+            addCriterion("dt not like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIn(List<String> values) {
+            addCriterion("dt in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotIn(List<String> values) {
+            addCriterion("dt not in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtBetween(String value1, String value2) {
+            addCriterion("dt between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotBetween(String value1, String value2) {
+            addCriterion("dt not between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIsNull() {
+            addCriterion("platform is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIsNotNull() {
+            addCriterion("platform is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformEqualTo(String value) {
+            addCriterion("platform =", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotEqualTo(String value) {
+            addCriterion("platform <>", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThan(String value) {
+            addCriterion("platform >", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformGreaterThanOrEqualTo(String value) {
+            addCriterion("platform >=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThan(String value) {
+            addCriterion("platform <", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLessThanOrEqualTo(String value) {
+            addCriterion("platform <=", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformLike(String value) {
+            addCriterion("platform like", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotLike(String value) {
+            addCriterion("platform not like", value, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformIn(List<String> values) {
+            addCriterion("platform in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotIn(List<String> values) {
+            addCriterion("platform not in", values, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformBetween(String value1, String value2) {
+            addCriterion("platform between", value1, value2, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andPlatformNotBetween(String value1, String value2) {
+            addCriterion("platform not between", value1, value2, "platform");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNull() {
+            addCriterion("account_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIsNotNull() {
+            addCriterion("account_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdEqualTo(Long value) {
+            addCriterion("account_id =", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotEqualTo(Long value) {
+            addCriterion("account_id <>", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThan(Long value) {
+            addCriterion("account_id >", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("account_id >=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThan(Long value) {
+            addCriterion("account_id <", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdLessThanOrEqualTo(Long value) {
+            addCriterion("account_id <=", value, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdIn(List<Long> values) {
+            addCriterion("account_id in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotIn(List<Long> values) {
+            addCriterion("account_id not in", values, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdBetween(Long value1, Long value2) {
+            addCriterion("account_id between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andAccountIdNotBetween(Long value1, Long value2) {
+            addCriterion("account_id not between", value1, value2, "accountId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(String value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(String value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(String value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(String value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(String value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(String value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLike(String value) {
+            addCriterion("`type` like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotLike(String value) {
+            addCriterion("`type` not like", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<String> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<String> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(String value1, String value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(String value1, String value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIsNull() {
+            addCriterion("channel is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIsNotNull() {
+            addCriterion("channel is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelEqualTo(String value) {
+            addCriterion("channel =", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotEqualTo(String value) {
+            addCriterion("channel <>", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThan(String value) {
+            addCriterion("channel >", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelGreaterThanOrEqualTo(String value) {
+            addCriterion("channel >=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThan(String value) {
+            addCriterion("channel <", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLessThanOrEqualTo(String value) {
+            addCriterion("channel <=", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelLike(String value) {
+            addCriterion("channel like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotLike(String value) {
+            addCriterion("channel not like", value, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelIn(List<String> values) {
+            addCriterion("channel in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotIn(List<String> values) {
+            addCriterion("channel not in", values, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelBetween(String value1, String value2) {
+            addCriterion("channel between", value1, value2, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andChannelNotBetween(String value1, String value2) {
+            addCriterion("channel not between", value1, value2, "channel");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNull() {
+            addCriterion("tag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIsNotNull() {
+            addCriterion("tag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagEqualTo(Integer value) {
+            addCriterion("tag =", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotEqualTo(Integer value) {
+            addCriterion("tag <>", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThan(Integer value) {
+            addCriterion("tag >", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagGreaterThanOrEqualTo(Integer value) {
+            addCriterion("tag >=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThan(Integer value) {
+            addCriterion("tag <", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagLessThanOrEqualTo(Integer value) {
+            addCriterion("tag <=", value, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagIn(List<Integer> values) {
+            addCriterion("tag in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotIn(List<Integer> values) {
+            addCriterion("tag not in", values, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagBetween(Integer value1, Integer value2) {
+            addCriterion("tag between", value1, value2, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andTagNotBetween(Integer value1, Integer value2) {
+            addCriterion("tag not between", value1, value2, "tag");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 5 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java

@@ -3,6 +3,8 @@ package com.tzld.piaoquan.api.model.vo.contentplatform;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.util.List;
+
 @Data
 public class VideoContentItemVO {
 
@@ -29,4 +31,7 @@ public class VideoContentItemVO {
 
     @ApiModelProperty(value = "推荐指数")
     private Double recommendScore;
+
+    @ApiModelProperty(value = "标签")
+    private List<String> tags;
 }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformApiServiceImpl.java

@@ -98,7 +98,7 @@ public class ContentPlatformApiServiceImpl implements ContentPlatformApiService
         if (count == 0) {
             return result;
         }
-        List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(listParam, dt, datastatDt,
+        List<ContentPlatformVideo> videoList = planMapperExt.getApiVideoList(listParam, dt, datastatDt,
                 "", "sum", "normal", videoMinScore,
                 offset, param.getPageSize(), "video.score desc");
         List<VideoIdTitleVO> list = videoList.stream().map(video -> {

+ 8 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java

@@ -2,6 +2,8 @@ package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.alibaba.fastjson.JSONObject;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.PlanStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.AigcApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhAccountMapper;
@@ -115,7 +117,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             gzhAccountMapper.insertSelective(account);
         } else {
             account.setId(param.getId());
-            account.setStatus(1);
+            account.setStatus(AccountStatusEnum.NORMAL.getVal());
             gzhAccountMapper.updateByPrimaryKeySelective(account);
         }
     }
@@ -168,7 +170,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
         }
         ContentPlatformGzhAccount gzhAccount = new ContentPlatformGzhAccount();
         gzhAccount.setId(id);
-        gzhAccount.setStatus(0);
+        gzhAccount.setStatus(AccountStatusEnum.FORBIDDEN.getVal());
         gzhAccount.setUpdateTimestamp(System.currentTimeMillis());
         gzhAccountMapper.updateByPrimaryKeySelective(gzhAccount);
     }
@@ -195,7 +197,8 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public List<ContentPlatformGzhAccount> getCooperateAccountListByGhIds(Long loginAccountId, List<String> ghIds) {
         ContentPlatformGzhAccountExample gzhAccountExample = new ContentPlatformGzhAccountExample();
-        gzhAccountExample.createCriteria().andCreateAccountIdEqualTo(loginAccountId).andGhIdIn(ghIds).andStatusEqualTo(1);
+        gzhAccountExample.createCriteria().andCreateAccountIdEqualTo(loginAccountId).andGhIdIn(ghIds)
+                .andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(gzhAccountExample);
     }
 
@@ -248,7 +251,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public ContentPlatformGzhAccount getGzhAccount(String ghId) {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andGhIdEqualTo(ghId).andStatusEqualTo(1);
+        example.createCriteria().andGhIdEqualTo(ghId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         List<ContentPlatformGzhAccount> accountList = gzhAccountMapper.selectByExample(example);
         if (CollectionUtils.isNotEmpty(accountList)) {
             return accountList.get(0);
@@ -259,7 +262,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     @Override
     public List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId) {
         ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
-        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(1);
+        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhAccountMapper.selectByExample(example);
     }
 }

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformNoticeServiceImpl.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
+import com.tzld.piaoquan.api.common.enums.contentplatform.PlanStatusEnum;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformIllegalMsgMapper;
 import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.NoticeListParam;
@@ -60,7 +61,7 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
     public Long getNotReadCount() {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
         ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
-        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(PlanStatusEnum.DELETED.getVal());
         return msgMapper.countByExample(example);
     }
 
@@ -77,7 +78,7 @@ public class ContentPlatformNoticeServiceImpl implements ContentPlatformNoticeSe
     public void noticeReadAll() {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
         ContentPlatformIllegalMsgExample example = new ContentPlatformIllegalMsgExample();
-        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(0);
+        example.createCriteria().andAccountIdEqualTo(loginAccount.getId()).andStatusEqualTo(PlanStatusEnum.DELETED.getVal());
         ContentPlatformIllegalMsg record = new ContentPlatformIllegalMsg();
         record.setStatus(1);
         record.setUpdateTimestamp(System.currentTimeMillis());

+ 89 - 27
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -3,9 +3,7 @@ package com.tzld.piaoquan.api.service.contentplatform.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.ContentPlatformGzhPlanTypeEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.PublishStageEnum;
-import com.tzld.piaoquan.api.common.enums.contentplatform.QwPlanTypeEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.*;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
@@ -188,7 +186,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds) {
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
@@ -198,7 +196,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (Objects.isNull(plan)) {
             throw new CommonException(ExceptionEnum.GZH_PLAN_NOT_EXISTS);
         }
-        plan.setStatus(0);
+        plan.setStatus(PlanStatusEnum.DELETED.getVal());
         plan.setUpdateTimestamp(System.currentTimeMillis());
         gzhPlanMapper.updateByPrimaryKeySelective(plan);
         if (PublishStageEnum.PLATFORM.getVal() == plan.getPublishStage()) {
@@ -232,7 +230,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (Objects.isNull(plan)) {
             throw new CommonException(ExceptionEnum.QW_PLAN_NOT_EXISTS);
         }
-        plan.setStatus(0);
+        plan.setStatus(PlanStatusEnum.DELETED.getVal());
         plan.setUpdateTimestamp(System.currentTimeMillis());
         qwPlanMapper.updateByPrimaryKeySelective(plan);
     }
@@ -346,7 +344,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, item -> item));
         for (ContentPlatformGzhPlanVideo item : existsVideo) {
             if (!videoIds.contains(item.getVideoId())) {
-                gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
+                //gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
+                item.setStatus(VideoStatusEnum.DELETED.getVal());
+                gzhPlanVideoMapper.updateByPrimaryKeySelective(item);
             }
         }
         for (GzhPlanVideoContentItemParam vo : param.getVideoList()) {
@@ -363,6 +363,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 item.setCover(vo.getCover());
                 item.setCustomCover(vo.getCustomCover());
                 item.setCustomCoverType(vo.getCustomCoverType());
+                item.setStatus(VideoStatusEnum.NORMAL.getVal());
                 gzhPlanVideoMapper.updateByPrimaryKey(item);
             } else {
                 ContentPlatformGzhPlanVideo item = new ContentPlatformGzhPlanVideo();
@@ -387,6 +388,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     SmallPageUrlDetail smallPageUrlDetail = json.getJSONObject("data").toJavaObject(SmallPageUrlDetail.class);
                     item.setPageUrl(smallPageUrlDetail.getUrl());
                 }
+                item.setStatus(VideoStatusEnum.NORMAL.getVal());
                 item.setCreateAccountId(loginAccount.getId());
                 item.setCreateTimestamp(System.currentTimeMillis());
                 gzhPlanVideoMapper.insert(item);
@@ -419,7 +421,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     private List<ContentPlatformGzhPlanVideo> getGzhVideoByPlanId(Long planId) {
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andPlanIdEqualTo(planId);
+        example.createCriteria().andPlanIdEqualTo(planId).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
@@ -451,14 +453,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId) {
         ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
-        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(1);
+        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhPlanMapper.selectByExample(example);
     }
 
     @Override
     public List<ContentPlatformGzhPlan> getGzhPlanListByCreateAccountId(Long createAccountId) {
         ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
-        example.createCriteria().andCreateAccountIdEqualTo(createAccountId).andStatusEqualTo(1);
+        example.createCriteria().andCreateAccountIdEqualTo(createAccountId).andStatusEqualTo(PlanStatusEnum.NORMAL.getVal());
         return gzhPlanMapper.selectByExample(example);
     }
 
@@ -482,17 +484,54 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             result.setObjs(new ArrayList<>());
             return result;
         }
-        String sort = getVideoContentListSort(param.getSort());
+        String sort = getVideoContentListSort(param.getSortType(), param.getSort());
         String type = getVideoContentListType(param.getType());
         String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
         String strategy = param.getSort() == 3 ? "recommend" : "normal";
+        // 标签筛选
+        String tagFilterSql = getVideoContentListTagFilterSql(param.getTag(), user.getId(), type, user.getChannel());
+        // 近期未使用
+        Long excludeVideoRecentNotUsed = getVideoExcludeRecentNotUsed(param.getRecentNotUsed());
         List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, datastatDt, type, channel, strategy,
-                videoMinScore, offset, param.getPageSize(), sort);
-        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), datastatDt);
+                videoMinScore, user.getId(), excludeVideoRecentNotUsed, tagFilterSql, offset, param.getPageSize(), sort);
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, "sum", user.getChannel(), dt, datastatDt);
         result.setObjs(list);
         return result;
     }
 
+    private String getVideoContentListTagFilterSql(String tag, Long accountId, String type, String channel) {
+        if (Objects.isNull(tag)) {
+            return null;
+        }
+        switch (tag) {
+            case "票圈受欢迎":
+                return "videoTag.platform = 'platform'";
+            case "同类用户喜欢":
+                return "videoTag.account_id = " + accountId;
+            case "你的用户爱看":
+                return "videoTag.type = " + type;
+            case "猜TA想看":
+                return "videoTag.channel = " + channel;
+            default:
+                return null;
+        }
+        //- 票圈受欢迎
+        //- 同类用户喜欢
+        //- 你的用户爱看
+        //- 猜TA想看
+    }
+
+    private Long getVideoExcludeRecentNotUsed(Integer recentNotUsed) {
+        VideoRecentNotUsedEnum videoRecentNotUsedEnum = VideoRecentNotUsedEnum.getByVal(recentNotUsed);
+        if (Objects.isNull(videoRecentNotUsedEnum)) {
+            return null;
+        }
+        if (videoRecentNotUsedEnum == VideoRecentNotUsedEnum.HISTORY) {
+            return 0L;
+        }
+        return System.currentTimeMillis() - videoRecentNotUsedEnum.getDays() * 24 * 60 * 60 * 1000;
+    }
+
     private String getVideoContentListType(Integer type) {
         switch (type) {
             case 0:
@@ -517,7 +556,10 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return "sum";
     }
 
-    private String getVideoContentListSort(Integer sort) {
+    private String getVideoContentListSort(Integer sortType, Integer sort) {
+        if (sortType == 1) {
+            return "video.last_dt desc, video.score desc";
+        }
         switch (sort) {
             case 0:
                 return "video.score desc";
@@ -533,10 +575,15 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     }
 
     private List<VideoContentItemVO> buildVideoContentItemVOList(List<ContentPlatformVideo> videoList,
-                                                                 String type, String channel, String userChannel, String datastatDt) {
+                                                                 String type,
+                                                                 String channel,
+                                                                 String userChannel,
+                                                                 String dt,
+                                                                 String datastatDt) {
         if (CollectionUtils.isEmpty(videoList)) {
             return null;
         }
+        ContentPlatformAccount user = LoginUserContext.getUser();
         List<Long> videoIds = videoList.stream()
                 .map(ContentPlatformVideo::getVideoId).distinct().collect(Collectors.toList());
         List<Long> getCoverVideoIds = videoList.stream()
@@ -551,16 +598,20 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 type, Arrays.asList("sum", userChannel), videoIds);
         Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> channelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendTypeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendChannelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+        // tag
+        List<ContentPlatformVideoTag> videoTagList = planMapperExt.getVideoTagList(dt, videoIds, user.getId(), type, channel);
+        Map<Long, List<ContentPlatformVideoTag>> videoTagMap = videoTagList.stream()
+                .collect(Collectors.groupingBy(ContentPlatformVideoTag::getVideoId));
         List<VideoContentItemVO> result = new ArrayList<>();
         for (ContentPlatformVideo video : videoList) {
             VideoContentItemVO item = new VideoContentItemVO();
@@ -580,6 +631,15 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             if (Objects.isNull(item.getRecommendScore())) {
                 item.setRecommendScore(recommendTypeVideoScoreMap.get(video.getVideoId()));
             }
+            List<ContentPlatformVideoTag> videoTags = videoTagMap.get(video.getVideoId());
+            if (CollectionUtils.isNotEmpty(videoTags)) {
+                List<String> tags = new ArrayList<>();
+                for (ContentPlatformVideoTag videoTag : videoTags) {
+                    VideoTagEnum tagEnum = VideoTagEnum.from(videoTag.getTag());
+                    tags.add(tagEnum.getTag());
+                }
+                item.setTags(tags);
+            }
             result.add(item);
         }
         return result;
@@ -587,9 +647,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     @Override
     public List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
-                                                                                     String type,
-                                                                                     List<String> channels,
-                                                                                     List<Long> videoIds) {
+                                                                                    String type,
+                                                                                    List<String> channels,
+                                                                                    List<Long> videoIds) {
         ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
         example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type)
                 .andChannelIn(channels);
@@ -608,12 +668,12 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             result.setObjs(new ArrayList<>());
             return result;
         }
-        String sort = getVideoContentListSort(param.getSort());
+        String sort = getVideoContentListSort(param.getSortType(), param.getSort());
         String type = getVideoContentListType(param.getType());
         String channel = getVideoContentListChannel(param.getSort(), user.getChannel());
         List<ContentPlatformVideo> videoList = planMapperExt.getUploadVideoList(param, user.getId(), datastatDt,
                 type, channel, "normal", offset, param.getPageSize(), sort);
-        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, channel, user.getChannel(), datastatDt);
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList, type, channel, user.getChannel(), datastatDt, datastatDt);
         result.setObjs(list);
         return result;
     }
@@ -694,7 +754,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformQwPlanVideo> getQwPlanVideoList(List<Long> planIds) {
         ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return qwPlanVideoMapper.selectByExample(example);
     }
 
@@ -752,6 +812,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         item.setTitle(videoParam.getTitle());
         item.setCover(videoParam.getCover());
         item.setVideo(videoParam.getVideo());
+        item.setStatus(VideoStatusEnum.NORMAL.getVal());
         item.setCreateAccountId(loginAccountId);
         item.setCreateTimestamp(System.currentTimeMillis());
         qwPlanVideoMapper.insertSelective(item);
@@ -782,7 +843,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Override
     public List<ContentPlatformQwPlanVideo> getQwPlanVideoListByPlanIds(List<Long> planIds) {
         ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();
-        example.createCriteria().andPlanIdIn(planIds);
+        example.createCriteria().andPlanIdIn(planIds).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         return qwPlanVideoMapper.selectByExample(example);
     }
 
@@ -793,7 +854,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             ContentPlatformAccount account = accountService.getAccountById(gzhAccount.getCreateAccountId());
             ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
             example.createCriteria().andCreateAccountIdEqualTo(account.getId()).andAccountIdEqualTo(gzhAccount.getId())
-                    .andStatusEqualTo(1).andTypeEqualTo(ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal());
+                    .andStatusEqualTo(AccountStatusEnum.NORMAL.getVal()).andTypeEqualTo(ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal());
             List<ContentPlatformGzhPlan> list = gzhPlanMapper.selectByExample(example);
             if (CollectionUtils.isNotEmpty(list)) {
                 return account.getChannel();
@@ -864,6 +925,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     item.setTitle(videoDetail.getTitle());
                     item.setCover(videoDetail.getCover());
                     item.setVideo(videoDetail.getVideoPath());
+                    item.setStatus(VideoStatusEnum.NORMAL.getVal());
                     item.setCreateAccountId(account.getId());
                     item.setCreateTimestamp(System.currentTimeMillis());
                     gzhPlanVideoMapper.insertSelective(item);

+ 2 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformSettingServiceImpl.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.AccountStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.VideoApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformPqAccountRelMapper;
@@ -68,7 +69,7 @@ public class ContentPlatformSettingServiceImpl implements ContentPlatformSetting
     @Override
     public ContentPlatformPqAccountRel getPqAccountRel(Long accountId) {
         ContentPlatformPqAccountRelExample example = new ContentPlatformPqAccountRelExample();
-        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(1);
+        example.createCriteria().andAccountIdEqualTo(accountId).andStatusEqualTo(AccountStatusEnum.NORMAL.getVal());
         List<ContentPlatformPqAccountRel> pqAccountRelList = pqAccountRelMapper.selectByExample(example);
         if (CollectionUtils.isEmpty(pqAccountRelList)) {
             return null;

+ 7 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformUploadContentServiceImpl.java

@@ -1,7 +1,9 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.DeletedStatusEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.UploadVideoAuditStatusEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.VideoStatusEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.component.VideoApiService;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanVideoMapper;
@@ -139,7 +141,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
         if (checkVideoCited(uploadVideo)) {
             throw new CommonException(ExceptionEnum.VIDEO_CITED);
         }
-        uploadVideo.setIsDelete(1);
+        uploadVideo.setIsDelete(DeletedStatusEnum.DELETED.getVal());
         uploadVideo.setUpdateTimestamp(System.currentTimeMillis());
         uploadVideoMapper.updateByPrimaryKeySelective(uploadVideo);
         // 调用删除视频接口
@@ -150,14 +152,14 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
     private Boolean checkVideoCited(ContentPlatformUploadVideo uploadVideo) {
         Boolean result = false;
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
-        example.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId());
+        example.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId()).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         List<ContentPlatformGzhPlanVideo> gzhPlanVideos = gzhPlanVideoMapper.selectByExample(example);
         if (CollectionUtils.isNotEmpty(gzhPlanVideos)) {
             result = true;
             return result;
         }
         ContentPlatformQwPlanVideoExample qwPlanVideoExample = new ContentPlatformQwPlanVideoExample();
-        qwPlanVideoExample.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId());
+        qwPlanVideoExample.createCriteria().andVideoIdEqualTo(uploadVideo.getVideoId()).andStatusEqualTo(VideoStatusEnum.NORMAL.getVal());
         List<ContentPlatformQwPlanVideo> qwPlanVideos = qwPlanVideoMapper.selectByExample(qwPlanVideoExample);
         if (CollectionUtils.isNotEmpty(qwPlanVideos)) {
             result = true;
@@ -222,7 +224,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
             criteria.andTitleLike("%" + param.getTitle() + "%");
         }
         criteria.andCreateAccountIdEqualTo(accountId);
-        criteria.andIsDeleteEqualTo(0);
+        criteria.andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         return uploadVideoMapper.countByExample(example);
     }
 
@@ -236,7 +238,7 @@ public class ContentPlatformUploadContentServiceImpl implements ContentPlatformU
             criteria.andTitleLike("%" + param.getTitle() + "%");
         }
         criteria.andCreateAccountIdEqualTo(id);
-        criteria.andIsDeleteEqualTo(0);
+        criteria.andIsDeleteEqualTo(DeletedStatusEnum.NOT_DELETED.getVal());
         example.setOrderByClause("create_timestamp desc");
         example.setPage(new Page<>(param.getPageNum(), param.getPageSize()));
         return uploadVideoMapper.selectByExample(example);

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/util/AliOssFileTool.java

@@ -1220,7 +1220,7 @@ public class AliOssFileTool extends AliOssConfig {
             try {
                 ossInternalClient.restoreObject(bucket, srckey);
             } catch (Exception e) {
-                // TODO OSS Auto-generated catch blockvideo-common/src/main/java/com/weiqu/video/common/enums/ExceptionCodeEnum.java
+                // OSS Auto-generated catch blockvideo-common/src/main/java/com/weiqu/video/common/enums/ExceptionCodeEnum.java
 //				e.printStackTrace();
                 logger.error("视频可能在解冻中");
             }
@@ -1242,7 +1242,7 @@ public class AliOssFileTool extends AliOssConfig {
         try {
             isRestoreCompleted = objectMetadata.isRestoreCompleted();
         } catch (Exception e) {
-            // TODO OSS Auto-generated catch block
+            // OSS Auto-generated catch block
 //			e.printStackTrace();
             logger.error("视频可能在解冻中");
         }

+ 20 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml

@@ -12,6 +12,7 @@
     <result column="custom_cover_type" jdbcType="INTEGER" property="customCoverType" />
     <result column="video" jdbcType="VARCHAR" property="video" />
     <result column="page_url" jdbcType="VARCHAR" property="pageUrl" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -75,7 +76,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
-    video, page_url, create_account_id, create_timestamp
+    video, page_url, `status`, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -114,13 +115,13 @@
     insert into content_platform_gzh_plan_video (id, plan_id, video_id, 
       title, custom_title, cover, 
       custom_cover, custom_cover_type, video, 
-      page_url, create_account_id, create_timestamp
-      )
+      page_url, `status`, create_account_id, 
+      create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{customTitle,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
       #{customCover,jdbcType=VARCHAR}, #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, 
-      #{pageUrl,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
-      )
+      #{pageUrl,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, 
+      #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     insert into content_platform_gzh_plan_video
@@ -155,6 +156,9 @@
       <if test="pageUrl != null">
         page_url,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -193,6 +197,9 @@
       <if test="pageUrl != null">
         #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -240,6 +247,9 @@
       <if test="record.pageUrl != null">
         page_url = #{record.pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -263,6 +273,7 @@
       custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
       page_url = #{record.pageUrl,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -299,6 +310,9 @@
       <if test="pageUrl != null">
         page_url = #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -319,6 +333,7 @@
       custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
       page_url = #{pageUrl,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 20 - 3
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml

@@ -8,6 +8,7 @@
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
     <result column="video" jdbcType="VARCHAR" property="video" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -70,7 +71,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, plan_id, video_id, title, cover, video, create_account_id, create_timestamp
+    id, plan_id, video_id, title, cover, video, `status`, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -108,10 +109,12 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     insert into content_platform_qw_plan_video (id, plan_id, video_id, 
       title, cover, video, 
-      create_account_id, create_timestamp)
+      `status`, create_account_id, create_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT})
+      #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     insert into content_platform_qw_plan_video
@@ -134,6 +137,9 @@
       <if test="video != null">
         video,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -160,6 +166,9 @@
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -195,6 +204,9 @@
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -214,6 +226,7 @@
       title = #{record.title,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
       video = #{record.video,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -238,6 +251,9 @@
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -254,6 +270,7 @@
       title = #{title,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
       video = #{video,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 231 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAccountRelMapper.xml

@@ -0,0 +1,231 @@
+<?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="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoAccountRelMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="sim_score" jdbcType="DOUBLE" property="simScore" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, dt, account_id, video_id, sim_score, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_account_rel
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from content_platform_video_account_rel
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_account_rel
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample">
+    delete from content_platform_video_account_rel
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    insert into content_platform_video_account_rel (id, dt, account_id, 
+      video_id, sim_score, create_timestamp
+      )
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, 
+      #{videoId,jdbcType=BIGINT}, #{simScore,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    insert into content_platform_video_account_rel
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="simScore != null">
+        sim_score,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="simScore != null">
+        #{simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRelExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_account_rel
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_account_rel
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dt != null">
+        dt = #{record.dt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.simScore != null">
+        sim_score = #{record.simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_video_account_rel
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      sim_score = #{record.simScore,jdbcType=DOUBLE},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    update content_platform_video_account_rel
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="simScore != null">
+        sim_score = #{simScore,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAccountRel">
+    update content_platform_video_account_rel
+    set dt = #{dt,jdbcType=VARCHAR},
+      account_id = #{accountId,jdbcType=BIGINT},
+      video_id = #{videoId,jdbcType=BIGINT},
+      sim_score = #{simScore,jdbcType=DOUBLE},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 42 - 10
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoAggMapper.xml

@@ -4,6 +4,8 @@
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="last_dt" jdbcType="VARCHAR" property="lastDt" />
+    <result column="source" jdbcType="INTEGER" property="source" />
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="category" jdbcType="VARCHAR" property="category" />
     <result column="title" jdbcType="VARCHAR" property="title" />
@@ -73,8 +75,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, dt, video_id, category, title, cover, video, score, `status`, create_timestamp, 
-    update_timestamp
+    id, dt, last_dt, `source`, video_id, category, title, cover, video, score, `status`, 
+    create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAggExample" resultMap="BaseResultMap">
     select
@@ -110,14 +112,16 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
-    insert into content_platform_video_agg (id, dt, video_id, 
-      category, title, cover, 
-      video, score, `status`, 
-      create_timestamp, update_timestamp)
-    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
-      #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
-      #{video,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, 
-      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
+    insert into content_platform_video_agg (id, dt, last_dt, 
+      `source`, video_id, category, 
+      title, cover, video, 
+      score, `status`, create_timestamp, 
+      update_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{lastDt,jdbcType=VARCHAR}, 
+      #{source,jdbcType=INTEGER}, #{videoId,jdbcType=BIGINT}, #{category,jdbcType=VARCHAR}, 
+      #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
+      #{score,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}, 
+      #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
     insert into content_platform_video_agg
@@ -128,6 +132,12 @@
       <if test="dt != null">
         dt,
       </if>
+      <if test="lastDt != null">
+        last_dt,
+      </if>
+      <if test="source != null">
+        `source`,
+      </if>
       <if test="videoId != null">
         video_id,
       </if>
@@ -163,6 +173,12 @@
       <if test="dt != null">
         #{dt,jdbcType=VARCHAR},
       </if>
+      <if test="lastDt != null">
+        #{lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        #{source,jdbcType=INTEGER},
+      </if>
       <if test="videoId != null">
         #{videoId,jdbcType=BIGINT},
       </if>
@@ -207,6 +223,12 @@
       <if test="record.dt != null">
         dt = #{record.dt,jdbcType=VARCHAR},
       </if>
+      <if test="record.lastDt != null">
+        last_dt = #{record.lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.source != null">
+        `source` = #{record.source,jdbcType=INTEGER},
+      </if>
       <if test="record.videoId != null">
         video_id = #{record.videoId,jdbcType=BIGINT},
       </if>
@@ -243,6 +265,8 @@
     update content_platform_video_agg
     set id = #{record.id,jdbcType=BIGINT},
       dt = #{record.dt,jdbcType=VARCHAR},
+      last_dt = #{record.lastDt,jdbcType=VARCHAR},
+      `source` = #{record.source,jdbcType=INTEGER},
       video_id = #{record.videoId,jdbcType=BIGINT},
       category = #{record.category,jdbcType=VARCHAR},
       title = #{record.title,jdbcType=VARCHAR},
@@ -262,6 +286,12 @@
       <if test="dt != null">
         dt = #{dt,jdbcType=VARCHAR},
       </if>
+      <if test="lastDt != null">
+        last_dt = #{lastDt,jdbcType=VARCHAR},
+      </if>
+      <if test="source != null">
+        `source` = #{source,jdbcType=INTEGER},
+      </if>
       <if test="videoId != null">
         video_id = #{videoId,jdbcType=BIGINT},
       </if>
@@ -295,6 +325,8 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
     update content_platform_video_agg
     set dt = #{dt,jdbcType=VARCHAR},
+      last_dt = #{lastDt,jdbcType=VARCHAR},
+      `source` = #{source,jdbcType=INTEGER},
       video_id = #{videoId,jdbcType=BIGINT},
       category = #{category,jdbcType=VARCHAR},
       title = #{title,jdbcType=VARCHAR},

+ 278 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoTagMapper.xml

@@ -0,0 +1,278 @@
+<?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="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoTagMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="platform" jdbcType="VARCHAR" property="platform" />
+    <result column="account_id" jdbcType="BIGINT" property="accountId" />
+    <result column="type" jdbcType="VARCHAR" property="type" />
+    <result column="channel" jdbcType="VARCHAR" property="channel" />
+    <result column="tag" jdbcType="INTEGER" property="tag" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, dt, video_id, platform, account_id, `type`, channel, tag, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from content_platform_video_tag
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video_tag
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample">
+    delete from content_platform_video_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    insert into content_platform_video_tag (id, dt, video_id, 
+      platform, account_id, `type`, 
+      channel, tag, create_timestamp
+      )
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{platform,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, #{type,jdbcType=VARCHAR}, 
+      #{channel,jdbcType=VARCHAR}, #{tag,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    insert into content_platform_video_tag
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="platform != null">
+        platform,
+      </if>
+      <if test="accountId != null">
+        account_id,
+      </if>
+      <if test="type != null">
+        `type`,
+      </if>
+      <if test="channel != null">
+        channel,
+      </if>
+      <if test="tag != null">
+        tag,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="platform != null">
+        #{platform,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="channel != null">
+        #{channel,jdbcType=VARCHAR},
+      </if>
+      <if test="tag != null">
+        #{tag,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTagExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video_tag
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video_tag
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dt != null">
+        dt = #{record.dt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.platform != null">
+        platform = #{record.platform,jdbcType=VARCHAR},
+      </if>
+      <if test="record.accountId != null">
+        account_id = #{record.accountId,jdbcType=BIGINT},
+      </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=VARCHAR},
+      </if>
+      <if test="record.channel != null">
+        channel = #{record.channel,jdbcType=VARCHAR},
+      </if>
+      <if test="record.tag != null">
+        tag = #{record.tag,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_video_tag
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      platform = #{record.platform,jdbcType=VARCHAR},
+      account_id = #{record.accountId,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=VARCHAR},
+      channel = #{record.channel,jdbcType=VARCHAR},
+      tag = #{record.tag,jdbcType=INTEGER},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    update content_platform_video_tag
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="platform != null">
+        platform = #{platform,jdbcType=VARCHAR},
+      </if>
+      <if test="accountId != null">
+        account_id = #{accountId,jdbcType=BIGINT},
+      </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=VARCHAR},
+      </if>
+      <if test="channel != null">
+        channel = #{channel,jdbcType=VARCHAR},
+      </if>
+      <if test="tag != null">
+        tag = #{tag,jdbcType=INTEGER},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+    update content_platform_video_tag
+    set dt = #{dt,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      platform = #{platform,jdbcType=VARCHAR},
+      account_id = #{accountId,jdbcType=BIGINT},
+      `type` = #{type,jdbcType=VARCHAR},
+      channel = #{channel,jdbcType=VARCHAR},
+      tag = #{tag,jdbcType=INTEGER},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 92 - 12
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -36,8 +36,9 @@
         <if test="param.title != null and param.title != ''">
             and id in (select plan_id
             from content_platform_gzh_plan_video
-            where title like concat('%', #{param.title}, '%')
+            where (title like concat('%', #{param.title}, '%')
             or custom_title like concat('%', #{param.title}, '%'))
+            and status = 1)
         </if>
     </select>
 
@@ -67,8 +68,9 @@
         <if test="param.title != null and param.title != ''">
             and id in (select plan_id
                        from content_platform_gzh_plan_video
-                       where title like concat('%', #{param.title}, '%')
+                       where (title like concat('%', #{param.title}, '%')
                        or custom_title like concat('%', #{param.title}, '%'))
+                       and status = 1)
         </if>
         order by create_timestamp desc
         limit #{offset}, #{pageSize}
@@ -110,7 +112,7 @@
         </if>
     </select>
 
-    <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    <select id="getApiVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
         select video.*
         from content_platform_video_agg video
         left join content_platform_video_datastat_agg datastat
@@ -127,6 +129,46 @@
         limit #{offset}, #{pageSize}
     </select>
 
+    <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+        select video.*
+        from content_platform_video_agg video
+        left join content_platform_video_datastat_agg datastat
+        on datastat.dt = #{datastatDt} and datastat.type = #{type} and datastat.channel = #{channel}
+        and datastat.strategy = #{strategy} and datastat.video_id = video.video_id
+        <if test="excludeVideoTime != null">
+            left join content_platform_gzh_plan_video gzhPlanVideo
+            on gzhPlanVideo.video_id = video.video_id and gzhPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and gzhPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+            left join content_platform_qw_plan_video qwPlanVideo
+            on qwPlanVideo.video_id = video.video_id and qwPlanVideo.create_account_id = #{createAccountId}
+            <if test="excludeVideoTime != 0">
+                and qwPlanVideo.create_timestamp > #{excludeVideoTime}
+            </if>
+        </if>
+        <if test="param.tag != null">
+            join content_platform_video_tag videoTag
+            on videoTag.dt = video.dt and videoTag.video_id = video.video_id and ${videoTagFilter}
+        </if>
+        where video.dt = #{dt} and video.status = 1 and video.score > #{minScore}
+          and (video.source = 1 or video.video_id in (select video_id
+                                                      from content_platform_video_account_rel
+                                                      where dt = #{dt} and account_id = #{createAccountId}))
+        <if test="param.title!= null and param.title!= ''">
+            and video.title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and video.category = #{param.category}
+        </if>
+        <if test="excludeVideoTime != null">
+            and gzhPlanVideo.video_id is null
+            and qwPlanVideo.video_id is null
+        </if>
+        order by ${sort}
+        limit #{offset}, #{pageSize}
+    </select>
+
     <select id="getVideoMinScoreList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
         select *
         from content_platform_video_agg video
@@ -203,8 +245,9 @@
             and sub_channel like concat('%', #{param.subChannel}, '%')
         </if>
         <if test="param.title != null and param.title != ''">
-            and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
-            '%'))
+            and id in (select plan_id
+                       from content_platform_qw_plan_video
+                       where title like concat('%', #{param.title}, '%') and status = 1)
         </if>
     </select>
 
@@ -222,8 +265,9 @@
             and sub_channel like concat('%', #{param.subChannel}, '%')
         </if>
         <if test="param.title != null and param.title != ''">
-            and id in (select plan_id from content_platform_qw_plan_video where title like concat('%', #{param.title},
-            '%'))
+            and id in (select plan_id
+                       from content_platform_qw_plan_video
+                       where title like concat('%', #{param.title}, '%') and status = 1)
         </if>
         order by create_timestamp desc
         limit #{offset}, #{pageSize}
@@ -258,14 +302,16 @@
           and cpgac.status = 1
           and cpgp.scene = 0
           and cpgp.status = 1
+          and cpgpv.status = 1
     </select>
 
     <select id="getVideoAggList"
             resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoAgg">
-        SELECT t.video_id, t.category, t.title, t.cover, t.video, round(t.avg_score, 3) as score
+        SELECT t.video_id, t.category, t.title, t.cover, t.video, round(t.avg_score, 3) as score, t.dt
         FROM (
         SELECT video_id, category, title, cover, video, AVG(score) OVER (PARTITION BY video_id) AS avg_score,
-            ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn
+            ROW_NUMBER() OVER (PARTITION BY video_id ORDER BY dt DESC) AS rn,
+            MAX(dt) OVER (PARTITION BY video_id) AS dt
         FROM content_platform_video
         where dt in
         <foreach collection="dtList" item="item" open="(" close=")" separator=",">
@@ -314,7 +360,7 @@
     </delete>
 
     <delete id="deleteContentPlatformVideoAgg">
-        delete from content_platform_video_agg where dt = #{dt}
+        delete from content_platform_video_agg where dt = #{dt} and source = #{source}
     </delete>
 
     <delete id="deleteContentPlatformVideoDatastatAgg">
@@ -366,7 +412,7 @@
                coalesce(nullif(video.custom_title, ''), video.title) as title
         from content_platform_gzh_plan plan
         join content_platform_gzh_plan_video video on plan.id = video.plan_id
-        where video.video_id = #{videoId} and plan.`status` = 1
+        where video.video_id = #{videoId} and plan.`status` = 1 and video.status = 1
     </select>
 
     <select id="getQwPlanIllegalVideoList"
@@ -374,7 +420,7 @@
         select plan.create_account_id as account_id, plan.type, video.video_id, '企微' as channel, video.title
         from content_platform_qw_plan plan
         join content_platform_qw_plan_video video on plan.id = video.plan_id
-        where video.video_id = #{videoId} and plan.`status` = 1
+        where video.video_id = #{videoId} and plan.`status` = 1 and video.status = 1
     </select>
 
     <select id="getUploadVideoCount" resultType="java.lang.Integer">
@@ -408,5 +454,39 @@
         where video_id = #{videoId}
     </update>
 
+    <delete id="deleteContentPlatformVideoAccountRel">
+        delete from content_platform_video_account_rel where dt = #{dt}
+    </delete>
+
+    <insert id="batchInsertContentPlatformVideoAccountRel">
+        insert into content_platform_video_account_rel (dt, account_id, video_id, sim_score, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dt}, #{item.accountId}, #{item.videoId}, #{item.simScore}, #{item.createTimestamp})
+        </foreach>
+    </insert>
+
+    <select id="getVideoTagList"
+            resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoTag">
+        select *
+        from content_platform_video_tag
+        where dt = #{dt} and video_id in
+        <foreach collection="videoIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        and (platform = 1 or account_id = #{accountId} or type = #{type} or channel = #{channel})
+    </select>
+
+    <delete id="deleteContentPlatformVideoTag">
+        delete from content_platform_video_tag where dt = #{dt}
+    </delete>
+
+    <insert id="batchInsertContentPlatformVideoTag">
+        insert into content_platform_video_tag (dt, account_id, video_id, platform, type, channel, tag, create_timestamp)
+        values
+        <foreach collection="records" item="item" separator=",">
+            (#{item.dt}, #{item.accountId}, #{item.videoId}, #{item.platform}, #{item.type}, #{item.channel}, #{item.tag}, #{item.createTimestamp})
+        </foreach>
+    </insert>
 
 </mapper>

+ 3 - 1
api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

@@ -76,7 +76,9 @@
 <!--        <table tableName="content_platform_illegal_video" domainObjectName="ContentPlatformIllegalVideo" alias=""/>-->
 <!--        <table tableName="content_platform_illegal_msg" domainObjectName="ContentPlatformIllegalMsg" alias=""/>-->
 <!--        <table tableName="content_platform_pq_account_rel" domainObjectName="ContentPlatformPqAccountRel" alias=""/>-->
-        <table tableName="content_platform_upload_video" domainObjectName="ContentPlatformUploadVideo" alias=""/>
+<!--        <table tableName="content_platform_upload_video" domainObjectName="ContentPlatformUploadVideo" alias=""/>-->
+<!--        <table tableName="content_platform_video_account_rel" domainObjectName="ContentPlatformVideoAccountRel" alias=""/>-->
+        <table tableName="content_platform_video_tag" domainObjectName="ContentPlatformVideoTag" alias=""/>
     </context>
 
 </generatorConfiguration>