Просмотр исходного кода

Merge branch 'master' into cooperation_video_candidate_pool_improved_lld_0509

刘立冬 1 день назад
Родитель
Сommit
9f18a4551a

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

@@ -205,7 +205,6 @@ public class ContentPlatformDemandVideoJob {
                 String matchVideoFilter = demandItem.getString("matchVideoFilter");
                 String matchSort = demandItem.getString("matchSort");
                 Double sceneSumRov = demandItem.getDouble("sceneSumRov");
-                Long matchExposurePv = demandItem.getLong("matchExposurePv");
 
                 JSONArray matchedVideos = demandItem.getJSONArray("matchedVideos");
                 if (matchedVideos == null || matchedVideos.isEmpty()) {
@@ -241,7 +240,6 @@ public class ContentPlatformDemandVideoJob {
                     demandVideo.setVisitUv(visitUv);
                     demandVideo.setUvRatio(uvRatio);
                     demandVideo.setTotalRov(totalRov);
-                    demandVideo.setMatchExposurePv(matchExposurePv);
                     demandVideo.setOnlineAction(onlineAction != null ? onlineAction : "");
                     demandVideo.setChannelLevel3(channelLevel3 != null ? channelLevel3 : "");
                     demandVideo.setMatchMethod(matchMethod != null ? matchMethod : "");
@@ -255,6 +253,9 @@ public class ContentPlatformDemandVideoJob {
                     demandVideo.setRov(videoItem.getDouble("rov"));
                     demandVideo.setMatchText(videoItem.getString("text") != null ? videoItem.getString("text") : "");
                     demandVideo.setExperimentId(videoItem.getString("experimentId"));
+                    demandVideo.setMatchExposurePv(videoItem.getLong("matchExposurePv"));
+                    demandVideo.setMatchHeadSingleReturnRate(videoItem.getDouble("matchHeadSingleReturnRate"));
+                    demandVideo.setMatchHeadDistributionSingleReturnRate(videoItem.getDouble("matchHeadDistributionSingleReturnRate"));
                     demandVideo.setStatus(1);
                     demandVideo.setCreateTimestamp(now);
                     if (Objects.isNull(demandVideo.getRov()) || demandVideo.getRov() == 0.0) {

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

@@ -99,6 +99,10 @@ public class ContentPlatformDemandVideo {
 
     private Long matchExposurePv;
 
+    private Double matchHeadSingleReturnRate;
+
+    private Double matchHeadDistributionSingleReturnRate;
+
     public Long getId() {
         return id;
     }
@@ -491,6 +495,22 @@ public class ContentPlatformDemandVideo {
         this.matchExposurePv = matchExposurePv;
     }
 
+    public Double getMatchHeadSingleReturnRate() {
+        return matchHeadSingleReturnRate;
+    }
+
+    public void setMatchHeadSingleReturnRate(Double matchHeadSingleReturnRate) {
+        this.matchHeadSingleReturnRate = matchHeadSingleReturnRate;
+    }
+
+    public Double getMatchHeadDistributionSingleReturnRate() {
+        return matchHeadDistributionSingleReturnRate;
+    }
+
+    public void setMatchHeadDistributionSingleReturnRate(Double matchHeadDistributionSingleReturnRate) {
+        this.matchHeadDistributionSingleReturnRate = matchHeadDistributionSingleReturnRate;
+    }
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
@@ -546,6 +566,8 @@ public class ContentPlatformDemandVideo {
         sb.append(", updateTimestamp=").append(updateTimestamp);
         sb.append(", category=").append(category);
         sb.append(", matchExposurePv=").append(matchExposurePv);
+        sb.append(", matchHeadSingleReturnRate=").append(matchHeadSingleReturnRate);
+        sb.append(", matchHeadDistributionSingleReturnRate=").append(matchHeadDistributionSingleReturnRate);
         sb.append("]");
         return sb.toString();
     }

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

@@ -3394,6 +3394,126 @@ public class ContentPlatformDemandVideoExample {
             addCriterion("match_exposure_pv not between", value1, value2, "matchExposurePv");
             return (Criteria) this;
         }
+
+        public Criteria andMatchHeadSingleReturnRateIsNull() {
+            addCriterion("match_head_single_return_rate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateIsNotNull() {
+            addCriterion("match_head_single_return_rate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateEqualTo(Double value) {
+            addCriterion("match_head_single_return_rate =", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateNotEqualTo(Double value) {
+            addCriterion("match_head_single_return_rate <>", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateGreaterThan(Double value) {
+            addCriterion("match_head_single_return_rate >", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateGreaterThanOrEqualTo(Double value) {
+            addCriterion("match_head_single_return_rate >=", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateLessThan(Double value) {
+            addCriterion("match_head_single_return_rate <", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateLessThanOrEqualTo(Double value) {
+            addCriterion("match_head_single_return_rate <=", value, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateIn(List<Double> values) {
+            addCriterion("match_head_single_return_rate in", values, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateNotIn(List<Double> values) {
+            addCriterion("match_head_single_return_rate not in", values, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateBetween(Double value1, Double value2) {
+            addCriterion("match_head_single_return_rate between", value1, value2, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadSingleReturnRateNotBetween(Double value1, Double value2) {
+            addCriterion("match_head_single_return_rate not between", value1, value2, "matchHeadSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateIsNull() {
+            addCriterion("match_head_distribution_single_return_rate is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateIsNotNull() {
+            addCriterion("match_head_distribution_single_return_rate is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateEqualTo(Double value) {
+            addCriterion("match_head_distribution_single_return_rate =", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateNotEqualTo(Double value) {
+            addCriterion("match_head_distribution_single_return_rate <>", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateGreaterThan(Double value) {
+            addCriterion("match_head_distribution_single_return_rate >", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateGreaterThanOrEqualTo(Double value) {
+            addCriterion("match_head_distribution_single_return_rate >=", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateLessThan(Double value) {
+            addCriterion("match_head_distribution_single_return_rate <", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateLessThanOrEqualTo(Double value) {
+            addCriterion("match_head_distribution_single_return_rate <=", value, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateIn(List<Double> values) {
+            addCriterion("match_head_distribution_single_return_rate in", values, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateNotIn(List<Double> values) {
+            addCriterion("match_head_distribution_single_return_rate not in", values, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateBetween(Double value1, Double value2) {
+            addCriterion("match_head_distribution_single_return_rate between", value1, value2, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchHeadDistributionSingleReturnRateNotBetween(Double value1, Double value2) {
+            addCriterion("match_head_distribution_single_return_rate not between", value1, value2, "matchHeadDistributionSingleReturnRate");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 30 - 8
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/BuckStrategyV1.java

@@ -10,9 +10,11 @@ import com.tzld.piaoquan.api.model.bo.*;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankData;
 import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
 import com.tzld.piaoquan.api.model.po.GhDetailExt;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo;
 import com.tzld.piaoquan.api.model.vo.VideoCharacteristicVO;
 import com.tzld.piaoquan.api.service.GhDetailService;
 import com.tzld.piaoquan.api.service.VideoMultiService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
 import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
 import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
@@ -85,6 +87,8 @@ public class BuckStrategyV1 implements ReplyStrategyService {
     private VideoMultiService videoMultiService;
     @Autowired
     private GhDetailService ghDetailService;
+    @Autowired
+    private ContentPlatformPlanService contentPlatformPlanService;
 
     @Autowired
     private RedisUtils redisUtils;
@@ -105,9 +109,10 @@ public class BuckStrategyV1 implements ReplyStrategyService {
             // 1 处理文章--算法引擎--排序文章数据
 //            getWenzhangData();
             // 2 处理小程序--读取离线数据表--获取策略排序小程序数据
-            List<CgiReplyBucketData> smallDataCgiReplyList = readStrategyOrderSmallData(keyedSet, bucketDataParam);
+            Map<Long, String> videoTestIdMap = new HashMap<>();
+            List<CgiReplyBucketData> smallDataCgiReplyList = readStrategyOrderSmallData(keyedSet, bucketDataParam, videoTestIdMap);
             // 2.1 获取小程序落地页地址 http调用
-            smallDataCgiReplyList = setSmallPageUrl(smallDataCgiReplyList);
+            smallDataCgiReplyList = setSmallPageUrl(smallDataCgiReplyList, videoTestIdMap);
             log.info(JSON.toJSONString(smallDataCgiReplyList));
             // 3 入库读表
             insertSmallData(smallDataCgiReplyList, keyedSet, bucketDataParam);
@@ -351,7 +356,8 @@ public class BuckStrategyV1 implements ReplyStrategyService {
         }
     }
 
-    private List<CgiReplyBucketData> setSmallPageUrl(List<CgiReplyBucketData> smallDataCgiReplyList) {
+    private List<CgiReplyBucketData> setSmallPageUrl(List<CgiReplyBucketData> smallDataCgiReplyList,
+                                                     Map<Long, String> videoTestIdMap) {
         if (CollectionUtils.isEmpty(smallDataCgiReplyList)) {
             return smallDataCgiReplyList;
         }
@@ -393,7 +399,7 @@ public class BuckStrategyV1 implements ReplyStrategyService {
             if (CollectionUtils.isEmpty(cgiReplyBucketData)) {
                 // 库里不存在,调用新生成
                 String response = touLiuHttpClient.sendAdFlowAddRequest(GET_SMALL_PAGE_URL, videoId, putScene, channel,
-                        "自动", "公众号", "自动回复小程序", "位置" + sort, ghId, null);
+                        "自动", "公众号", "自动回复小程序", "位置" + sort, ghId, videoTestIdMap.get(Long.valueOf(videoId)));
                 JSONObject jsonObject = JSON.parseObject(response);
                 if (jsonObject.getInteger("code").equals(0)) {
                     smallPageUrlDetail = jsonObject.getObject("data", SmallPageUrlDetail.class);
@@ -426,11 +432,12 @@ public class BuckStrategyV1 implements ReplyStrategyService {
     }
 
 
-    private List<CgiReplyBucketData> readStrategyOrderSmallData(Set<String> keyedSet, BucketDataParam bucketDataParam) {
+    private List<CgiReplyBucketData> readStrategyOrderSmallData(Set<String> keyedSet, BucketDataParam bucketDataParam,
+                                                                Map<Long, String> videoTestIdMap) {
         List<CgiReplyBucketData> result = new ArrayList<>();
         if (Objects.equals(StrategyStatusEnum.DEFAULT.status, bucketDataParam.getStrategyStatus())) {
             for (String key : keyedSet) {
-                List<CgiReplyBucketData> defaultData = getDefaultData(bucketDataParam, key);
+                List<CgiReplyBucketData> defaultData = getDefaultData(bucketDataParam, key, videoTestIdMap);
                 if (!CollectionUtils.isEmpty(defaultData)) {
                     result.addAll(defaultData);
                 }
@@ -448,7 +455,7 @@ public class BuckStrategyV1 implements ReplyStrategyService {
         } else if (Objects.equals(StrategyStatusEnum.MIXED_STRATEGY.status, bucketDataParam.getStrategyStatus())) {
             for (String key : keyedSet) {
                 if (key.equals(MANUAL)) {
-                    List<CgiReplyBucketData> defaultData = getDefaultData(bucketDataParam, key);
+                    List<CgiReplyBucketData> defaultData = getDefaultData(bucketDataParam, key, videoTestIdMap);
                     if (!CollectionUtils.isEmpty(defaultData)) {
                         result.addAll(defaultData);
                     }
@@ -467,7 +474,8 @@ public class BuckStrategyV1 implements ReplyStrategyService {
     }
 
 
-    private List<CgiReplyBucketData> getDefaultData(BucketDataParam bucketDataParam, String key) {
+    private List<CgiReplyBucketData> getDefaultData(BucketDataParam bucketDataParam, String key,
+                                                    Map<Long, String> videoTestIdMap) {
         List<CgiReplyBucketData> result = new ArrayList<>();
         if (CollectionUtils.isEmpty(bucketDataParam.getVideos()) && CollectionUtils.isEmpty(bucketDataParam.getMiniPageDatas())) {
             return result;
@@ -500,6 +508,9 @@ public class BuckStrategyV1 implements ReplyStrategyService {
             String batchId1 = UUID.randomUUID().toString();
             int totalSize1 = bucketDataParam.getMiniPageDatas().size();
             Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
+            List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = contentPlatformPlanService.getGzhPlanVideoListByCooperateAccountId(bucketDataParam.getGhId());
+            Map<Long, ContentPlatformGzhPlanVideo> gzhPlanVideoMap = gzhPlanVideoList.stream()
+                    .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, x -> x, (a, b) -> b));
             for (int i = 0; i < bucketDataParam.getMiniPageDatas().size(); i++) {
                 int sort = i + 1;
                 Long videoId = bucketDataParam.getVideos().get(i);
@@ -525,6 +536,10 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                                 "?x-oss-process=image/resize,m_fill,w_600,h_480,limit_0/format,jpg/watermark,image_eXNoL3BpYy93YXRlcm1hcmtlci9pY29uX3BsYXlfd2hpdGUucG5nP3gtb3NzLXByb2Nlc3M9aW1hZ2UvcmVzaXplLHdfMTQ0,g_center");
                     }
                 }
+                ContentPlatformGzhPlanVideo gzhPlanVideo = gzhPlanVideoMap.get(videoId);
+                if (Objects.nonNull(gzhPlanVideo) && Objects.nonNull(videoDetail)) {
+                    videoTestIdMap.put(gzhPlanVideo.getVideoId(), gzhPlanVideo.getExperimentId());
+                }
                 cgiReplyBucketData.setTitle(miniPageData.getTitle());
                 cgiReplyBucketData.setMiniPagePath(miniPageData.getPage());
                 cgiReplyBucketData.setMiniAppId(SMALL_APP_Id);
@@ -553,6 +568,9 @@ public class BuckStrategyV1 implements ReplyStrategyService {
             String batchId2 = UUID.randomUUID().toString();
             int totalSize2 = bucketDataParam.getVideos().size();
             Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
+            List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = contentPlatformPlanService.getGzhPlanVideoListByCooperateAccountId(bucketDataParam.getGhId());
+            Map<Long, ContentPlatformGzhPlanVideo> gzhPlanVideoMap = gzhPlanVideoList.stream()
+                    .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, x -> x, (a, b) -> b));
             for (int i = 0; i < bucketDataParam.getVideos().size(); i++) {
                 int sort = i + 1;
                 Long videoId = bucketDataParam.getVideos().get(i);
@@ -564,6 +582,10 @@ public class BuckStrategyV1 implements ReplyStrategyService {
                 cgiReplyBucketData.setGhId(bucketDataParam.getGhId());
                 cgiReplyBucketData.setMsgType(1);
                 VideoDetail videoDetail = videoDetailMap.get(videoId);
+                ContentPlatformGzhPlanVideo gzhPlanVideo = gzhPlanVideoMap.get(videoId);
+                if (Objects.nonNull(gzhPlanVideo) && Objects.nonNull(videoDetail)) {
+                    videoTestIdMap.put(gzhPlanVideo.getVideoId(), gzhPlanVideo.getExperimentId());
+                }
                 if (videoDetail != null && StringUtils.isNotEmpty(videoDetail.getCover())) {
                     cgiReplyBucketData.setCoverUrl(videoDetail.getCover());
                 }

+ 37 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformDemandVideoMapper.xml

@@ -51,6 +51,8 @@
     <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
     <result column="category" jdbcType="VARCHAR" property="category" />
     <result column="match_exposure_pv" jdbcType="BIGINT" property="matchExposurePv" />
+    <result column="match_head_single_return_rate" jdbcType="DOUBLE" property="matchHeadSingleReturnRate" />
+    <result column="match_head_distribution_single_return_rate" jdbcType="DOUBLE" property="matchHeadDistributionSingleReturnRate" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <where>
@@ -118,7 +120,7 @@
     crowd_count, video_count, visit_uv, uv_ratio, total_rov, match_experiment_id, match_method, 
     match_video_filter, match_sort, video_id, config_code, score, sim, rov, match_text, 
     title, cover, video, experiment_id, scene_sum_rov, `status`, create_timestamp, update_timestamp, 
-    category, match_exposure_pv
+    category, match_exposure_pv, match_head_single_return_rate, match_head_distribution_single_return_rate
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideoExample" resultMap="BaseResultMap">
     select
@@ -170,7 +172,8 @@
       title, cover, video, 
       experiment_id, scene_sum_rov, `status`, 
       create_timestamp, update_timestamp, category, 
-      match_exposure_pv)
+      match_exposure_pv, match_head_single_return_rate, 
+      match_head_distribution_single_return_rate)
     values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{onlineAction,jdbcType=VARCHAR}, 
       #{channelName,jdbcType=VARCHAR}, #{crowdSegment,jdbcType=VARCHAR}, #{channelLevel3,jdbcType=VARCHAR}, 
       #{demandId,jdbcType=VARCHAR}, #{crowdPackage,jdbcType=VARCHAR}, #{conversionTarget,jdbcType=VARCHAR}, 
@@ -187,7 +190,8 @@
       #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
       #{experimentId,jdbcType=VARCHAR}, #{sceneSumRov,jdbcType=DOUBLE}, #{status,jdbcType=INTEGER}, 
       #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}, #{category,jdbcType=VARCHAR}, 
-      #{matchExposurePv,jdbcType=BIGINT})
+      #{matchExposurePv,jdbcType=BIGINT}, #{matchHeadSingleReturnRate,jdbcType=DOUBLE}, 
+      #{matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
     insert into content_platform_demand_video
@@ -339,6 +343,12 @@
       <if test="matchExposurePv != null">
         match_exposure_pv,
       </if>
+      <if test="matchHeadSingleReturnRate != null">
+        match_head_single_return_rate,
+      </if>
+      <if test="matchHeadDistributionSingleReturnRate != null">
+        match_head_distribution_single_return_rate,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="id != null">
@@ -488,6 +498,12 @@
       <if test="matchExposurePv != null">
         #{matchExposurePv,jdbcType=BIGINT},
       </if>
+      <if test="matchHeadSingleReturnRate != null">
+        #{matchHeadSingleReturnRate,jdbcType=DOUBLE},
+      </if>
+      <if test="matchHeadDistributionSingleReturnRate != null">
+        #{matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideoExample" resultType="java.lang.Long">
@@ -646,6 +662,12 @@
       <if test="record.matchExposurePv != null">
         match_exposure_pv = #{record.matchExposurePv,jdbcType=BIGINT},
       </if>
+      <if test="record.matchHeadSingleReturnRate != null">
+        match_head_single_return_rate = #{record.matchHeadSingleReturnRate,jdbcType=DOUBLE},
+      </if>
+      <if test="record.matchHeadDistributionSingleReturnRate != null">
+        match_head_distribution_single_return_rate = #{record.matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -701,7 +723,9 @@
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT},
       category = #{record.category,jdbcType=VARCHAR},
-      match_exposure_pv = #{record.matchExposurePv,jdbcType=BIGINT}
+      match_exposure_pv = #{record.matchExposurePv,jdbcType=BIGINT},
+      match_head_single_return_rate = #{record.matchHeadSingleReturnRate,jdbcType=DOUBLE},
+      match_head_distribution_single_return_rate = #{record.matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -853,6 +877,12 @@
       <if test="matchExposurePv != null">
         match_exposure_pv = #{matchExposurePv,jdbcType=BIGINT},
       </if>
+      <if test="matchHeadSingleReturnRate != null">
+        match_head_single_return_rate = #{matchHeadSingleReturnRate,jdbcType=DOUBLE},
+      </if>
+      <if test="matchHeadDistributionSingleReturnRate != null">
+        match_head_distribution_single_return_rate = #{matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -905,7 +935,9 @@
       create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{updateTimestamp,jdbcType=BIGINT},
       category = #{category,jdbcType=VARCHAR},
-      match_exposure_pv = #{matchExposurePv,jdbcType=BIGINT}
+      match_exposure_pv = #{matchExposurePv,jdbcType=BIGINT},
+      match_head_single_return_rate = #{matchHeadSingleReturnRate,jdbcType=DOUBLE},
+      match_head_distribution_single_return_rate = #{matchHeadDistributionSingleReturnRate,jdbcType=DOUBLE}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 24 - 18
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDemandVideoMapperExt.xml

@@ -5,23 +5,26 @@
     <insert id="batchInsert" parameterType="java.util.List">
         INSERT INTO content_platform_demand_video
         (dt, channel_name, crowd_segment, dimension, point_type, standard_element, element_dimension,
-         category_name, category, demand_id, crowd_package, conversion_target, partner, account, scene_value,
-         demand_strategy, drive_dimension_time, demand_filter_sort_strategy, demand_type,
-         demand_content_id, demand_content_title, demand_content_topic,
-         crowd_count, video_count, visit_uv, uv_ratio, total_rov, online_action, match_experiment_id,
-         match_method, match_video_filter, match_sort,
-         video_id, config_code, score, sim, rov,
-         match_text, title, cover, video, experiment_id, scene_sum_rov, channel_level3, status, create_timestamp, update_timestamp, match_exposure_pv)
+        category_name, category, demand_id, crowd_package, conversion_target, partner, account, scene_value,
+        demand_strategy, drive_dimension_time, demand_filter_sort_strategy, demand_type,
+        demand_content_id, demand_content_title, demand_content_topic, crowd_count, video_count, visit_uv, uv_ratio,
+        total_rov, online_action, match_experiment_id, match_method, match_video_filter, match_sort,
+        video_id, config_code, score, sim, rov, match_text, title, cover, video, experiment_id, scene_sum_rov,
+        channel_level3, status, create_timestamp, update_timestamp,
+        match_exposure_pv, match_head_single_return_rate, match_head_distribution_single_return_rate)
         VALUES
         <foreach collection="list" item="item" separator=",">
-            (#{item.dt}, #{item.channelName}, #{item.crowdSegment}, #{item.dimension}, #{item.pointType}, #{item.standardElement}, #{item.elementDimension},
-             #{item.categoryName}, #{item.category}, #{item.demandId}, #{item.crowdPackage}, #{item.conversionTarget}, #{item.partner}, #{item.account}, #{item.sceneValue},
-             #{item.demandStrategy}, #{item.driveDimensionTime}, #{item.demandFilterSortStrategy}, #{item.demandType},
-             #{item.demandContentId}, #{item.demandContentTitle}, #{item.demandContentTopic},
-             #{item.crowdCount}, #{item.videoCount}, #{item.visitUv}, #{item.uvRatio}, #{item.totalRov}, #{item.onlineAction}, #{item.matchExperimentId},
-             #{item.matchMethod}, #{item.matchVideoFilter}, #{item.matchSort},
-             #{item.videoId}, #{item.configCode}, #{item.score}, #{item.sim}, #{item.rov},
-             #{item.matchText}, #{item.title}, #{item.cover}, #{item.video}, #{item.experimentId}, #{item.sceneSumRov}, #{item.channelLevel3}, #{item.status}, #{item.createTimestamp}, #{item.updateTimestamp}, #{item.matchExposurePv})
+            (#{item.dt}, #{item.channelName}, #{item.crowdSegment}, #{item.dimension}, #{item.pointType},
+            #{item.standardElement}, #{item.elementDimension}, #{item.categoryName}, #{item.category}, #{item.demandId},
+            #{item.crowdPackage}, #{item.conversionTarget}, #{item.partner}, #{item.account}, #{item.sceneValue},
+            #{item.demandStrategy}, #{item.driveDimensionTime}, #{item.demandFilterSortStrategy}, #{item.demandType},
+            #{item.demandContentId}, #{item.demandContentTitle}, #{item.demandContentTopic},
+            #{item.crowdCount}, #{item.videoCount}, #{item.visitUv}, #{item.uvRatio}, #{item.totalRov},
+            #{item.onlineAction}, #{item.matchExperimentId}, #{item.matchMethod}, #{item.matchVideoFilter}, #{item.matchSort},
+            #{item.videoId}, #{item.configCode}, #{item.score}, #{item.sim}, #{item.rov},
+            #{item.matchText}, #{item.title}, #{item.cover}, #{item.video}, #{item.experimentId}, #{item.sceneSumRov},
+            #{item.channelLevel3}, #{item.status}, #{item.createTimestamp}, #{item.updateTimestamp},
+            #{item.matchExposurePv}, #{item.matchHeadSingleReturnRate}, #{item.matchHeadDistributionSingleReturnRate})
         </foreach>
     </insert>
 
@@ -45,7 +48,8 @@
                crowd_count, video_count, visit_uv, uv_ratio, total_rov, online_action, match_experiment_id,
                match_method, match_video_filter, match_sort,
                video_id, config_code, score, sim, rov,
-               match_text, title, cover, video, experiment_id, scene_sum_rov, channel_level3, status, create_timestamp, update_timestamp, match_exposure_pv
+               match_text, title, cover, video, experiment_id, scene_sum_rov, channel_level3, status, create_timestamp, update_timestamp,
+               match_exposure_pv, match_head_single_return_rate, match_head_distribution_single_return_rate
         FROM content_platform_demand_video
         WHERE dt = #{dt} AND status = 1
         <if test="channelName != null and channelName != ''">
@@ -107,7 +111,8 @@
                crowd_count, video_count, visit_uv, uv_ratio, total_rov, online_action, match_experiment_id,
                match_method, match_video_filter, match_sort,
                video_id, config_code, score, sim, rov,
-               match_text, title, cover, video, experiment_id, scene_sum_rov, status, create_timestamp, update_timestamp, match_exposure_pv
+               match_text, title, cover, video, experiment_id, scene_sum_rov, status, create_timestamp, update_timestamp,
+               match_exposure_pv, match_head_single_return_rate, match_head_distribution_single_return_rate
         FROM content_platform_demand_video
         WHERE dt = #{dt} AND status = 1
         <if test="excludeCategories != null and excludeCategories.size() > 0">
@@ -172,7 +177,8 @@
                crowd_count, video_count, visit_uv, uv_ratio, total_rov, online_action, match_experiment_id,
                match_method, match_video_filter, match_sort,
                video_id, config_code, score, sim, rov,
-               match_text, title, cover, video, experiment_id, scene_sum_rov, status, create_timestamp, update_timestamp, match_exposure_pv
+               match_text, title, cover, video, experiment_id, scene_sum_rov, status, create_timestamp, update_timestamp,
+               match_exposure_pv, match_head_single_return_rate, match_head_distribution_single_return_rate
         FROM content_platform_demand_video
         WHERE dt = #{dt} AND status = 1
           AND channel_name = #{channelName}