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

增加 匹配手段、匹配视频 筛选、匹配 排序

wangyunpeng 1 день назад
Родитель
Сommit
d66177b252

+ 64 - 15
core/src/main/java/com/tzld/videoVector/job/ChannelDemandMatchJob.java

@@ -76,18 +76,48 @@ public class ChannelDemandMatchJob {
     private static final int MATCH_THREAD_POOL_SIZE = 5;
 
     /**
-     * 人群需求-场景 数据源策略标识
+     * 匹配手段:场景已看视频(来自维度统计表,不走向量召回)
      */
-    private static final String DIMENSION_STAT_STRATEGY = "人群需求-场景";
+    private static final String MATCH_METHOD_DIMENSION_STAT = "场景已看视频";
 
     /**
-     * 人群需求-场景 数据源的ROV阈值 (默认3%)
+     * 匹配手段:票圈推荐库(走向量召回)
+     */
+    private static final String MATCH_METHOD_RECOMMEND_LIB = "票圈推荐库";
+
+    /**
+     * 需求来源:优质相似(对应 demand_strategy 取值)
+     */
+    private static final String DEMAND_SOURCE_QUALITY_SIM = "优质相似";
+
+    // ============== 匹配结果默认值(固定文案) ==============
+
+    /** 匹配视频筛选-场景已看视频 */
+    private static final String VIDEO_FILTER_DIMENSION_STAT =
+            "总UV占比大于0.2%&全局视频pv>10000&全局rov >0.03&品类排除:节日祝福、早中晚好";
+    /** 匹配视频筛选-人群需求·票圈推荐库 */
+    private static final String VIDEO_FILTER_CROWD_RECOMMEND = "相似度>=0.7&7日rov > 0.02";
+    /** 匹配视频筛选-优质相似·票圈推荐库 */
+    private static final String VIDEO_FILTER_QUALITY_SIM_RECOMMEND = "相似度>=0.7&近7天rov>0.02";
+
+    /** 匹配排序-场景已看视频 */
+    private static final String SORT_DIMENSION_STAT =
+            "列表排序:\n" + "最近7日视频rov倒序";
+    /** 匹配排序-人群需求·票圈推荐库 */
+    private static final String SORT_CROWD_RECOMMEND =
+            "列表排序说明:\n" + "需求特征rov倒序&综合加权得分(相似性|rov)倒序";
+    /** 匹配排序-优质相似·票圈推荐库 */
+    private static final String SORT_QUALITY_SIM_RECOMMEND =
+            "列表排序说明:\n" + "需求特征rov倒序&综合加权得分(相似性|rov)倒序";
+
+    /**
+     * 匹配手段-场景已看视频 数据源的ROV阈值 (默认3%)
      */
     @Value("${channel.demand.dimension-stat.min-rov:0.03}")
     private double dimensionStatMinRov;
 
     /**
-     * 人群需求-场景 数据源的UV占比阈值 (默认0.2%)
+     * 匹配手段-场景已看视频 数据源的UV占比阈值 (默认0.2%)
      */
     @Value("${channel.demand.dimension-stat.min-uv-ratio:0.002}")
     private double dimensionStatMinUvRatio;
@@ -179,8 +209,8 @@ public class ChannelDemandMatchJob {
         // 1. 先清理该渠道+日期的历史数据(支持重跑)
         deleteExistingResults(config.getId(), dt);
 
-        // 如果是人群需求-场景数据源,走独立的处理逻辑(不需要向量召回)
-        if (DIMENSION_STAT_STRATEGY.equals(config.getDemandStrategy())) {
+        // 如果匹配手段为"场景已看视频",走独立的处理逻辑(不需要向量召回)
+        if (MATCH_METHOD_DIMENSION_STAT.equals(config.getMatchMethod())) {
             processDimensionStatSource(config, dt, totalDemands, totalMatched, totalFailed);
             return;
         }
@@ -330,6 +360,16 @@ public class ChannelDemandMatchJob {
         result.setChannelMedian(safeGetDouble(record, "渠道中位数"));
 
         result.setMatchStatus((short) 0); // 待匹配
+
+        // 向量召回路径:匹配手段固定为票圈推荐库;筛选/排序默认值按需求来源选择
+        result.setMatchMethod(MATCH_METHOD_RECOMMEND_LIB);
+        if (DEMAND_SOURCE_QUALITY_SIM.equals(result.getDemandStrategy())) {
+            result.setMatchVideoFilter(VIDEO_FILTER_QUALITY_SIM_RECOMMEND);
+            result.setMatchSort(SORT_QUALITY_SIM_RECOMMEND);
+        } else {
+            result.setMatchVideoFilter(VIDEO_FILTER_CROWD_RECOMMEND);
+            result.setMatchSort(SORT_CROWD_RECOMMEND);
+        }
         return result;
     }
 
@@ -512,6 +552,10 @@ public class ChannelDemandMatchJob {
         row.setVideoCount(demand.getVideoCount());
         row.setTotalRov(demand.getTotalRov());
         row.setChannelMedian(demand.getChannelMedian());
+        // 复制匹配手段/筛选/排序默认值
+        row.setMatchMethod(demand.getMatchMethod());
+        row.setMatchVideoFilter(demand.getMatchVideoFilter());
+        row.setMatchSort(demand.getMatchSort());
         return row;
     }
 
@@ -523,14 +567,14 @@ public class ChannelDemandMatchJob {
     }
 
     /**
-     * 处理人群需求-场景数据源:从dwd_channel_element_dimension_stat查询,直接入库(不需向量召回)
+     * 处理匹配手段-场景已看视频 数据源:从dwd_channel_element_dimension_stat查询,直接入库(不需向量召回)
      */
     private void processDimensionStatSource(ChannelDemandMatchConfig config, String dt,
                                             AtomicInteger totalDemands, AtomicInteger totalMatched, AtomicInteger totalFailed) {
-        log.info("开始处理人群需求-场景数据源, configId={}, dt={}", config.getId(), dt);
+        log.info("开始处理场景已看视频数据源, configId={}, dt={}", config.getId(), dt);
 
         String sql = buildDimensionStatSql(config, dt);
-        log.info("人群需求-场景ODPS SQL长度: {}", sql.length());
+        log.info("场景已看视频ODPS SQL长度: {}", sql.length());
 
         List<ChannelDemandMatchResult> results = new ArrayList<>();
 
@@ -539,7 +583,12 @@ public class ChannelDemandMatchJob {
                 ChannelDemandMatchResult result = new ChannelDemandMatchResult();
                 result.setConfigId(config.getId());
                 result.setDt(dt);
-                result.setDemandStrategy(DIMENSION_STAT_STRATEGY);
+                // 数据源差异由 config.match_method 区分;此处 demand_strategy 与配置保持一致(迁移后统一为"人群需求")
+                result.setDemandStrategy(config.getDemandStrategy());
+                // 匹配手段/筛选/排序 固定默认值(场景已看视频)
+                result.setMatchMethod(MATCH_METHOD_DIMENSION_STAT);
+                result.setMatchVideoFilter(VIDEO_FILTER_DIMENSION_STAT);
+                result.setMatchSort(SORT_DIMENSION_STAT);
 
                 // 需求维度字段
                 result.setChannelName(record.getString("渠道类"));
@@ -568,7 +617,7 @@ public class ChannelDemandMatchJob {
                     try {
                         result.setMatchVideoId(Long.parseLong(videoIdStr.trim()));
                     } catch (NumberFormatException e) {
-                        log.warn("人群需求-场景 videoid解析失败: {}", videoIdStr);
+                        log.warn("场景已看视频 videoid解析失败: {}", videoIdStr);
                         return;
                     }
                 } else {
@@ -590,11 +639,11 @@ public class ChannelDemandMatchJob {
                     results.add(result);
                 }
             } catch (Exception e) {
-                log.error("解析人群需求-场景ODPS记录失败: {}", e.getMessage());
+                log.error("解析场景已看视频ODPS记录失败: {}", e.getMessage());
             }
         });
 
-        log.info("人群需求-场景数据源查询到 {} 条记录", results.size());
+        log.info("场景已看视频数据源查询到 {} 条记录", results.size());
         totalDemands.addAndGet(results.size());
 
         if (results.isEmpty()) {
@@ -606,11 +655,11 @@ public class ChannelDemandMatchJob {
             resultMapperExt.batchInsert(partition);
         }
         totalMatched.addAndGet(results.size());
-        log.info("人群需求-场景数据源写入完成, 共 {} 条", results.size());
+        log.info("场景已看视频数据源写入完成, 共 {} 条", results.size());
     }
 
     /**
-     * 构造人群需求-场景数据源的ODPS SQL
+     * 构造匹配手段-场景已看视频 数据源的ODPS SQL
      * 查询loghubods.dwd_channel_element_dimension_stat,过滤rov>3%且uv占比>0.2%
      */
     private String buildDimensionStatSql(ChannelDemandMatchConfig config, String dt) {

+ 3 - 0
core/src/main/java/com/tzld/videoVector/model/param/ChannelDemandMatchQueryParam.java

@@ -50,6 +50,9 @@ public class ChannelDemandMatchQueryParam {
     /** 场景值,可选 */
     private String sceneValue;
 
+    /** 匹配手段(票圈推荐库/场景已看视频),可选 */
+    private String matchMethod;
+
     /** 页码(从1开始),默认1 */
     private Integer pageNum;
 

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

@@ -136,6 +136,17 @@ public class ChannelDemandMatchConfig {
      */
     private String filterTimeDimensions;
 
+    /**
+     * Database Column Remarks:
+     *   匹配手段: 票圈推荐库-通过向量召回匹配; 场景已看视频-从维度统计表直接匹配
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column channel_demand_match_config.match_method
+     *
+     * @mbg.generated
+     */
+    private String matchMethod;
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column channel_demand_match_config.id
@@ -424,6 +435,30 @@ public class ChannelDemandMatchConfig {
         this.filterTimeDimensions = filterTimeDimensions;
     }
 
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column channel_demand_match_config.match_method
+     *
+     * @return the value of channel_demand_match_config.match_method
+     *
+     * @mbg.generated
+     */
+    public String getMatchMethod() {
+        return matchMethod;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column channel_demand_match_config.match_method
+     *
+     * @param matchMethod the value for channel_demand_match_config.match_method
+     *
+     * @mbg.generated
+     */
+    public void setMatchMethod(String matchMethod) {
+        this.matchMethod = matchMethod;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table channel_demand_match_config
@@ -448,6 +483,7 @@ public class ChannelDemandMatchConfig {
         sb.append(", demandStrategy=").append(demandStrategy);
         sb.append(", filterDimensions=").append(filterDimensions);
         sb.append(", filterTimeDimensions=").append(filterTimeDimensions);
+        sb.append(", matchMethod=").append(matchMethod);
         sb.append("]");
         return sb.toString();
     }

+ 70 - 0
core/src/main/java/com/tzld/videoVector/model/po/pgVector/ChannelDemandMatchConfigExample.java

@@ -964,6 +964,76 @@ public class ChannelDemandMatchConfigExample {
             addCriterion("filter_time_dimensions not between", value1, value2, "filterTimeDimensions");
             return (Criteria) this;
         }
+
+        public Criteria andMatchMethodIsNull() {
+            addCriterion("match_method is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodIsNotNull() {
+            addCriterion("match_method is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodEqualTo(String value) {
+            addCriterion("match_method =", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotEqualTo(String value) {
+            addCriterion("match_method <>", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodGreaterThan(String value) {
+            addCriterion("match_method >", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodGreaterThanOrEqualTo(String value) {
+            addCriterion("match_method >=", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLessThan(String value) {
+            addCriterion("match_method <", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLessThanOrEqualTo(String value) {
+            addCriterion("match_method <=", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLike(String value) {
+            addCriterion("match_method like", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotLike(String value) {
+            addCriterion("match_method not like", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodIn(List<String> values) {
+            addCriterion("match_method in", values, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotIn(List<String> values) {
+            addCriterion("match_method not in", values, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodBetween(String value1, String value2) {
+            addCriterion("match_method between", value1, value2, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotBetween(String value1, String value2) {
+            addCriterion("match_method not between", value1, value2, "matchMethod");
+            return (Criteria) this;
+        }
     }
 
     /**

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

@@ -470,6 +470,39 @@ public class ChannelDemandMatchResult {
      */
     private Double channelMedian;
 
+    /**
+     * Database Column Remarks:
+     *   匹配手段
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column channel_demand_match_result.match_method
+     *
+     * @mbg.generated
+     */
+    private String matchMethod;
+
+    /**
+     * Database Column Remarks:
+     *   匹配视频筛选策略
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column channel_demand_match_result.match_video_filter
+     *
+     * @mbg.generated
+     */
+    private String matchVideoFilter;
+
+    /**
+     * Database Column Remarks:
+     *   匹配排序策略
+     *
+     * This field was generated by MyBatis Generator.
+     * This field corresponds to the database column channel_demand_match_result.match_sort
+     *
+     * @mbg.generated
+     */
+    private String matchSort;
+
     /**
      * This method was generated by MyBatis Generator.
      * This method returns the value of the database column channel_demand_match_result.id
@@ -1478,6 +1511,78 @@ public class ChannelDemandMatchResult {
         this.channelMedian = channelMedian;
     }
 
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column channel_demand_match_result.match_method
+     *
+     * @return the value of channel_demand_match_result.match_method
+     *
+     * @mbg.generated
+     */
+    public String getMatchMethod() {
+        return matchMethod;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column channel_demand_match_result.match_method
+     *
+     * @param matchMethod the value for channel_demand_match_result.match_method
+     *
+     * @mbg.generated
+     */
+    public void setMatchMethod(String matchMethod) {
+        this.matchMethod = matchMethod;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column channel_demand_match_result.match_video_filter
+     *
+     * @return the value of channel_demand_match_result.match_video_filter
+     *
+     * @mbg.generated
+     */
+    public String getMatchVideoFilter() {
+        return matchVideoFilter;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column channel_demand_match_result.match_video_filter
+     *
+     * @param matchVideoFilter the value for channel_demand_match_result.match_video_filter
+     *
+     * @mbg.generated
+     */
+    public void setMatchVideoFilter(String matchVideoFilter) {
+        this.matchVideoFilter = matchVideoFilter;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method returns the value of the database column channel_demand_match_result.match_sort
+     *
+     * @return the value of channel_demand_match_result.match_sort
+     *
+     * @mbg.generated
+     */
+    public String getMatchSort() {
+        return matchSort;
+    }
+
+    /**
+     * This method was generated by MyBatis Generator.
+     * This method sets the value of the database column channel_demand_match_result.match_sort
+     *
+     * @param matchSort the value for channel_demand_match_result.match_sort
+     *
+     * @mbg.generated
+     */
+    public void setMatchSort(String matchSort) {
+        this.matchSort = matchSort;
+    }
+
     /**
      * This method was generated by MyBatis Generator.
      * This method corresponds to the database table channel_demand_match_result
@@ -1532,6 +1637,9 @@ public class ChannelDemandMatchResult {
         sb.append(", channelLevel3=").append(channelLevel3);
         sb.append(", elementDimension=").append(elementDimension);
         sb.append(", channelMedian=").append(channelMedian);
+        sb.append(", matchMethod=").append(matchMethod);
+        sb.append(", matchVideoFilter=").append(matchVideoFilter);
+        sb.append(", matchSort=").append(matchSort);
         sb.append("]");
         return sb.toString();
     }

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

@@ -2984,6 +2984,216 @@ public class ChannelDemandMatchResultExample {
             addCriterion("channel_median not between", value1, value2, "channelMedian");
             return (Criteria) this;
         }
+
+        public Criteria andMatchMethodIsNull() {
+            addCriterion("match_method is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodIsNotNull() {
+            addCriterion("match_method is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodEqualTo(String value) {
+            addCriterion("match_method =", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotEqualTo(String value) {
+            addCriterion("match_method <>", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodGreaterThan(String value) {
+            addCriterion("match_method >", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodGreaterThanOrEqualTo(String value) {
+            addCriterion("match_method >=", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLessThan(String value) {
+            addCriterion("match_method <", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLessThanOrEqualTo(String value) {
+            addCriterion("match_method <=", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodLike(String value) {
+            addCriterion("match_method like", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotLike(String value) {
+            addCriterion("match_method not like", value, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodIn(List<String> values) {
+            addCriterion("match_method in", values, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotIn(List<String> values) {
+            addCriterion("match_method not in", values, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodBetween(String value1, String value2) {
+            addCriterion("match_method between", value1, value2, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchMethodNotBetween(String value1, String value2) {
+            addCriterion("match_method not between", value1, value2, "matchMethod");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterIsNull() {
+            addCriterion("match_video_filter is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterIsNotNull() {
+            addCriterion("match_video_filter is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterEqualTo(String value) {
+            addCriterion("match_video_filter =", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterNotEqualTo(String value) {
+            addCriterion("match_video_filter <>", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterGreaterThan(String value) {
+            addCriterion("match_video_filter >", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterGreaterThanOrEqualTo(String value) {
+            addCriterion("match_video_filter >=", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterLessThan(String value) {
+            addCriterion("match_video_filter <", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterLessThanOrEqualTo(String value) {
+            addCriterion("match_video_filter <=", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterLike(String value) {
+            addCriterion("match_video_filter like", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterNotLike(String value) {
+            addCriterion("match_video_filter not like", value, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterIn(List<String> values) {
+            addCriterion("match_video_filter in", values, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterNotIn(List<String> values) {
+            addCriterion("match_video_filter not in", values, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterBetween(String value1, String value2) {
+            addCriterion("match_video_filter between", value1, value2, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchVideoFilterNotBetween(String value1, String value2) {
+            addCriterion("match_video_filter not between", value1, value2, "matchVideoFilter");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortIsNull() {
+            addCriterion("match_sort is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortIsNotNull() {
+            addCriterion("match_sort is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortEqualTo(String value) {
+            addCriterion("match_sort =", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortNotEqualTo(String value) {
+            addCriterion("match_sort <>", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortGreaterThan(String value) {
+            addCriterion("match_sort >", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortGreaterThanOrEqualTo(String value) {
+            addCriterion("match_sort >=", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortLessThan(String value) {
+            addCriterion("match_sort <", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortLessThanOrEqualTo(String value) {
+            addCriterion("match_sort <=", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortLike(String value) {
+            addCriterion("match_sort like", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortNotLike(String value) {
+            addCriterion("match_sort not like", value, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortIn(List<String> values) {
+            addCriterion("match_sort in", values, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortNotIn(List<String> values) {
+            addCriterion("match_sort not in", values, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortBetween(String value1, String value2) {
+            addCriterion("match_sort between", value1, value2, "matchSort");
+            return (Criteria) this;
+        }
+
+        public Criteria andMatchSortNotBetween(String value1, String value2) {
+            addCriterion("match_sort not between", value1, value2, "matchSort");
+            return (Criteria) this;
+        }
     }
 
     /**

+ 9 - 0
core/src/main/java/com/tzld/videoVector/model/vo/ChannelDemandMatchVO.java

@@ -97,6 +97,15 @@ public class ChannelDemandMatchVO {
     /** 渠道中位数 */
     private Double channelMedian;
 
+    /** 匹配手段 */
+    private String matchMethod;
+
+    /** 匹配视频筛选 */
+    private String matchVideoFilter;
+
+    /** 匹配排序 */
+    private String matchSort;
+
     /** 匹配到的视频列表 */
     private List<MatchedVideo> matchedVideos;
 

+ 6 - 0
core/src/main/java/com/tzld/videoVector/service/impl/VideoSearchServiceImpl.java

@@ -1580,6 +1580,9 @@ public class VideoSearchServiceImpl implements VideoSearchService {
                 v.setChannelLevel3(r.getChannelLevel3());
                 v.setElementDimension(r.getElementDimension());
                 v.setChannelMedian(r.getChannelMedian());
+                v.setMatchMethod(r.getMatchMethod());
+                v.setMatchVideoFilter(r.getMatchVideoFilter());
+                v.setMatchSort(r.getMatchSort());
                 v.setMatchedVideos(new ArrayList<>());
                 return v;
             });
@@ -1649,6 +1652,9 @@ public class VideoSearchServiceImpl implements VideoSearchService {
         if (StringUtils.hasText(param.getSceneValue())) {
             criteria.andSceneValueEqualTo(param.getSceneValue());
         }
+        if (StringUtils.hasText(param.getMatchMethod())) {
+            criteria.andMatchMethodEqualTo(param.getMatchMethod());
+        }
         // 只查已匹配成功的
         criteria.andMatchStatusEqualTo((short) 1);
 

+ 22 - 5
core/src/main/resources/mapper/pgVector/ChannelDemandMatchConfigMapper.xml

@@ -18,6 +18,7 @@
     <result column="demand_strategy" jdbcType="VARCHAR" property="demandStrategy" />
     <result column="filter_dimensions" jdbcType="VARCHAR" property="filterDimensions" />
     <result column="filter_time_dimensions" jdbcType="VARCHAR" property="filterTimeDimensions" />
+    <result column="match_method" jdbcType="VARCHAR" property="matchMethod" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -91,7 +92,7 @@
       This element is automatically generated by MyBatis Generator, do not modify.
     -->
     id, channel_name, min_uv, min_rov, top_n, "status", create_time, update_time, online_action, 
-    demand_strategy, filter_dimensions, filter_time_dimensions
+    demand_strategy, filter_dimensions, filter_time_dimensions, match_method
   </sql>
   <select id="selectByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchConfigExample" resultMap="BaseResultMap">
     <!--
@@ -147,11 +148,13 @@
     insert into channel_demand_match_config (channel_name, min_uv, min_rov, 
       top_n, "status", create_time, 
       update_time, online_action, demand_strategy, 
-      filter_dimensions, filter_time_dimensions)
+      filter_dimensions, filter_time_dimensions, 
+      match_method)
     values (#{channelName,jdbcType=VARCHAR}, #{minUv,jdbcType=INTEGER}, #{minRov,jdbcType=DOUBLE}, 
       #{topN,jdbcType=INTEGER}, #{status,jdbcType=SMALLINT}, #{createTime,jdbcType=TIMESTAMP}, 
       #{updateTime,jdbcType=TIMESTAMP}, #{onlineAction,jdbcType=VARCHAR}, #{demandStrategy,jdbcType=VARCHAR}, 
-      #{filterDimensions,jdbcType=VARCHAR}, #{filterTimeDimensions,jdbcType=VARCHAR})
+      #{filterDimensions,jdbcType=VARCHAR}, #{filterTimeDimensions,jdbcType=VARCHAR}, 
+      #{matchMethod,jdbcType=VARCHAR})
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchConfig" useGeneratedKeys="true">
     <!--
@@ -193,6 +196,9 @@
       <if test="filterTimeDimensions != null">
         filter_time_dimensions,
       </if>
+      <if test="matchMethod != null">
+        match_method,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="channelName != null">
@@ -228,6 +234,9 @@
       <if test="filterTimeDimensions != null">
         #{filterTimeDimensions,jdbcType=VARCHAR},
       </if>
+      <if test="matchMethod != null">
+        #{matchMethod,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchConfigExample" resultType="java.lang.Long">
@@ -283,6 +292,9 @@
       <if test="record.filterTimeDimensions != null">
         filter_time_dimensions = #{record.filterTimeDimensions,jdbcType=VARCHAR},
       </if>
+      <if test="record.matchMethod != null">
+        match_method = #{record.matchMethod,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -305,7 +317,8 @@
       online_action = #{record.onlineAction,jdbcType=VARCHAR},
       demand_strategy = #{record.demandStrategy,jdbcType=VARCHAR},
       filter_dimensions = #{record.filterDimensions,jdbcType=VARCHAR},
-      filter_time_dimensions = #{record.filterTimeDimensions,jdbcType=VARCHAR}
+      filter_time_dimensions = #{record.filterTimeDimensions,jdbcType=VARCHAR},
+      match_method = #{record.matchMethod,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -350,6 +363,9 @@
       <if test="filterTimeDimensions != null">
         filter_time_dimensions = #{filterTimeDimensions,jdbcType=VARCHAR},
       </if>
+      <if test="matchMethod != null">
+        match_method = #{matchMethod,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -369,7 +385,8 @@
       online_action = #{onlineAction,jdbcType=VARCHAR},
       demand_strategy = #{demandStrategy,jdbcType=VARCHAR},
       filter_dimensions = #{filterDimensions,jdbcType=VARCHAR},
-      filter_time_dimensions = #{filterTimeDimensions,jdbcType=VARCHAR}
+      filter_time_dimensions = #{filterTimeDimensions,jdbcType=VARCHAR},
+      match_method = #{matchMethod,jdbcType=VARCHAR}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>

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

@@ -48,6 +48,9 @@
     <result column="channel_level3" jdbcType="VARCHAR" property="channelLevel3" />
     <result column="element_dimension" jdbcType="VARCHAR" property="elementDimension" />
     <result column="channel_median" jdbcType="DOUBLE" property="channelMedian" />
+    <result column="match_method" jdbcType="VARCHAR" property="matchMethod" />
+    <result column="match_video_filter" jdbcType="VARCHAR" property="matchVideoFilter" />
+    <result column="match_sort" jdbcType="VARCHAR" property="matchSort" />
   </resultMap>
   <sql id="Example_Where_Clause">
     <!--
@@ -126,7 +129,8 @@
     online_action, match_experiment_id, 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, uv_ratio, 
-    experiment_id, channel_level3, element_dimension, channel_median
+    experiment_id, channel_level3, element_dimension, channel_median, match_method, match_video_filter, 
+    match_sort
   </sql>
   <select id="selectByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResultExample" resultMap="BaseResultMap">
     <!--
@@ -192,7 +196,8 @@
       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
+      channel_level3, element_dimension, channel_median, 
+      match_method, match_video_filter, match_sort
       )
     values (#{configId,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{channelName,jdbcType=VARCHAR}, 
       #{crowdSegment,jdbcType=VARCHAR}, #{dimension,jdbcType=VARCHAR}, #{pointType,jdbcType=VARCHAR}, 
@@ -207,7 +212,8 @@
       #{driveDimensionTime,jdbcType=VARCHAR}, #{demandFilterSortStrategy,jdbcType=VARCHAR}, 
       #{demandType,jdbcType=VARCHAR}, #{demandContentId,jdbcType=VARCHAR}, #{demandContentTitle,jdbcType=VARCHAR}, 
       #{demandContentTopic,jdbcType=VARCHAR}, #{uvRatio,jdbcType=DOUBLE}, #{experimentId,jdbcType=VARCHAR}, 
-      #{channelLevel3,jdbcType=VARCHAR}, #{elementDimension,jdbcType=VARCHAR}, #{channelMedian,jdbcType=DOUBLE}
+      #{channelLevel3,jdbcType=VARCHAR}, #{elementDimension,jdbcType=VARCHAR}, #{channelMedian,jdbcType=DOUBLE}, 
+      #{matchMethod,jdbcType=VARCHAR}, #{matchVideoFilter,jdbcType=VARCHAR}, #{matchSort,jdbcType=VARCHAR}
       )
   </insert>
   <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResult" useGeneratedKeys="true">
@@ -340,6 +346,15 @@
       <if test="channelMedian != null">
         channel_median,
       </if>
+      <if test="matchMethod != null">
+        match_method,
+      </if>
+      <if test="matchVideoFilter != null">
+        match_video_filter,
+      </if>
+      <if test="matchSort != null">
+        match_sort,
+      </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
       <if test="configId != null">
@@ -465,6 +480,15 @@
       <if test="channelMedian != null">
         #{channelMedian,jdbcType=DOUBLE},
       </if>
+      <if test="matchMethod != null">
+        #{matchMethod,jdbcType=VARCHAR},
+      </if>
+      <if test="matchVideoFilter != null">
+        #{matchVideoFilter,jdbcType=VARCHAR},
+      </if>
+      <if test="matchSort != null">
+        #{matchSort,jdbcType=VARCHAR},
+      </if>
     </trim>
   </insert>
   <select id="countByExample" parameterType="com.tzld.videoVector.model.po.pgVector.ChannelDemandMatchResultExample" resultType="java.lang.Long">
@@ -610,6 +634,15 @@
       <if test="record.channelMedian != null">
         channel_median = #{record.channelMedian,jdbcType=DOUBLE},
       </if>
+      <if test="record.matchMethod != null">
+        match_method = #{record.matchMethod,jdbcType=VARCHAR},
+      </if>
+      <if test="record.matchVideoFilter != null">
+        match_video_filter = #{record.matchVideoFilter,jdbcType=VARCHAR},
+      </if>
+      <if test="record.matchSort != null">
+        match_sort = #{record.matchSort,jdbcType=VARCHAR},
+      </if>
     </set>
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -662,7 +695,10 @@
       experiment_id = #{record.experimentId,jdbcType=VARCHAR},
       channel_level3 = #{record.channelLevel3,jdbcType=VARCHAR},
       element_dimension = #{record.elementDimension,jdbcType=VARCHAR},
-      channel_median = #{record.channelMedian,jdbcType=DOUBLE}
+      channel_median = #{record.channelMedian,jdbcType=DOUBLE},
+      match_method = #{record.matchMethod,jdbcType=VARCHAR},
+      match_video_filter = #{record.matchVideoFilter,jdbcType=VARCHAR},
+      match_sort = #{record.matchSort,jdbcType=VARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -797,6 +833,15 @@
       <if test="channelMedian != null">
         channel_median = #{channelMedian,jdbcType=DOUBLE},
       </if>
+      <if test="matchMethod != null">
+        match_method = #{matchMethod,jdbcType=VARCHAR},
+      </if>
+      <if test="matchVideoFilter != null">
+        match_video_filter = #{matchVideoFilter,jdbcType=VARCHAR},
+      </if>
+      <if test="matchSort != null">
+        match_sort = #{matchSort,jdbcType=VARCHAR},
+      </if>
     </set>
     where id = #{id,jdbcType=BIGINT}
   </update>
@@ -846,7 +891,10 @@
       experiment_id = #{experimentId,jdbcType=VARCHAR},
       channel_level3 = #{channelLevel3,jdbcType=VARCHAR},
       element_dimension = #{elementDimension,jdbcType=VARCHAR},
-      channel_median = #{channelMedian,jdbcType=DOUBLE}
+      channel_median = #{channelMedian,jdbcType=DOUBLE},
+      match_method = #{matchMethod,jdbcType=VARCHAR},
+      match_video_filter = #{matchVideoFilter,jdbcType=VARCHAR},
+      match_sort = #{matchSort,jdbcType=VARCHAR}
     where id = #{id,jdbcType=BIGINT}
   </update>
 </mapper>