Quellcode durchsuchen

Merge branch '20250408-wyp-contentPlatform' into test

wangyunpeng vor 3 Monaten
Ursprung
Commit
84155215e1
19 geänderte Dateien mit 846 neuen und 212 gelöschten Zeilen
  1. 57 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java
  2. 106 0
      api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java
  3. 2 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java
  4. 6 6
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStat.java
  5. 24 24
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStatExample.java
  6. 23 12
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java
  7. 128 48
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java
  8. 6 6
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStat.java
  9. 24 24
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatExample.java
  10. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanItemVO.java
  11. 32 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanVideoContentItemVO.java
  12. 0 6
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java
  13. 6 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java
  14. 192 4
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java
  15. 39 19
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  16. 14 14
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhDataStatMapper.xml
  17. 45 30
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml
  18. 14 14
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatMapper.xml
  19. 127 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

+ 57 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.java

@@ -0,0 +1,57 @@
+package com.tzld.piaoquan.api.dao.mapper.contentplatform.ext;
+
+import com.tzld.piaoquan.api.model.param.contentplatform.GzhDatastatListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.QwDatastatListParam;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface ContentPlatformDataStatMapperExt {
+
+    int getGzhAccountDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformGzhDataStat> getGzhAccountDatastatList(@Param("param") GzhDatastatListParam param,
+                                                               @Param("createAccountId") Long createAccountId,
+                                                               @Param("offset") int offset,
+                                                               @Param("pageSize") Integer pageSize);
+
+    int getGzhTotalDatastatCount(@Param("param") GzhDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformGzhDataStat> getGzhTotalDatastatList(@Param("param") GzhDatastatListParam param,
+                                                             @Param("createAccountId") Long createAccountId,
+                                                             @Param("offset") int offset,
+                                                             @Param("pageSize") Integer pageSize);
+
+    int getQwRootSourceIdDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformQwDataStat> getQwRootSourceIdDatastatList(@Param("param") QwDatastatListParam param,
+                                                                  @Param("createAccountId") Long createAccountId,
+                                                                  @Param("offset") int offset,
+                                                                  @Param("pageSize") Integer pageSize);
+
+    int getQwTotalDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformQwDataStat> getQwTotalDatastatList(@Param("param") QwDatastatListParam param,
+                                                           @Param("createAccountId") Long createAccountId,
+                                                           @Param("offset") int offset,
+                                                           @Param("pageSize") Integer pageSize);
+
+    int getQwSceneDatastatCount(@Param("param") QwDatastatListParam param,
+                                @Param("scene") Integer scene,
+                                @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformQwDataStat> getQwSceneDatastatList(@Param("param") QwDatastatListParam param,
+                                                           @Param("scene") Integer scene,
+                                                           @Param("createAccountId") Long createAccountId,
+                                                           @Param("offset") int offset,
+                                                           @Param("pageSize") Integer pageSize);
+
+    int getQwReplyDatastatCount(@Param("param") QwDatastatListParam param, @Param("createAccountId") Long createAccountId);
+
+    List<ContentPlatformQwDataStat> getReplyDatastatList(@Param("param") QwDatastatListParam param,
+                                                         @Param("createAccountId") Long createAccountId,
+                                                         @Param("offset") int offset,
+                                                         @Param("pageSize") Integer pageSize);
+}

+ 106 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java

@@ -0,0 +1,106 @@
+package com.tzld.piaoquan.api.job;
+
+import com.aliyun.odps.data.Record;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Component
+public class ContentPlatformDatastatJob {
+
+    @Autowired
+    private ContentPlatformPlanMapperExt planMapperExt;
+
+    @Autowired
+    private ContentPlatformVideoMapper videoMapper;
+
+    @XxlJob("syncContentPlatformGzhDatastatJob")
+    public ReturnT<String> syncContentPlatformGzhDatastatJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString();
+        long videoCount = getVideoCount(dt);
+        if (videoCount > 0) {
+            return ReturnT.SUCCESS;
+        }
+        String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideo> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformVideo item = new ContentPlatformVideo();
+                Long videoId = Long.parseLong((String) record.get(0));
+                String category = (String) record.get(1);
+                String title = (String) record.get(2);
+                String videoUrl = (String) record.get(3);
+                Double score = Double.parseDouble((String) record.get(4));
+                item.setDt(dt);
+                item.setVideoId(videoId);
+                item.setCategory(category);
+                item.setTitle(title);
+                item.setVideo(videoUrl);
+                item.setScore(score);
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private long getVideoCount(String dt) {
+        ContentPlatformVideoExample example = new ContentPlatformVideoExample();
+        example.createCriteria().andDtEqualTo(dt);
+        return videoMapper.countByExample(example);
+    }
+
+    @XxlJob("syncContentPlatformQwDatastatJob")
+    public ReturnT<String> syncContentPlatformQwDatastatJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString();
+        long videoCount = getVideoCount(dt);
+        if (videoCount > 0) {
+            return ReturnT.SUCCESS;
+        }
+        String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideo> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformVideo item = new ContentPlatformVideo();
+                Long videoId = Long.parseLong((String) record.get(0));
+                String category = (String) record.get(1);
+                String title = (String) record.get(2);
+                String videoUrl = (String) record.get(3);
+                Double score = Double.parseDouble((String) record.get(4));
+                item.setDt(dt);
+                item.setVideoId(videoId);
+                item.setCategory(category);
+                item.setTitle(title);
+                item.setVideo(videoUrl);
+                item.setScore(score);
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+}

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java

@@ -1,6 +1,6 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
-import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
+import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanVideoContentItemVO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -22,5 +22,5 @@ public class GzhPlanSaveParam {
     private Integer publishStage;
 
     @ApiModelProperty(value = "视频列表")
-    private List<VideoContentItemVO> videoList;
+    private List<GzhPlanVideoContentItemVO> videoList;
 }

+ 6 - 6
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStat.java

@@ -11,7 +11,7 @@ public class ContentPlatformGzhDataStat {
 
     private Integer firstLevelCount;
 
-    private Double socre;
+    private Double score;
 
     private Long createTimestamp;
 
@@ -55,12 +55,12 @@ public class ContentPlatformGzhDataStat {
         this.firstLevelCount = firstLevelCount;
     }
 
-    public Double getSocre() {
-        return socre;
+    public Double getScore() {
+        return score;
     }
 
-    public void setSocre(Double socre) {
-        this.socre = socre;
+    public void setScore(Double score) {
+        this.score = score;
     }
 
     public Long getCreateTimestamp() {
@@ -82,7 +82,7 @@ public class ContentPlatformGzhDataStat {
         sb.append(", accountId=").append(accountId);
         sb.append(", fansIncreaseCount=").append(fansIncreaseCount);
         sb.append(", firstLevelCount=").append(firstLevelCount);
-        sb.append(", socre=").append(socre);
+        sb.append(", score=").append(score);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");
         return sb.toString();

+ 24 - 24
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhDataStatExample.java

@@ -425,63 +425,63 @@ public class ContentPlatformGzhDataStatExample {
             return (Criteria) this;
         }
 
-        public Criteria andSocreIsNull() {
-            addCriterion("socre is null");
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
             return (Criteria) this;
         }
 
-        public Criteria andSocreIsNotNull() {
-            addCriterion("socre is not null");
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
             return (Criteria) this;
         }
 
-        public Criteria andSocreEqualTo(Double value) {
-            addCriterion("socre =", value, "socre");
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotEqualTo(Double value) {
-            addCriterion("socre <>", value, "socre");
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreGreaterThan(Double value) {
-            addCriterion("socre >", value, "socre");
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreGreaterThanOrEqualTo(Double value) {
-            addCriterion("socre >=", value, "socre");
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreLessThan(Double value) {
-            addCriterion("socre <", value, "socre");
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreLessThanOrEqualTo(Double value) {
-            addCriterion("socre <=", value, "socre");
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreIn(List<Double> values) {
-            addCriterion("socre in", values, "socre");
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotIn(List<Double> values) {
-            addCriterion("socre not in", values, "socre");
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreBetween(Double value1, Double value2) {
-            addCriterion("socre between", value1, value2, "socre");
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotBetween(Double value1, Double value2) {
-            addCriterion("socre not between", value1, value2, "socre");
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
             return (Criteria) this;
         }
 

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

@@ -9,11 +9,13 @@ public class ContentPlatformGzhPlanVideo {
 
     private String title;
 
-    private Integer titleIsUpdate;
+    private String customTitle;
 
     private String cover;
 
-    private Integer coverIsUpdate;
+    private String customCover;
+
+    private Integer customCoverType;
 
     private String video;
 
@@ -53,12 +55,12 @@ public class ContentPlatformGzhPlanVideo {
         this.title = title;
     }
 
-    public Integer getTitleIsUpdate() {
-        return titleIsUpdate;
+    public String getCustomTitle() {
+        return customTitle;
     }
 
-    public void setTitleIsUpdate(Integer titleIsUpdate) {
-        this.titleIsUpdate = titleIsUpdate;
+    public void setCustomTitle(String customTitle) {
+        this.customTitle = customTitle;
     }
 
     public String getCover() {
@@ -69,12 +71,20 @@ public class ContentPlatformGzhPlanVideo {
         this.cover = cover;
     }
 
-    public Integer getCoverIsUpdate() {
-        return coverIsUpdate;
+    public String getCustomCover() {
+        return customCover;
+    }
+
+    public void setCustomCover(String customCover) {
+        this.customCover = customCover;
+    }
+
+    public Integer getCustomCoverType() {
+        return customCoverType;
     }
 
-    public void setCoverIsUpdate(Integer coverIsUpdate) {
-        this.coverIsUpdate = coverIsUpdate;
+    public void setCustomCoverType(Integer customCoverType) {
+        this.customCoverType = customCoverType;
     }
 
     public String getVideo() {
@@ -111,9 +121,10 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", planId=").append(planId);
         sb.append(", videoId=").append(videoId);
         sb.append(", title=").append(title);
-        sb.append(", titleIsUpdate=").append(titleIsUpdate);
+        sb.append(", customTitle=").append(customTitle);
         sb.append(", cover=").append(cover);
-        sb.append(", coverIsUpdate=").append(coverIsUpdate);
+        sb.append(", customCover=").append(customCover);
+        sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);

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

@@ -365,63 +365,73 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIsNull() {
-            addCriterion("title_is_update is null");
+        public Criteria andCustomTitleIsNull() {
+            addCriterion("custom_title is null");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIsNotNull() {
-            addCriterion("title_is_update is not null");
+        public Criteria andCustomTitleIsNotNull() {
+            addCriterion("custom_title is not null");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateEqualTo(Integer value) {
-            addCriterion("title_is_update =", value, "titleIsUpdate");
+        public Criteria andCustomTitleEqualTo(String value) {
+            addCriterion("custom_title =", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotEqualTo(Integer value) {
-            addCriterion("title_is_update <>", value, "titleIsUpdate");
+        public Criteria andCustomTitleNotEqualTo(String value) {
+            addCriterion("custom_title <>", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateGreaterThan(Integer value) {
-            addCriterion("title_is_update >", value, "titleIsUpdate");
+        public Criteria andCustomTitleGreaterThan(String value) {
+            addCriterion("custom_title >", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateGreaterThanOrEqualTo(Integer value) {
-            addCriterion("title_is_update >=", value, "titleIsUpdate");
+        public Criteria andCustomTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("custom_title >=", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateLessThan(Integer value) {
-            addCriterion("title_is_update <", value, "titleIsUpdate");
+        public Criteria andCustomTitleLessThan(String value) {
+            addCriterion("custom_title <", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateLessThanOrEqualTo(Integer value) {
-            addCriterion("title_is_update <=", value, "titleIsUpdate");
+        public Criteria andCustomTitleLessThanOrEqualTo(String value) {
+            addCriterion("custom_title <=", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIn(List<Integer> values) {
-            addCriterion("title_is_update in", values, "titleIsUpdate");
+        public Criteria andCustomTitleLike(String value) {
+            addCriterion("custom_title like", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotIn(List<Integer> values) {
-            addCriterion("title_is_update not in", values, "titleIsUpdate");
+        public Criteria andCustomTitleNotLike(String value) {
+            addCriterion("custom_title not like", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateBetween(Integer value1, Integer value2) {
-            addCriterion("title_is_update between", value1, value2, "titleIsUpdate");
+        public Criteria andCustomTitleIn(List<String> values) {
+            addCriterion("custom_title in", values, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotBetween(Integer value1, Integer value2) {
-            addCriterion("title_is_update not between", value1, value2, "titleIsUpdate");
+        public Criteria andCustomTitleNotIn(List<String> values) {
+            addCriterion("custom_title not in", values, "customTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleBetween(String value1, String value2) {
+            addCriterion("custom_title between", value1, value2, "customTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleNotBetween(String value1, String value2) {
+            addCriterion("custom_title not between", value1, value2, "customTitle");
             return (Criteria) this;
         }
 
@@ -495,63 +505,133 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIsNull() {
-            addCriterion("cover_is_update is null");
+        public Criteria andCustomCoverIsNull() {
+            addCriterion("custom_cover is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIsNotNull() {
+            addCriterion("custom_cover is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverEqualTo(String value) {
+            addCriterion("custom_cover =", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotEqualTo(String value) {
+            addCriterion("custom_cover <>", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverGreaterThan(String value) {
+            addCriterion("custom_cover >", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverGreaterThanOrEqualTo(String value) {
+            addCriterion("custom_cover >=", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLessThan(String value) {
+            addCriterion("custom_cover <", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLessThanOrEqualTo(String value) {
+            addCriterion("custom_cover <=", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLike(String value) {
+            addCriterion("custom_cover like", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotLike(String value) {
+            addCriterion("custom_cover not like", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIn(List<String> values) {
+            addCriterion("custom_cover in", values, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotIn(List<String> values) {
+            addCriterion("custom_cover not in", values, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverBetween(String value1, String value2) {
+            addCriterion("custom_cover between", value1, value2, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotBetween(String value1, String value2) {
+            addCriterion("custom_cover not between", value1, value2, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverTypeIsNull() {
+            addCriterion("custom_cover_type is null");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIsNotNull() {
-            addCriterion("cover_is_update is not null");
+        public Criteria andCustomCoverTypeIsNotNull() {
+            addCriterion("custom_cover_type is not null");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateEqualTo(Integer value) {
-            addCriterion("cover_is_update =", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeEqualTo(Integer value) {
+            addCriterion("custom_cover_type =", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotEqualTo(Integer value) {
-            addCriterion("cover_is_update <>", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotEqualTo(Integer value) {
+            addCriterion("custom_cover_type <>", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateGreaterThan(Integer value) {
-            addCriterion("cover_is_update >", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeGreaterThan(Integer value) {
+            addCriterion("custom_cover_type >", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateGreaterThanOrEqualTo(Integer value) {
-            addCriterion("cover_is_update >=", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("custom_cover_type >=", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateLessThan(Integer value) {
-            addCriterion("cover_is_update <", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeLessThan(Integer value) {
+            addCriterion("custom_cover_type <", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateLessThanOrEqualTo(Integer value) {
-            addCriterion("cover_is_update <=", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("custom_cover_type <=", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIn(List<Integer> values) {
-            addCriterion("cover_is_update in", values, "coverIsUpdate");
+        public Criteria andCustomCoverTypeIn(List<Integer> values) {
+            addCriterion("custom_cover_type in", values, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotIn(List<Integer> values) {
-            addCriterion("cover_is_update not in", values, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotIn(List<Integer> values) {
+            addCriterion("custom_cover_type not in", values, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateBetween(Integer value1, Integer value2) {
-            addCriterion("cover_is_update between", value1, value2, "coverIsUpdate");
+        public Criteria andCustomCoverTypeBetween(Integer value1, Integer value2) {
+            addCriterion("custom_cover_type between", value1, value2, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotBetween(Integer value1, Integer value2) {
-            addCriterion("cover_is_update not between", value1, value2, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("custom_cover_type not between", value1, value2, "customCoverType");
             return (Criteria) this;
         }
 

+ 6 - 6
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStat.java

@@ -9,7 +9,7 @@ public class ContentPlatformQwDataStat {
 
     private Integer firstLevelCount;
 
-    private Double socre;
+    private Double score;
 
     private Long createTimestamp;
 
@@ -45,12 +45,12 @@ public class ContentPlatformQwDataStat {
         this.firstLevelCount = firstLevelCount;
     }
 
-    public Double getSocre() {
-        return socre;
+    public Double getScore() {
+        return score;
     }
 
-    public void setSocre(Double socre) {
-        this.socre = socre;
+    public void setScore(Double score) {
+        this.score = score;
     }
 
     public Long getCreateTimestamp() {
@@ -71,7 +71,7 @@ public class ContentPlatformQwDataStat {
         sb.append(", dateStr=").append(dateStr);
         sb.append(", rootSourceId=").append(rootSourceId);
         sb.append(", firstLevelCount=").append(firstLevelCount);
-        sb.append(", socre=").append(socre);
+        sb.append(", score=").append(score);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");
         return sb.toString();

+ 24 - 24
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwDataStatExample.java

@@ -375,63 +375,63 @@ public class ContentPlatformQwDataStatExample {
             return (Criteria) this;
         }
 
-        public Criteria andSocreIsNull() {
-            addCriterion("socre is null");
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
             return (Criteria) this;
         }
 
-        public Criteria andSocreIsNotNull() {
-            addCriterion("socre is not null");
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
             return (Criteria) this;
         }
 
-        public Criteria andSocreEqualTo(Double value) {
-            addCriterion("socre =", value, "socre");
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotEqualTo(Double value) {
-            addCriterion("socre <>", value, "socre");
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreGreaterThan(Double value) {
-            addCriterion("socre >", value, "socre");
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreGreaterThanOrEqualTo(Double value) {
-            addCriterion("socre >=", value, "socre");
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreLessThan(Double value) {
-            addCriterion("socre <", value, "socre");
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreLessThanOrEqualTo(Double value) {
-            addCriterion("socre <=", value, "socre");
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreIn(List<Double> values) {
-            addCriterion("socre in", values, "socre");
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotIn(List<Double> values) {
-            addCriterion("socre not in", values, "socre");
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreBetween(Double value1, Double value2) {
-            addCriterion("socre between", value1, value2, "socre");
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
             return (Criteria) this;
         }
 
-        public Criteria andSocreNotBetween(Double value1, Double value2) {
-            addCriterion("socre not between", value1, value2, "socre");
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
             return (Criteria) this;
         }
 

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanItemVO.java

@@ -24,7 +24,7 @@ public class GzhPlanItemVO {
     private Integer videoCount;
 
     @ApiModelProperty(value = "视频列表")
-    private List<VideoContentItemVO> videoList;
+    private List<GzhPlanVideoContentItemVO> videoList;
 
     @ApiModelProperty(value = "标题")
     private List<String> title;

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

@@ -0,0 +1,32 @@
+package com.tzld.piaoquan.api.model.vo.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class GzhPlanVideoContentItemVO {
+
+    @ApiModelProperty(value = "id")
+    private Long videoId;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "自定义标题")
+    private String customTitle;
+
+    @ApiModelProperty(value = "封面")
+    private String cover;
+
+    @ApiModelProperty(value = "自定义封面")
+    private String customCover;
+
+    @ApiModelProperty(value = "自定义封面类型 1视频桢 2自己上传")
+    private Integer customCoverType;
+
+    @ApiModelProperty(value = "视频url")
+    private String video;
+
+    @ApiModelProperty(value = "传播效率")
+    private Double score;
+}

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

@@ -12,15 +12,9 @@ public class VideoContentItemVO {
     @ApiModelProperty(value = "标题")
     private String title;
 
-    @ApiModelProperty(value = "标题是否修改 0-未修改 1-已修改")
-    private Integer titleIsEdit;
-
     @ApiModelProperty(value = "封面")
     private String cover;
 
-    @ApiModelProperty(value = "封面是否修改 0-未修改 1-已修改")
-    private Integer coverIsEdit;
-
     @ApiModelProperty(value = "视频url")
     private String video;
 

+ 6 - 2
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java

@@ -1,8 +1,7 @@
 package com.tzld.piaoquan.api.service.contentplatform;
 
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
@@ -28,4 +27,9 @@ public interface ContentPlatformPlanService {
     List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId);
 
     List<ContentPlatformGzhPlanVideo> getGzhPlanVideoListByCooperateAccountId(String ghId);
+
+    List<ContentPlatformQwPlan> getQwPlanListByRootSourceIds(List<String> rootSourceIds);
+
+    List<ContentPlatformQwPlanVideo> getQwPlanVideoListByPlanIds(List<Long> planIds);
+
 }

+ 192 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformDatastatServiceImpl.java

@@ -1,26 +1,214 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformDataStatMapperExt;
+import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.GzhDatastatListParam;
 import com.tzld.piaoquan.api.model.param.contentplatform.QwDatastatListParam;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhDatastatItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.QwDatastatItemVO;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformDatastatService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
-import lombok.Data;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.List;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class ContentPlatformDatastatServiceImpl implements ContentPlatformDatastatService {
+
+    @Autowired
+    ContentPlatformDataStatMapperExt dataStatMapperExt;
+    @Autowired
+    ContentPlatformCooperateAccountService cooperateAccountService;
+    @Autowired
+    ContentPlatformPlanService planService;
+
     @Override
     public Page<GzhDatastatItemVO> gzhDatastatList(GzhDatastatListParam param) {
-        return null;
+        switch (param.getType()) {
+            case 0:
+                return gzhTotalDatastatList(param);
+            case 1:
+                return gzhAccountDatastatList(param);
+            default:
+                return gzhAccountDatastatList(param);
+        }
+    }
+
+    private Page<GzhDatastatItemVO> gzhTotalDatastatList(GzhDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getGzhTotalDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getGzhTotalDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private Page<GzhDatastatItemVO> gzhAccountDatastatList(GzhDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<GzhDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getGzhAccountDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformGzhDataStat> datastatList = dataStatMapperExt.getGzhAccountDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<GzhDatastatItemVO> list = buildGzhDatastatItemVOList(param.getType(), datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private List<GzhDatastatItemVO> buildGzhDatastatItemVOList(Integer type, List<ContentPlatformGzhDataStat> datastatList) {
+        if (CollectionUtils.isEmpty(datastatList)) {
+            return null;
+        }
+        Map<Long, ContentPlatformGzhAccount> accountMap = new HashMap<>();
+        if (type != 0) {
+            List<Long> accountIds = datastatList.stream().map(ContentPlatformGzhDataStat::getAccountId).distinct().collect(Collectors.toList());
+            List<ContentPlatformGzhAccount> accountList = cooperateAccountService.getAccountListByIds(accountIds);
+            accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId, a -> a));
+        }
+        List<GzhDatastatItemVO> result = new ArrayList<>();
+        for (ContentPlatformGzhDataStat datastat : datastatList) {
+            GzhDatastatItemVO vo = new GzhDatastatItemVO();
+            vo.setDateStr(datastat.getDateStr());
+            ContentPlatformGzhAccount account = accountMap.get(datastat.getAccountId());
+            if (Objects.nonNull(account)) {
+                vo.setName(account.getName());
+            }
+            vo.setFansIncreaseCount(datastat.getFansIncreaseCount());
+            vo.setFirstLevel(datastat.getFirstLevelCount());
+            vo.setScore(datastat.getScore());
+            if (Objects.nonNull(vo.getFansIncreaseCount()) && vo.getFansIncreaseCount() > 0) {
+                vo.setOpenRate(vo.getFirstLevel() / (double) vo.getFansIncreaseCount());
+            }
+            result.add(vo);
+        }
+        return result;
     }
 
     @Override
     public Page<QwDatastatItemVO> qwDatastatList(QwDatastatListParam param) {
-        return null;
+        switch (param.getType()) {
+            case 0:
+                return qwTotalDatastatList(param);
+            case 1:
+                return qwSceneDatastatList(param, 0);
+            case 2:
+                return qwSceneDatastatList(param, 1);
+            case 3:
+                return qwReplyDatastatList(param);
+            case 4:
+                return qwRootSourceIdDatastatList(param);
+            default:
+                return qwRootSourceIdDatastatList(param);
+        }
+    }
+
+    private Page<QwDatastatItemVO> qwTotalDatastatList(QwDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<QwDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getQwTotalDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformQwDataStat> datastatList = dataStatMapperExt.getQwTotalDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<QwDatastatItemVO> list = buildQwRootSourceIdDatastatItemVOList(datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private Page<QwDatastatItemVO> qwSceneDatastatList(QwDatastatListParam param, Integer scene) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<QwDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getQwSceneDatastatCount(param, scene, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformQwDataStat> datastatList = dataStatMapperExt.getQwSceneDatastatList(param, scene,
+                user.getId(), offset, param.getPageSize());
+        List<QwDatastatItemVO> list = buildQwRootSourceIdDatastatItemVOList(datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private Page<QwDatastatItemVO> qwReplyDatastatList(QwDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<QwDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getQwReplyDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformQwDataStat> datastatList = dataStatMapperExt.getReplyDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<QwDatastatItemVO> list = buildQwRootSourceIdDatastatItemVOList(datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private Page<QwDatastatItemVO> qwRootSourceIdDatastatList(QwDatastatListParam param) {
+        ContentPlatformAccount user = LoginUserContext.getUser();
+        Page<QwDatastatItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = dataStatMapperExt.getQwRootSourceIdDatastatCount(param, user.getId());
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformQwDataStat> datastatList = dataStatMapperExt.getQwRootSourceIdDatastatList(param,
+                user.getId(), offset, param.getPageSize());
+        List<QwDatastatItemVO> list = buildQwRootSourceIdDatastatItemVOList(datastatList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private List<QwDatastatItemVO> buildQwRootSourceIdDatastatItemVOList(List<ContentPlatformQwDataStat> datastatList) {
+        if (CollectionUtils.isEmpty(datastatList)) {
+            return null;
+        }
+        List<String> rootSourceIds = datastatList.stream().map(ContentPlatformQwDataStat::getRootSourceId).distinct().collect(Collectors.toList());
+        List<ContentPlatformQwPlan> qwPlanList = planService.getQwPlanListByRootSourceIds(rootSourceIds);
+        Map<String, Long> qwPlanMap = qwPlanList.stream().collect(Collectors.toMap(ContentPlatformQwPlan::getRootSourceId, ContentPlatformQwPlan::getId));
+        List<Long> planIds = qwPlanList.stream().map(ContentPlatformQwPlan::getId).distinct().collect(Collectors.toList());
+        List<ContentPlatformQwPlanVideo> qwPlanVideoList = planService.getQwPlanVideoListByPlanIds(planIds);
+        Map<Long, List<ContentPlatformQwPlanVideo>> qwPlanVideoMap = qwPlanVideoList.stream().collect(Collectors.groupingBy(ContentPlatformQwPlanVideo::getPlanId));
+        List<QwDatastatItemVO> result = new ArrayList<>();
+        for (ContentPlatformQwDataStat datastat : datastatList) {
+            QwDatastatItemVO vo = new QwDatastatItemVO();
+            vo.setDateStr(datastat.getDateStr());
+            vo.setScore(datastat.getScore());
+            Long planId = qwPlanMap.get(datastat.getRootSourceId());
+            if (Objects.nonNull(planId)) {
+                List<ContentPlatformQwPlanVideo> planVideoList = qwPlanVideoMap.get(planId);
+                if (CollectionUtils.isNotEmpty(planVideoList)) {
+                    vo.setVideoId(planVideoList.get(0).getVideoId());
+                    vo.setTitle(planVideoList.get(0).getTitle());
+                }
+            }
+            result.add(vo);
+        }
+        return result;
     }
 
     @Override

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

@@ -3,15 +3,14 @@ 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.exception.CommonException;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanMapper;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanVideoMapper;
-import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformQwPlanVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
 import com.tzld.piaoquan.api.model.vo.GhDetailVo;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
+import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanVideoContentItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
 import com.tzld.piaoquan.api.remote.AigcApiService;
@@ -35,6 +34,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.*;
 import java.util.function.Function;
@@ -51,12 +51,16 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private ContentPlatformGzhPlanVideoMapper gzhPlanVideoMapper;
     @Autowired
+    private ContentPlatformQwPlanMapper qwPlanMapper;
+    @Autowired
     private ContentPlatformQwPlanVideoMapper qwPlanVideoMapper;
     @Autowired
     private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
     @Autowired
     private CgiReplyBucketDataMapperExt cgiReplyBucketDataMapperExt;
     @Autowired
+    private ContentPlatformVideoMapper contentPlatformVideoMapper;
+    @Autowired
     private ContentPlatformCooperateAccountService cooperateAccountService;
     @Autowired
     private GhDetailService ghDetailService;
@@ -110,14 +114,15 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 List<String> titleList = videoListByPlanId.stream().map(ContentPlatformGzhPlanVideo::getTitle)
                         .collect(Collectors.toList());
                 planItemVO.setTitle(titleList);
-                List<VideoContentItemVO> videoVOList = new ArrayList<>();
+                List<GzhPlanVideoContentItemVO> videoVOList = new ArrayList<>();
                 for (ContentPlatformGzhPlanVideo video : videoListByPlanId) {
-                    VideoContentItemVO videoItemVO = new VideoContentItemVO();
+                    GzhPlanVideoContentItemVO videoItemVO = new GzhPlanVideoContentItemVO();
                     videoItemVO.setVideoId(video.getVideoId());
                     videoItemVO.setTitle(video.getTitle());
-                    videoItemVO.setTitleIsEdit(video.getTitleIsUpdate());
+                    videoItemVO.setCustomTitle(video.getCustomTitle());
                     videoItemVO.setCover(video.getCover());
-                    videoItemVO.setCoverIsEdit(video.getCoverIsUpdate());
+                    videoItemVO.setCustomCover(video.getCustomCover());
+                    videoItemVO.setCustomCoverType(video.getCustomCoverType());
                     videoItemVO.setVideo(video.getVideo());
                     videoVOList.add(videoItemVO);
                 }
@@ -153,7 +158,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         gzhPlan.setPublishStage(param.getPublishStage());
         gzhPlan.setUpdateTimestamp(now);
         // 更新gh_detail
-        List<Long> videoIds = param.getVideoList().stream().map(VideoContentItemVO::getVideoId).collect(Collectors.toList());
+        List<Long> videoIds = param.getVideoList().stream().map(GzhPlanVideoContentItemVO::getVideoId).collect(Collectors.toList());
         updateGhDetail(account, videoIds);
         // 更新cgi_reply_bucket_data
         updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
@@ -174,10 +179,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
     }
 
-    private void updateCgiReplyBucketData(String ghId, List<VideoContentItemVO> videoList) {
-        for (VideoContentItemVO video : videoList) {
-            if ((Objects.isNull(video.getTitleIsEdit()) || video.getTitleIsEdit() == 0)
-                    && (Objects.isNull(video.getCoverIsEdit()) || video.getCoverIsEdit() == 0)) {
+    private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemVO> videoList) {
+        for (GzhPlanVideoContentItemVO video : videoList) {
+            if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
                 continue;
             }
             CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
@@ -190,7 +194,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             String existsCover = dataList.get(0).getCoverUrl();
             String coverSuffix = existsCover.substring(existsCover.indexOf("/watermark"));
             cgiReplyBucketDataMapperExt.updateBucketDataTitleCoverByGhId(ghId, video.getVideoId(),
-                    video.getTitle(), video.getCover() + coverSuffix);
+                    video.getCustomTitle(), video.getCustomCover() + coverSuffix);
         }
     }
 
@@ -204,22 +208,24 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
             }
         }
-        for (VideoContentItemVO vo : param.getVideoList()) {
+        for (GzhPlanVideoContentItemVO vo : param.getVideoList()) {
             if (existsVideoIds.contains(vo.getVideoId())) {
                 ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCustomTitle(vo.getCustomTitle());
                 item.setCover(vo.getCover());
-                item.setCoverIsUpdate(vo.getCoverIsEdit());
-                gzhPlanVideoMapper.updateByPrimaryKeySelective(item);
+                item.setCustomCover(vo.getCustomCover());
+                item.setCustomCoverType(vo.getCustomCoverType());
+                gzhPlanVideoMapper.updateByPrimaryKey(item);
             } else {
                 ContentPlatformGzhPlanVideo item = new ContentPlatformGzhPlanVideo();
                 item.setPlanId(id);
                 item.setVideoId(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCustomTitle(vo.getCustomTitle());
                 item.setCover(vo.getCover());
-                item.setCoverIsUpdate(vo.getCoverIsEdit());
+                item.setCustomCover(vo.getCustomCover());
+                item.setCustomCoverType(vo.getCustomCoverType());
                 item.setVideo(vo.getVideo());
                 item.setCreateAccountId(loginAccountId);
                 item.setCreateTimestamp(System.currentTimeMillis());
@@ -403,4 +409,18 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return planMapperExt.getGzhPlanVideoListByCooperateAccountId(ghId);
     }
 
+    @Override
+    public List<ContentPlatformQwPlan> getQwPlanListByRootSourceIds(List<String> rootSourceIds) {
+        ContentPlatformQwPlanExample example = new ContentPlatformQwPlanExample();
+        example.createCriteria().andRootSourceIdIn(rootSourceIds);
+        return qwPlanMapper.selectByExample(example);
+    }
+
+    @Override
+    public List<ContentPlatformQwPlanVideo> getQwPlanVideoListByPlanIds(List<Long> planIds) {
+        ContentPlatformQwPlanVideoExample example = new ContentPlatformQwPlanVideoExample();
+        example.createCriteria().andPlanIdIn(planIds);
+        return qwPlanVideoMapper.selectByExample(example);
+    }
+
 }

+ 14 - 14
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhDataStatMapper.xml

@@ -7,7 +7,7 @@
     <result column="account_id" jdbcType="BIGINT" property="accountId" />
     <result column="fans_increase_count" jdbcType="INTEGER" property="fansIncreaseCount" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
-    <result column="socre" jdbcType="DOUBLE" property="socre" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -69,7 +69,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, account_id, fans_increase_count, first_level_count, socre, create_timestamp
+    id, date_str, account_id, fans_increase_count, first_level_count, score, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStatExample" resultMap="BaseResultMap">
     select
@@ -106,10 +106,10 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
     insert into content_platform_gzh_datastat (id, date_str, account_id, 
-      fans_increase_count, first_level_count, socre, 
+      fans_increase_count, first_level_count, score, 
       create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{accountId,jdbcType=BIGINT}, 
-      #{fansIncreaseCount,jdbcType=INTEGER}, #{firstLevelCount,jdbcType=INTEGER}, #{socre,jdbcType=DOUBLE}, 
+      #{fansIncreaseCount,jdbcType=INTEGER}, #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, 
       #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
@@ -130,8 +130,8 @@
       <if test="firstLevelCount != null">
         first_level_count,
       </if>
-      <if test="socre != null">
-        socre,
+      <if test="score != null">
+        score,
       </if>
       <if test="createTimestamp != null">
         create_timestamp,
@@ -153,8 +153,8 @@
       <if test="firstLevelCount != null">
         #{firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="socre != null">
-        #{socre,jdbcType=DOUBLE},
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
       </if>
       <if test="createTimestamp != null">
         #{createTimestamp,jdbcType=BIGINT},
@@ -185,8 +185,8 @@
       <if test="record.firstLevelCount != null">
         first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="record.socre != null">
-        socre = #{record.socre,jdbcType=DOUBLE},
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
       </if>
       <if test="record.createTimestamp != null">
         create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
@@ -203,7 +203,7 @@
       account_id = #{record.accountId,jdbcType=BIGINT},
       fans_increase_count = #{record.fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
-      socre = #{record.socre,jdbcType=DOUBLE},
+      score = #{record.score,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -224,8 +224,8 @@
       <if test="firstLevelCount != null">
         first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="socre != null">
-        socre = #{socre,jdbcType=DOUBLE},
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
       </if>
       <if test="createTimestamp != null">
         create_timestamp = #{createTimestamp,jdbcType=BIGINT},
@@ -239,7 +239,7 @@
       account_id = #{accountId,jdbcType=BIGINT},
       fans_increase_count = #{fansIncreaseCount,jdbcType=INTEGER},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
-      socre = #{socre,jdbcType=DOUBLE},
+      score = #{score,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 45 - 30
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml

@@ -6,9 +6,10 @@
     <result column="plan_id" jdbcType="BIGINT" property="planId" />
     <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="title" jdbcType="VARCHAR" property="title" />
-    <result column="title_is_update" jdbcType="INTEGER" property="titleIsUpdate" />
+    <result column="custom_title" jdbcType="VARCHAR" property="customTitle" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
-    <result column="cover_is_update" jdbcType="INTEGER" property="coverIsUpdate" />
+    <result column="custom_cover" jdbcType="VARCHAR" property="customCover" />
+    <result column="custom_cover_type" jdbcType="INTEGER" property="customCoverType" />
     <result column="video" jdbcType="VARCHAR" property="video" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
@@ -72,8 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, plan_id, video_id, title, title_is_update, cover, cover_is_update, video, create_account_id, 
-    create_timestamp
+    id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
+    video, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -110,13 +111,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     insert into content_platform_gzh_plan_video (id, plan_id, video_id, 
-      title, title_is_update, cover, 
-      cover_is_update, video, create_account_id, 
-      create_timestamp)
+      title, custom_title, cover, 
+      custom_cover, custom_cover_type, video, 
+      create_account_id, create_timestamp)
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
-      #{title,jdbcType=VARCHAR}, #{titleIsUpdate,jdbcType=INTEGER}, #{cover,jdbcType=VARCHAR}, 
-      #{coverIsUpdate,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, 
-      #{createTimestamp,jdbcType=BIGINT})
+      #{title,jdbcType=VARCHAR}, #{customTitle,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
+      #{customCover,jdbcType=VARCHAR}, #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, 
+      #{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
@@ -133,14 +134,17 @@
       <if test="title != null">
         title,
       </if>
-      <if test="titleIsUpdate != null">
-        title_is_update,
+      <if test="customTitle != null">
+        custom_title,
       </if>
       <if test="cover != null">
         cover,
       </if>
-      <if test="coverIsUpdate != null">
-        cover_is_update,
+      <if test="customCover != null">
+        custom_cover,
+      </if>
+      <if test="customCoverType != null">
+        custom_cover_type,
       </if>
       <if test="video != null">
         video,
@@ -165,14 +169,17 @@
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
-      <if test="titleIsUpdate != null">
-        #{titleIsUpdate,jdbcType=INTEGER},
+      <if test="customTitle != null">
+        #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         #{cover,jdbcType=VARCHAR},
       </if>
-      <if test="coverIsUpdate != null">
-        #{coverIsUpdate,jdbcType=INTEGER},
+      <if test="customCover != null">
+        #{customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="customCoverType != null">
+        #{customCoverType,jdbcType=INTEGER},
       </if>
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
@@ -206,14 +213,17 @@
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
-      <if test="record.titleIsUpdate != null">
-        title_is_update = #{record.titleIsUpdate,jdbcType=INTEGER},
+      <if test="record.customTitle != null">
+        custom_title = #{record.customTitle,jdbcType=VARCHAR},
       </if>
       <if test="record.cover != null">
         cover = #{record.cover,jdbcType=VARCHAR},
       </if>
-      <if test="record.coverIsUpdate != null">
-        cover_is_update = #{record.coverIsUpdate,jdbcType=INTEGER},
+      <if test="record.customCover != null">
+        custom_cover = #{record.customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="record.customCoverType != null">
+        custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       </if>
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
@@ -235,9 +245,10 @@
       plan_id = #{record.planId,jdbcType=BIGINT},
       video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
-      title_is_update = #{record.titleIsUpdate,jdbcType=INTEGER},
+      custom_title = #{record.customTitle,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
-      cover_is_update = #{record.coverIsUpdate,jdbcType=INTEGER},
+      custom_cover = #{record.customCover,jdbcType=VARCHAR},
+      custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
@@ -257,14 +268,17 @@
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
-      <if test="titleIsUpdate != null">
-        title_is_update = #{titleIsUpdate,jdbcType=INTEGER},
+      <if test="customTitle != null">
+        custom_title = #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         cover = #{cover,jdbcType=VARCHAR},
       </if>
-      <if test="coverIsUpdate != null">
-        cover_is_update = #{coverIsUpdate,jdbcType=INTEGER},
+      <if test="customCover != null">
+        custom_cover = #{customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="customCoverType != null">
+        custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       </if>
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
@@ -283,9 +297,10 @@
     set plan_id = #{planId,jdbcType=BIGINT},
       video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
-      title_is_update = #{titleIsUpdate,jdbcType=INTEGER},
+      custom_title = #{customTitle,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
-      cover_is_update = #{coverIsUpdate,jdbcType=INTEGER},
+      custom_cover = #{customCover,jdbcType=VARCHAR},
+      custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}

+ 14 - 14
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwDataStatMapper.xml

@@ -6,7 +6,7 @@
     <result column="date_str" jdbcType="VARCHAR" property="dateStr" />
     <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
     <result column="first_level_count" jdbcType="INTEGER" property="firstLevelCount" />
-    <result column="socre" jdbcType="DOUBLE" property="socre" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
   <sql id="Example_Where_Clause">
@@ -68,7 +68,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, date_str, root_source_id, first_level_count, socre, create_timestamp
+    id, date_str, root_source_id, first_level_count, score, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStatExample" resultMap="BaseResultMap">
     select
@@ -105,10 +105,10 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
     insert into content_platform_qw_datastat (id, date_str, root_source_id, 
-      first_level_count, socre, create_timestamp
+      first_level_count, score, create_timestamp
       )
     values (#{id,jdbcType=BIGINT}, #{dateStr,jdbcType=VARCHAR}, #{rootSourceId,jdbcType=VARCHAR}, 
-      #{firstLevelCount,jdbcType=INTEGER}, #{socre,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
+      #{firstLevelCount,jdbcType=INTEGER}, #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
@@ -126,8 +126,8 @@
       <if test="firstLevelCount != null">
         first_level_count,
       </if>
-      <if test="socre != null">
-        socre,
+      <if test="score != null">
+        score,
       </if>
       <if test="createTimestamp != null">
         create_timestamp,
@@ -146,8 +146,8 @@
       <if test="firstLevelCount != null">
         #{firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="socre != null">
-        #{socre,jdbcType=DOUBLE},
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
       </if>
       <if test="createTimestamp != null">
         #{createTimestamp,jdbcType=BIGINT},
@@ -175,8 +175,8 @@
       <if test="record.firstLevelCount != null">
         first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="record.socre != null">
-        socre = #{record.socre,jdbcType=DOUBLE},
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
       </if>
       <if test="record.createTimestamp != null">
         create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
@@ -192,7 +192,7 @@
       date_str = #{record.dateStr,jdbcType=VARCHAR},
       root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
       first_level_count = #{record.firstLevelCount,jdbcType=INTEGER},
-      socre = #{record.socre,jdbcType=DOUBLE},
+      score = #{record.score,jdbcType=DOUBLE},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -210,8 +210,8 @@
       <if test="firstLevelCount != null">
         first_level_count = #{firstLevelCount,jdbcType=INTEGER},
       </if>
-      <if test="socre != null">
-        socre = #{socre,jdbcType=DOUBLE},
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
       </if>
       <if test="createTimestamp != null">
         create_timestamp = #{createTimestamp,jdbcType=BIGINT},
@@ -224,7 +224,7 @@
     set date_str = #{dateStr,jdbcType=VARCHAR},
       root_source_id = #{rootSourceId,jdbcType=VARCHAR},
       first_level_count = #{firstLevelCount,jdbcType=INTEGER},
-      socre = #{socre,jdbcType=DOUBLE},
+      score = #{score,jdbcType=DOUBLE},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>

+ 127 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDataStatMapperExt.xml

@@ -0,0 +1,127 @@
+<?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.ext.ContentPlatformDataStatMapperExt">
+
+  <select id="getGzhAccountDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_gzh_datastat cpgd
+    join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+    where cpgza.create_account_id = #{createAccountId}
+    <if test="param.accountId!= null and param.accountId!= ''">
+      and cpgza.account_id = #{param.accountId}
+    </if>
+  </select>
+
+  <select id="getGzhAccountDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
+    select cpgd.*
+    from content_platform_gzh_datastat cpgd
+    join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+    where cpgza.create_account_id = #{createAccountId}
+    <if test="param.accountId!= null and param.accountId!= ''">
+      and cpgza.account_id = #{param.accountId}
+    </if>
+    order by cpgd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+  <select id="getGzhTotalDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_gzh_datastat cpgd
+    join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+    where cpgza.create_account_id = #{createAccountId}
+    group by cpgd.date_str
+  </select>
+
+  <select id="getGzhTotalDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhDataStat">
+    select date_str, sum(fans_increase_count) as fans_increase_count, sum(first_level_count) as first_level_count,
+           avg(score) as score
+    from content_platform_gzh_datastat cpgd
+    join content_platform_gzh_account cpgza on cpgd.account_id = cpgza.id
+    where cpgza.create_account_id = #{createAccountId}
+    group by cpgd.date_str
+    order by cpgd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+  <select id="getQwRootSourceIdDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_qw_datastat cpqd
+    join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+  </select>
+
+  <select id="getQwRootSourceIdDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
+    select cpqd.*
+    from content_platform_qw_datastat cpqd
+    join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+    order by cpqd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+  <select id="getQwTotalDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_qw_datastat cpqd
+     join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+    group by cpqd.date_str
+  </select>
+
+  <select id="getQwTotalDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
+    select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
+    from content_platform_qw_datastat cpqd
+           join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+    group by cpqd.date_str
+    order by cpqd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+  <select id="getQwSceneDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_qw_datastat cpqd
+     join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+      and cpqp.scene = #{scene}
+    group by cpqd.date_str
+  </select>
+
+  <select id="getQwSceneDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
+    select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
+    from content_platform_qw_datastat cpqd
+     join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+      and cpqp.scene = #{scene}
+    group by cpqd.date_str
+    order by cpqd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+  <select id="getQwReplyDatastatCount" resultType="java.lang.Integer">
+    select count(1)
+    from content_platform_qw_datastat cpqd
+     join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+      and cpqp.type = 0
+    group by cpqd.date_str
+  </select>
+
+  <select id="getReplyDatastatList"
+          resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwDataStat">
+    select cpqd.date_str, sum(cpqd.first_level_count) as first_level_count, avg(cpqd.score) as score
+    from content_platform_qw_datastat cpqd
+     join content_platform_qw_plan cpqp on cpqp.root_source_id = cpqd.root_source_id
+    where cpqp.create_account_id = #{createAccountId}
+      and cpqp.type = 0
+    group by cpqd.date_str
+    order by cpqd.date_str desc
+    limit #{offset}, #{pageSize}
+  </select>
+
+
+</mapper>