Prechádzať zdrojové kódy

匹配视频增加曝光pv信息

wangyunpeng 6 dní pred
rodič
commit
399da3e5f4

+ 22 - 0
core/src/main/java/com/tzld/videoVector/job/ChannelDemandMatchJob.java

@@ -536,6 +536,7 @@ public class ChannelDemandMatchJob {
             row.setMatchScore(item.getScore());
             row.setMatchSim(item.getSim());
             row.setMatchRov(item.getRov());
+            row.setMatchExposurePv(extractExposurePv(item.getVideoDetail()));
             row.setMatchText(item.getText());
             row.setMatchStatus((short) 1); // 已匹配
             // 生成确定性实验ID:相同需求+相同视频 → 相同实验ID
@@ -607,6 +608,27 @@ public class ChannelDemandMatchJob {
         return (hash != null && hash.length() >= 16) ? hash.substring(0, 16) : "0000000000000000";
     }
 
+    /**
+     * 从 videoDetail Map 中提取分发曝光pv
+     */
+    private Long extractExposurePv(Map<String, Object> videoDetail) {
+        if (videoDetail == null) {
+            return null;
+        }
+        Object pvObj = videoDetail.get("分发曝光pv");
+        if (pvObj == null) {
+            return null;
+        }
+        try {
+            if (pvObj instanceof Number) {
+                return ((Number) pvObj).longValue();
+            }
+            return Long.parseLong(pvObj.toString());
+        } catch (NumberFormatException e) {
+            return null;
+        }
+    }
+
     private String nullToEmpty(String value) {
         return value == null ? "" : value;
     }

+ 36 - 0
core/src/main/java/com/tzld/videoVector/model/po/pgVector/ChannelDemandMatchResult.java

@@ -514,6 +514,17 @@ public class ChannelDemandMatchResult {
      */
     private Double sceneSumRov;
 
+    /**
+     * Database Column Remarks:
+     *   匹配曝光PV
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column channel_demand_match_result.match_exposure_pv
+     *
+     * @mbg.generated
+     */
+    private Long matchExposurePv;
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column channel_demand_match_result.id
@@ -1618,6 +1629,30 @@ public class ChannelDemandMatchResult {
         this.sceneSumRov = sceneSumRov;
     }
 
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column channel_demand_match_result.match_exposure_pv
+     *
+     * @return the value of channel_demand_match_result.match_exposure_pv
+     *
+     * @mbg.generated
+     */
+    public Long getMatchExposurePv() {
+        return matchExposurePv;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column channel_demand_match_result.match_exposure_pv
+     *
+     * @param matchExposurePv the value for channel_demand_match_result.match_exposure_pv
+     *
+     * @mbg.generated
+     */
+    public void setMatchExposurePv(Long matchExposurePv) {
+        this.matchExposurePv = matchExposurePv;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table channel_demand_match_result
@@ -1676,6 +1711,7 @@ public class ChannelDemandMatchResult {
         sb.append(", matchVideoFilter=").append(matchVideoFilter);
         sb.append(", matchSort=").append(matchSort);
         sb.append(", sceneSumRov=").append(sceneSumRov);
+        sb.append(", matchExposurePv=").append(matchExposurePv);
         sb.append("]");
         return sb.toString();
     }

+ 60 - 0
core/src/main/java/com/tzld/videoVector/model/po/pgVector/ChannelDemandMatchResultExample.java

@@ -3254,6 +3254,66 @@ public class ChannelDemandMatchResultExample {
             addCriterion("scene_sum_rov not between", value1, value2, "sceneSumRov");
             return (Criteria) this;
         }
+
+        public Criteria andMatchExposurePvIsNull() {
+            addCriterion("match_exposure_pv is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvIsNotNull() {
+            addCriterion("match_exposure_pv is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvEqualTo(Long value) {
+            addCriterion("match_exposure_pv =", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvNotEqualTo(Long value) {
+            addCriterion("match_exposure_pv <>", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvGreaterThan(Long value) {
+            addCriterion("match_exposure_pv >", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvGreaterThanOrEqualTo(Long value) {
+            addCriterion("match_exposure_pv >=", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvLessThan(Long value) {
+            addCriterion("match_exposure_pv <", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvLessThanOrEqualTo(Long value) {
+            addCriterion("match_exposure_pv <=", value, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvIn(List<Long> values) {
+            addCriterion("match_exposure_pv in", values, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvNotIn(List<Long> values) {
+            addCriterion("match_exposure_pv not in", values, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvBetween(Long value1, Long value2) {
+            addCriterion("match_exposure_pv between", value1, value2, "matchExposurePv");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchExposurePvNotBetween(Long value1, Long value2) {
+            addCriterion("match_exposure_pv not between", value1, value2, "matchExposurePv");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 20 - 5
core/src/main/resources/mapper/pgVector/ChannelDemandMatchResultMapper.xml

@@ -52,6 +52,7 @@
     <result column="match_video_filter" jdbcType="VARCHAR" property="matchVideoFilter" />
     <result column="match_sort" jdbcType="VARCHAR" property="matchSort" />
     <result column="scene_sum_rov" jdbcType="DOUBLE" property="sceneSumRov" />
+    <result column="match_exposure_pv" jdbcType="BIGINT" property="matchExposurePv" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -131,7 +132,7 @@
     partner, account, scene_value, demand_strategy, drive_dimension_time, demand_filter_sort_strategy, 
     demand_type, demand_content_id, demand_content_title, demand_content_topic, uv_ratio, 
     experiment_id, channel_level3, element_dimension, channel_median, match_method, match_video_filter, 
-    match_sort, scene_sum_rov
+    match_sort, scene_sum_rov, match_exposure_pv
   </sql>
   <select id="selectByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResultExample" resultMap="BaseResultMap">
     <!--
@@ -199,7 +200,7 @@
       demand_content_topic, uv_ratio, experiment_id, 
       channel_level3, element_dimension, channel_median, 
       match_method, match_video_filter, match_sort, 
-      scene_sum_rov)
+      scene_sum_rov, match_exposure_pv)
     values (#{configId,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR}, 
       #{crowdSegment,jdbcType=VARCHAR}, #{dimension,jdbcType=VARCHAR}, #{pointType,jdbcType=VARCHAR}, 
       #{standardElement,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR}, #{crowdCount,jdbcType=INTEGER}, 
@@ -215,7 +216,7 @@
       #{demandContentTopic,jdbcType=VARCHAR}, #{uvRatio,jdbcType=DOUBLE}, #{experimentId,jdbcType=VARCHAR}, 
       #{channelLevel3,jdbcType=VARCHAR}, #{elementDimension,jdbcType=VARCHAR}, #{channelMedian,jdbcType=DOUBLE}, 
       #{matchMethod,jdbcType=VARCHAR}, #{matchVideoFilter,jdbcType=VARCHAR}, #{matchSort,jdbcType=VARCHAR}, 
-      #{sceneSumRov,jdbcType=DOUBLE})
+      #{sceneSumRov,jdbcType=DOUBLE}, #{matchExposurePv,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResult" useGeneratedKeys="true">
     <!--
@@ -359,6 +360,9 @@
       <if test="sceneSumRov != null">
         scene_sum_rov,
       </if>
+      <if test="matchExposurePv != null">
+        match_exposure_pv,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="configId != null">
@@ -496,6 +500,9 @@
       <if test="sceneSumRov != null">
         #{sceneSumRov,jdbcType=DOUBLE},
       </if>
+      <if test="matchExposurePv != null">
+        #{matchExposurePv,jdbcType=BIGINT},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResultExample" resultType="java.lang.Long">
@@ -653,6 +660,9 @@
       <if test="record.sceneSumRov != null">
         scene_sum_rov = #{record.sceneSumRov,jdbcType=DOUBLE},
       </if>
+      <if test="record.matchExposurePv != null">
+        match_exposure_pv = #{record.matchExposurePv,jdbcType=BIGINT},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -709,7 +719,8 @@
       match_method = #{record.matchMethod,jdbcType=VARCHAR},
       match_video_filter = #{record.matchVideoFilter,jdbcType=VARCHAR},
       match_sort = #{record.matchSort,jdbcType=VARCHAR},
-      scene_sum_rov = #{record.sceneSumRov,jdbcType=DOUBLE}
+      scene_sum_rov = #{record.sceneSumRov,jdbcType=DOUBLE},
+      match_exposure_pv = #{record.matchExposurePv,jdbcType=BIGINT}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -856,6 +867,9 @@
       <if test="sceneSumRov != null">
         scene_sum_rov = #{sceneSumRov,jdbcType=DOUBLE},
       </if>
+      <if test="matchExposurePv != null">
+        match_exposure_pv = #{matchExposurePv,jdbcType=BIGINT},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -909,7 +923,8 @@
       match_method = #{matchMethod,jdbcType=VARCHAR},
       match_video_filter = #{matchVideoFilter,jdbcType=VARCHAR},
       match_sort = #{matchSort,jdbcType=VARCHAR},
-      scene_sum_rov = #{sceneSumRov,jdbcType=DOUBLE}
+      scene_sum_rov = #{sceneSumRov,jdbcType=DOUBLE},
+      match_exposure_pv = #{matchExposurePv,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

+ 4 - 4
core/src/main/resources/mapper/pgVector/ext/ChannelDemandMatchResultMapperExt.xml

@@ -7,8 +7,8 @@
       standard_element, category_name, crowd_count,
       video_count, visit_uv, total_rov,
       match_video_id, match_config_code, match_score,
-      match_sim, match_rov, match_text,
-      match_status, online_action, match_experiment_id,
+      match_sim, match_rov, match_exposure_pv,
+      match_text, match_status, online_action, match_experiment_id,
       demand_id, crowd_package, conversion_target,
       partner, account, scene_value,
       demand_strategy, drive_dimension_time, demand_filter_sort_strategy,
@@ -22,8 +22,8 @@
       #{item.standardElement,jdbcType=VARCHAR}, #{item.categoryName,jdbcType=VARCHAR}, #{item.crowdCount,jdbcType=INTEGER},
       #{item.videoCount,jdbcType=INTEGER}, #{item.visitUv,jdbcType=BIGINT}, #{item.totalRov,jdbcType=DOUBLE},
       #{item.matchVideoId,jdbcType=BIGINT}, #{item.matchConfigCode,jdbcType=VARCHAR}, #{item.matchScore,jdbcType=DOUBLE},
-      #{item.matchSim,jdbcType=DOUBLE}, #{item.matchRov,jdbcType=DOUBLE}, #{item.matchText,jdbcType=VARCHAR},
-      #{item.matchStatus,jdbcType=SMALLINT}, #{item.onlineAction,jdbcType=VARCHAR}, #{item.matchExperimentId,jdbcType=VARCHAR},
+      #{item.matchSim,jdbcType=DOUBLE}, #{item.matchRov,jdbcType=DOUBLE}, #{item.matchExposurePv,jdbcType=BIGINT},
+      #{item.matchText,jdbcType=VARCHAR}, #{item.matchStatus,jdbcType=SMALLINT}, #{item.onlineAction,jdbcType=VARCHAR}, #{item.matchExperimentId,jdbcType=VARCHAR},
       #{item.demandId,jdbcType=VARCHAR}, #{item.crowdPackage,jdbcType=VARCHAR}, #{item.conversionTarget,jdbcType=VARCHAR},
       #{item.partner,jdbcType=VARCHAR}, #{item.account,jdbcType=VARCHAR}, #{item.sceneValue,jdbcType=VARCHAR},
       #{item.demandStrategy,jdbcType=VARCHAR}, #{item.driveDimensionTime,jdbcType=VARCHAR}, #{item.demandFilterSortStrategy,jdbcType=VARCHAR},