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

Merge branch 'master' into test

# Conflicts:
#	api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDemandVideoMapperExt.xml
wangyunpeng 1 день назад
Родитель
Сommit
1b1d9ae92c

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

@@ -11,6 +11,8 @@ public interface ContentPlatformDemandVideoMapperExt {
 
     int deleteByDt(@Param("dt") String dt);
 
+    int deleteByDtAndChannelName(@Param("dt") String dt, @Param("channelName") String channelName);
+
     List<ContentPlatformDemandVideo> selectByCondition(@Param("dt") String dt,
                                                        @Param("channelName") String channelName,
                                                        @Param("pointType") String pointType,

+ 102 - 63
api-module/src/main/java/com/tzld/piaoquan/api/job/contentplatform/ContentPlatformDemandVideoJob.java

@@ -35,6 +35,11 @@ public class ContentPlatformDemandVideoJob {
     @Autowired
     private MessageAttachmentService messageAttachmentService;
 
+    private static final List<String> SYNC_CHANNEL_NAMES = Arrays.asList(
+            "公众号合作-即转-稳定",
+            "群/企微合作-稳定"
+    );
+
     @XxlJob("syncContentPlatformDemandVideoJob")
     public ReturnT<String> syncContentPlatformDemandVideoJob(String param) {
         String dt = DateUtil.getBeforeDayDateString("yyyyMMdd");
@@ -43,40 +48,71 @@ public class ContentPlatformDemandVideoJob {
         }
         log.info("syncContentPlatformDemandVideoJob start, dt={}", dt);
 
-        try {
-            // 调用接口获取需求匹配结果
+        for (String syncChannelName : SYNC_CHANNEL_NAMES) {
+            try {
+                syncByChannel(dt, syncChannelName);
+            } catch (Exception e) {
+                log.error("syncContentPlatformDemandVideoJob error, dt={}, channelName={}", dt, syncChannelName, e);
+                return ReturnT.FAIL;
+            }
+        }
+
+        log.info("syncContentPlatformDemandVideoJob finish, dt={}", dt);
+        return ReturnT.SUCCESS;
+    }
+
+    private static final int PAGE_SIZE = 10000;
+
+    private void syncByChannel(String dt, String syncChannelName) throws Exception {
+        log.info("syncByChannel start, dt={}, channelName={}", dt, syncChannelName);
+
+        Long now = System.currentTimeMillis();
+        List<ContentPlatformDemandVideo> saveList = new ArrayList<>();
+
+        int pageNum = 1;
+        int totalPages = 1;
+
+        while (pageNum <= totalPages) {
+            // 调用分页接口获取需求匹配结果
             JSONObject requestParam = new JSONObject();
             requestParam.put("dt", dt);
-            requestParam.put("channelName", "群/企微合作-稳定");
+            requestParam.put("channelName", syncChannelName);
+            requestParam.put("pageNum", pageNum);
+            requestParam.put("pageSize", PAGE_SIZE);
 
             String response = httpPoolClient.post(DEMAND_MATCH_API_URL, requestParam.toJSONString());
             if (!StringUtils.hasText(response)) {
-                log.error("syncContentPlatformDemandVideoJob response is empty, dt={}", dt);
-                return ReturnT.FAIL;
+                log.error("syncByChannel response is empty, dt={}, channelName={}, pageNum={}", dt, syncChannelName, pageNum);
+                throw new RuntimeException("syncByChannel response is empty");
             }
 
             JSONObject result = JSONObject.parseObject(response);
             if (result.getInteger("code") != 0) {
-                log.error("syncContentPlatformDemandVideoJob api error, dt={}, msg={}", dt, result.getString("msg"));
-                return ReturnT.FAIL;
+                log.error("syncByChannel api error, dt={}, channelName={}, pageNum={}, msg={}", dt, syncChannelName, pageNum, result.getString("msg"));
+                throw new RuntimeException("syncByChannel api error: " + result.getString("msg"));
             }
 
-            JSONArray dataArray = result.getJSONArray("data");
-            if (dataArray == null || dataArray.isEmpty()) {
-                log.info("syncContentPlatformDemandVideoJob no data, dt={}", dt);
-                return ReturnT.SUCCESS;
+            JSONObject dataObj = result.getJSONObject("data");
+            if (dataObj == null) {
+                log.info("syncByChannel no data, dt={}, channelName={}, pageNum={}", dt, syncChannelName, pageNum);
+                break;
             }
 
-            Long now = System.currentTimeMillis();
-            List<ContentPlatformDemandVideo> saveList = new ArrayList<>();
+            totalPages = dataObj.getIntValue("totalPages");
+            JSONArray records = dataObj.getJSONArray("records");
+            if (records == null || records.isEmpty()) {
+                log.info("syncByChannel no records, dt={}, channelName={}, pageNum={}", dt, syncChannelName, pageNum);
+                break;
+            }
 
-            for (int i = 0; i < dataArray.size(); i++) {
-                JSONObject demandItem = dataArray.getJSONObject(i);
+            for (int i = 0; i < records.size(); i++) {
+                JSONObject demandItem = records.getJSONObject(i);
                 String channelName = demandItem.getString("channelName");
                 String crowdSegment = demandItem.getString("crowdSegment");
                 String dimension = demandItem.getString("dimension");
                 String pointType = demandItem.getString("pointType");
                 String standardElement = demandItem.getString("standardElement");
+                String elementDimension = demandItem.getString("elementDimension");
                 String categoryName = demandItem.getString("categoryName");
                 String demandId = demandItem.getString("demandId");
                 String crowdPackage = demandItem.getString("crowdPackage");
@@ -113,6 +149,7 @@ public class ContentPlatformDemandVideoJob {
                     demandVideo.setDimension(dimension != null ? dimension : "");
                     demandVideo.setPointType(pointType != null ? pointType : "");
                     demandVideo.setStandardElement(standardElement != null ? standardElement : "");
+                    demandVideo.setElementDimension(elementDimension != null ? elementDimension : "");
                     demandVideo.setCategoryName(categoryName != null ? categoryName : "");
                     demandVideo.setDemandId(demandId != null ? demandId : "");
                     demandVideo.setCrowdPackage(crowdPackage != null ? crowdPackage : "");
@@ -143,65 +180,67 @@ public class ContentPlatformDemandVideoJob {
                     demandVideo.setExperimentId(videoItem.getString("experimentId"));
                     demandVideo.setStatus(1);
                     demandVideo.setCreateTimestamp(now);
+                    if (Objects.isNull(demandVideo.getRov()) || demandVideo.getRov() == 0.0) {
+                        continue;
+                    }
                     saveList.add(demandVideo);
                 }
             }
 
-            if (CollectionUtils.isEmpty(saveList)) {
-                log.info("syncContentPlatformDemandVideoJob no matched videos, dt={}", dt);
-                return ReturnT.SUCCESS;
-            }
+            pageNum++;
+        }
 
-            // 获取视频详情(标题、封面、视频URL)
-            List<Long> videoIds = saveList.stream().map(ContentPlatformDemandVideo::getVideoId)
-                    .distinct().collect(Collectors.toList());
-            Map<Long, VideoDetail> videoDetailMap = new HashMap<>();
-            for (List<Long> partition : Lists.partition(videoIds, 20)) {
-                Set<Long> ids = new HashSet<>(partition);
-                videoDetailMap.putAll(messageAttachmentService.getVideoDetail(ids));
-            }
+        if (CollectionUtils.isEmpty(saveList)) {
+            log.info("syncByChannel no matched videos, dt={}, channelName={}", dt, syncChannelName);
+            return;
+        }
 
-            // 填充视频详情
-            for (ContentPlatformDemandVideo demandVideo : saveList) {
-                VideoDetail detail = videoDetailMap.get(demandVideo.getVideoId());
-                if (Objects.nonNull(detail)) {
-                    demandVideo.setTitle(detail.getTitle());
-                    String cover = detail.getCover();
-                    if (StringUtils.hasText(cover) && cover.contains("/watermark")) {
-                        cover = cover.substring(0, cover.indexOf("/watermark"));
-                    }
-                    demandVideo.setCover(cover);
-                    demandVideo.setVideo(detail.getVideoPath());
+        // 获取视频详情(标题、封面、视频URL)
+        List<Long> videoIds = saveList.stream().map(ContentPlatformDemandVideo::getVideoId)
+                .distinct().collect(Collectors.toList());
+        Map<Long, VideoDetail> videoDetailMap = new HashMap<>();
+        for (List<Long> partition : Lists.partition(videoIds, 20)) {
+            Set<Long> ids = new HashSet<>(partition);
+            videoDetailMap.putAll(messageAttachmentService.getVideoDetail(ids));
+        }
+
+        // 填充视频详情
+        for (ContentPlatformDemandVideo demandVideo : saveList) {
+            VideoDetail detail = videoDetailMap.get(demandVideo.getVideoId());
+            if (Objects.nonNull(detail)) {
+                demandVideo.setTitle(detail.getTitle());
+                String cover = detail.getCover();
+                if (StringUtils.hasText(cover) && cover.contains("/watermark")) {
+                    cover = cover.substring(0, cover.indexOf("/watermark"));
                 }
+                demandVideo.setCover(cover);
+                demandVideo.setVideo(detail.getVideoPath());
             }
+        }
 
-            // 过滤未获取到视频详情的记录
-            saveList = saveList.stream()
-                    .filter(v -> StringUtils.hasText(v.getTitle()))
-                    .collect(Collectors.toList());
-
-            // 按crowd_segment粒度去重,相同videoId保留分数最高的一条
-            saveList = saveList.stream()
-                    .collect(Collectors.groupingBy(v -> v.getCrowdSegment() + "_" + v.getVideoId()))
-                    .values().stream()
-                    .map(group -> group.stream()
-                            .max(Comparator.comparingDouble(v -> v.getScore() != null ? v.getScore() : 0.0))
-                            .orElse(null))
-                    .filter(Objects::nonNull)
-                    .collect(Collectors.toList());
-
-            // 先删除当天数据,再批量插入
-            demandVideoMapperExt.deleteByDt(dt);
-            for (List<ContentPlatformDemandVideo> partition : Lists.partition(saveList, 500)) {
-                demandVideoMapperExt.batchInsert(partition);
-            }
+        // 过滤未获取到视频详情的记录
+        saveList = saveList.stream()
+                .filter(v -> StringUtils.hasText(v.getTitle()))
+                .collect(Collectors.toList());
 
-            log.info("syncContentPlatformDemandVideoJob success, dt={}, count={}", dt, saveList.size());
-            return ReturnT.SUCCESS;
-        } catch (Exception e) {
-            log.error("syncContentPlatformDemandVideoJob error, dt={}", dt, e);
-            return ReturnT.FAIL;
+//        // 按crowd_segment粒度去重,相同videoId保留分数最高的一条
+//        saveList = saveList.stream()
+//                .collect(Collectors.groupingBy(v -> v.getCrowdSegment() + "_"
+//                        + v.getChannelLevel3() + "_" + v.getDimension() + "_" + v.getVideoId()))
+//                .values().stream()
+//                .map(group -> group.stream()
+//                        .max(Comparator.comparingDouble(v -> v.getScore() != null ? v.getScore() : 0.0))
+//                        .orElse(null))
+//                .filter(Objects::nonNull)
+//                .collect(Collectors.toList());
+
+        // 先删除当天该渠道数据,再批量插入
+        demandVideoMapperExt.deleteByDtAndChannelName(dt, syncChannelName);
+        for (List<ContentPlatformDemandVideo> partition : Lists.partition(saveList, 1000)) {
+            demandVideoMapperExt.batchInsert(partition);
         }
+
+        log.info("syncByChannel success, dt={}, channelName={}, count={}", dt, syncChannelName, saveList.size());
     }
 
     @XxlJob("checkContentPlatformDemandVideoStatusJob")

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

@@ -45,6 +45,8 @@ public class ContentPlatformDemandVideo {
 
     private String standardElement;
 
+    private String elementDimension;
+
     private String categoryName;
 
     private Integer crowdCount;
@@ -261,6 +263,14 @@ public class ContentPlatformDemandVideo {
         this.standardElement = standardElement;
     }
 
+    public String getElementDimension() {
+        return elementDimension;
+    }
+
+    public void setElementDimension(String elementDimension) {
+        this.elementDimension = elementDimension;
+    }
+
     public String getCategoryName() {
         return categoryName;
     }
@@ -449,6 +459,7 @@ public class ContentPlatformDemandVideo {
         sb.append(", demandContentTopic=").append(demandContentTopic);
         sb.append(", pointType=").append(pointType);
         sb.append(", standardElement=").append(standardElement);
+        sb.append(", elementDimension=").append(elementDimension);
         sb.append(", categoryName=").append(categoryName);
         sb.append(", crowdCount=").append(crowdCount);
         sb.append(", videoCount=").append(videoCount);

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

@@ -1645,6 +1645,76 @@ public class ContentPlatformDemandVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andElementDimensionIsNull() {
+            addCriterion("element_dimension is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionIsNotNull() {
+            addCriterion("element_dimension is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionEqualTo(String value) {
+            addCriterion("element_dimension =", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionNotEqualTo(String value) {
+            addCriterion("element_dimension <>", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionGreaterThan(String value) {
+            addCriterion("element_dimension >", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionGreaterThanOrEqualTo(String value) {
+            addCriterion("element_dimension >=", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionLessThan(String value) {
+            addCriterion("element_dimension <", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionLessThanOrEqualTo(String value) {
+            addCriterion("element_dimension <=", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionLike(String value) {
+            addCriterion("element_dimension like", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionNotLike(String value) {
+            addCriterion("element_dimension not like", value, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionIn(List<String> values) {
+            addCriterion("element_dimension in", values, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionNotIn(List<String> values) {
+            addCriterion("element_dimension not in", values, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionBetween(String value1, String value2) {
+            addCriterion("element_dimension between", value1, value2, "elementDimension");
+            return (Criteria) this;
+        }
+
+        public Criteria andElementDimensionNotBetween(String value1, String value2) {
+            addCriterion("element_dimension not between", value1, value2, "elementDimension");
+            return (Criteria) this;
+        }
+
         public Criteria andCategoryNameIsNull() {
             addCriterion("category_name is null");
             return (Criteria) this;

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

@@ -24,6 +24,7 @@
     <result column="demand_content_topic" jdbcType="VARCHAR" property="demandContentTopic" />
     <result column="point_type" jdbcType="VARCHAR" property="pointType" />
     <result column="standard_element" jdbcType="VARCHAR" property="standardElement" />
+    <result column="element_dimension" jdbcType="VARCHAR" property="elementDimension" />
     <result column="category_name" jdbcType="VARCHAR" property="categoryName" />
     <result column="crowd_count" jdbcType="INTEGER" property="crowdCount" />
     <result column="video_count" jdbcType="INTEGER" property="videoCount" />
@@ -107,10 +108,10 @@
     id, dt, online_action, channel_name, crowd_segment, channel_level3, demand_id, crowd_package, 
     conversion_target, partner, account, scene_value, demand_strategy, drive_dimension_time, 
     dimension, demand_filter_sort_strategy, demand_type, demand_content_id, demand_content_title, 
-    demand_content_topic, point_type, standard_element, category_name, crowd_count, video_count, 
-    visit_uv, uv_ratio, total_rov, match_experiment_id, video_id, config_code, score, 
-    sim, rov, match_text, title, cover, video, experiment_id, `status`, create_timestamp, 
-    update_timestamp
+    demand_content_topic, point_type, standard_element, element_dimension, category_name, 
+    crowd_count, video_count, visit_uv, uv_ratio, total_rov, match_experiment_id, video_id, 
+    config_code, score, sim, rov, match_text, title, cover, video, experiment_id, `status`, 
+    create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideoExample" resultMap="BaseResultMap">
     select
@@ -153,11 +154,11 @@
       demand_strategy, drive_dimension_time, dimension, 
       demand_filter_sort_strategy, demand_type, demand_content_id, 
       demand_content_title, demand_content_topic, 
-      point_type, standard_element, category_name, 
-      crowd_count, video_count, visit_uv, 
-      uv_ratio, total_rov, match_experiment_id, 
-      video_id, config_code, score, 
-      sim, rov, match_text, 
+      point_type, standard_element, element_dimension, 
+      category_name, crowd_count, video_count, 
+      visit_uv, uv_ratio, total_rov, 
+      match_experiment_id, video_id, config_code, 
+      score, sim, rov, match_text, 
       title, cover, video, 
       experiment_id, `status`, create_timestamp, 
       update_timestamp)
@@ -168,11 +169,11 @@
       #{demandStrategy,jdbcType=VARCHAR}, #{driveDimensionTime,jdbcType=VARCHAR}, #{dimension,jdbcType=VARCHAR}, 
       #{demandFilterSortStrategy,jdbcType=VARCHAR}, #{demandType,jdbcType=VARCHAR}, #{demandContentId,jdbcType=VARCHAR}, 
       #{demandContentTitle,jdbcType=VARCHAR}, #{demandContentTopic,jdbcType=VARCHAR}, 
-      #{pointType,jdbcType=VARCHAR}, #{standardElement,jdbcType=VARCHAR}, #{categoryName,jdbcType=VARCHAR}, 
-      #{crowdCount,jdbcType=INTEGER}, #{videoCount,jdbcType=INTEGER}, #{visitUv,jdbcType=BIGINT}, 
-      #{uvRatio,jdbcType=DOUBLE}, #{totalRov,jdbcType=DOUBLE}, #{matchExperimentId,jdbcType=VARCHAR}, 
-      #{videoId,jdbcType=BIGINT}, #{configCode,jdbcType=VARCHAR}, #{score,jdbcType=DOUBLE}, 
-      #{sim,jdbcType=DOUBLE}, #{rov,jdbcType=DOUBLE}, #{matchText,jdbcType=VARCHAR}, 
+      #{pointType,jdbcType=VARCHAR}, #{standardElement,jdbcType=VARCHAR}, #{elementDimension,jdbcType=VARCHAR}, 
+      #{categoryName,jdbcType=VARCHAR}, #{crowdCount,jdbcType=INTEGER}, #{videoCount,jdbcType=INTEGER}, 
+      #{visitUv,jdbcType=BIGINT}, #{uvRatio,jdbcType=DOUBLE}, #{totalRov,jdbcType=DOUBLE}, 
+      #{matchExperimentId,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, #{configCode,jdbcType=VARCHAR}, 
+      #{score,jdbcType=DOUBLE}, #{sim,jdbcType=DOUBLE}, #{rov,jdbcType=DOUBLE}, #{matchText,jdbcType=VARCHAR}, 
       #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
       #{experimentId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTimestamp,jdbcType=BIGINT}, 
       #{updateTimestamp,jdbcType=BIGINT})
@@ -246,6 +247,9 @@
       <if test="standardElement != null">
         standard_element,
       </if>
+      <if test="elementDimension != null">
+        element_dimension,
+      </if>
       <if test="categoryName != null">
         category_name,
       </if>
@@ -374,6 +378,9 @@
       <if test="standardElement != null">
         #{standardElement,jdbcType=VARCHAR},
       </if>
+      <if test="elementDimension != null">
+        #{elementDimension,jdbcType=VARCHAR},
+      </if>
       <if test="categoryName != null">
         #{categoryName,jdbcType=VARCHAR},
       </if>
@@ -511,6 +518,9 @@
       <if test="record.standardElement != null">
         standard_element = #{record.standardElement,jdbcType=VARCHAR},
       </if>
+      <if test="record.elementDimension != null">
+        element_dimension = #{record.elementDimension,jdbcType=VARCHAR},
+      </if>
       <if test="record.categoryName != null">
         category_name = #{record.categoryName,jdbcType=VARCHAR},
       </if>
@@ -600,6 +610,7 @@
       demand_content_topic = #{record.demandContentTopic,jdbcType=VARCHAR},
       point_type = #{record.pointType,jdbcType=VARCHAR},
       standard_element = #{record.standardElement,jdbcType=VARCHAR},
+      element_dimension = #{record.elementDimension,jdbcType=VARCHAR},
       category_name = #{record.categoryName,jdbcType=VARCHAR},
       crowd_count = #{record.crowdCount,jdbcType=INTEGER},
       video_count = #{record.videoCount,jdbcType=INTEGER},
@@ -690,6 +701,9 @@
       <if test="standardElement != null">
         standard_element = #{standardElement,jdbcType=VARCHAR},
       </if>
+      <if test="elementDimension != null">
+        element_dimension = #{elementDimension,jdbcType=VARCHAR},
+      </if>
       <if test="categoryName != null">
         category_name = #{categoryName,jdbcType=VARCHAR},
       </if>
@@ -776,6 +790,7 @@
       demand_content_topic = #{demandContentTopic,jdbcType=VARCHAR},
       point_type = #{pointType,jdbcType=VARCHAR},
       standard_element = #{standardElement,jdbcType=VARCHAR},
+      element_dimension = #{elementDimension,jdbcType=VARCHAR},
       category_name = #{categoryName,jdbcType=VARCHAR},
       crowd_count = #{crowdCount,jdbcType=INTEGER},
       video_count = #{videoCount,jdbcType=INTEGER},

+ 7 - 3
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformDemandVideoMapperExt.xml

@@ -4,7 +4,7 @@
 
     <insert id="batchInsert" parameterType="java.util.List">
         INSERT INTO content_platform_demand_video
-        (dt, channel_name, crowd_segment, dimension, point_type, standard_element,
+        (dt, channel_name, crowd_segment, dimension, point_type, standard_element, element_dimension,
          category_name, 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,
@@ -13,7 +13,7 @@
          match_text, title, cover, video, experiment_id, channel_level3, status, create_timestamp, update_timestamp)
         VALUES
         <foreach collection="list" item="item" separator=",">
-            (#{item.dt}, #{item.channelName}, #{item.crowdSegment}, #{item.dimension}, #{item.pointType}, #{item.standardElement},
+            (#{item.dt}, #{item.channelName}, #{item.crowdSegment}, #{item.dimension}, #{item.pointType}, #{item.standardElement}, #{item.elementDimension},
              #{item.categoryName}, #{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},
@@ -27,8 +27,12 @@
         DELETE FROM content_platform_demand_video WHERE dt = #{dt}
     </delete>
 
+    <delete id="deleteByDtAndChannelName">
+        DELETE FROM content_platform_demand_video WHERE dt = #{dt} AND channel_name = #{channelName}
+    </delete>
+
     <select id="selectByCondition" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformDemandVideo">
-        SELECT id, dt, channel_name, channel_level3, crowd_segment, dimension, point_type, standard_element,
+        SELECT id, dt, channel_name, channel_level3, crowd_segment, dimension, point_type, standard_element, element_dimension,
                category_name, 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,