Browse Source

增加rootSourceId

xueyiming 2 weeks ago
parent
commit
7c5c1c6dc1

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

@@ -17,6 +17,7 @@ import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
+import com.tzld.piaoquan.growth.common.utils.MessageUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -318,6 +319,7 @@ public class BuckStrategyV1 implements ReplyStrategyService {
             }
             cgiReplyBucketData.setPagePathUrlId(smallPageUrlDetail.getId());
             cgiReplyBucketData.setMiniPagePath(smallPageUrlDetail.getUrl());
+            cgiReplyBucketData.setRootSourceId(MessageUtil.getRootSourceId(smallPageUrlDetail.getUrl()));
         }
         return smallDataCgiReplyList;
     }

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java

@@ -16,6 +16,7 @@ import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
+import com.tzld.piaoquan.growth.common.utils.MessageUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -210,6 +211,7 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
             }
             cgiReplyBucketData.setPagePathUrlId(smallPageUrlDetail.getId());
             cgiReplyBucketData.setMiniPagePath(smallPageUrlDetail.getUrl());
+            cgiReplyBucketData.setRootSourceId(MessageUtil.getRootSourceId(smallPageUrlDetail.getUrl()));
         }
         return smallDataCgiReplyList;
     }

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/WeComPushMessageStrategyV1.java

@@ -13,6 +13,7 @@ import com.tzld.piaoquan.api.model.po.AlgGhAutoreplyVideoRankDataExample;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.api.service.strategy.ReplyStrategyService;
+import com.tzld.piaoquan.growth.common.utils.MessageUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
@@ -204,6 +205,7 @@ public class WeComPushMessageStrategyV1 implements ReplyStrategyService {
             }
             cgiReplyBucketData.setPagePathUrlId(smallPageUrlDetail.getId());
             cgiReplyBucketData.setMiniPagePath(smallPageUrlDetail.getUrl());
+            cgiReplyBucketData.setRootSourceId(MessageUtil.getRootSourceId(smallPageUrlDetail.getUrl()));
         }
         return smallDataCgiReplyList;
     }

+ 2 - 1
api-module/src/main/resources/mybatis-generator-config.xml

@@ -50,7 +50,8 @@
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
 
-            <table tableName="we_com_user" domainObjectName="WeComUser" alias=""/>
+        <table tableName="cgi_reply_bucket_data" domainObjectName="CgiReplyBucketData" alias=""/>
+<!--        <table tableName="we_com_user" domainObjectName="WeComUser" alias=""/>-->
 <!--        <table tableName="we_com_alert_message" domainObjectName="AlertMessage" alias=""/>-->
 <!--        <table tableName="gh_detail" domainObjectName="GhDetail" alias=""/>-->
 <!--        <table tableName="we_com_guarantees_video" domainObjectName="GuaranteesVideo" alias=""/>-->

+ 9 - 6
common-module/src/main/java/com/tzld/piaoquan/growth/common/dao/mapper/CgiReplyBucketDataMapper.java

@@ -1,15 +1,18 @@
 package com.tzld.piaoquan.growth.common.dao.mapper;
 
-
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
+import java.util.List;
+
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Param;
+import org.springframework.stereotype.Repository;
 
 import java.util.Date;
 import java.util.List;
 
 @Mapper
+@Repository
 public interface CgiReplyBucketDataMapper {
     long countByExample(CgiReplyBucketDataExample example);
 
@@ -17,19 +20,19 @@ public interface CgiReplyBucketDataMapper {
 
     int deleteByPrimaryKey(Long id);
 
-    int insert(CgiReplyBucketData row);
+    int insert(CgiReplyBucketData record);
 
-    int insertSelective(CgiReplyBucketData row);
+    int insertSelective(CgiReplyBucketData record);
 
     List<CgiReplyBucketData> selectByExample(CgiReplyBucketDataExample example);
 
     CgiReplyBucketData selectByPrimaryKey(Long id);
 
-    int updateByExampleSelective(@Param("row") CgiReplyBucketData row, @Param("example") CgiReplyBucketDataExample example);
+    int updateByExampleSelective(@Param("record") CgiReplyBucketData record, @Param("example") CgiReplyBucketDataExample example);
 
-    int updateByExample(@Param("row") CgiReplyBucketData row, @Param("example") CgiReplyBucketDataExample example);
+    int updateByExample(@Param("record") CgiReplyBucketData record, @Param("example") CgiReplyBucketDataExample example);
 
-    int updateByPrimaryKeySelective(CgiReplyBucketData row);
+    int updateByPrimaryKeySelective(CgiReplyBucketData record);
 
     int updateByPrimaryKey(CgiReplyBucketData row);
 

+ 47 - 9
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketData.java

@@ -25,6 +25,8 @@ public class CgiReplyBucketData {
 
     private Long miniVideoId;
 
+    private String rootSourceId;
+
     private Long pagePathUrlId;
 
     private String newsPublishContentId;
@@ -50,7 +52,7 @@ public class CgiReplyBucketData {
     }
 
     public void setStrategy(String strategy) {
-        this.strategy = strategy == null ? null : strategy.trim();
+        this.strategy = strategy;
     }
 
     public Integer getSort() {
@@ -66,7 +68,7 @@ public class CgiReplyBucketData {
     }
 
     public void setStrategyDt(String strategyDt) {
-        this.strategyDt = strategyDt == null ? null : strategyDt.trim();
+        this.strategyDt = strategyDt;
     }
 
     public String getGhId() {
@@ -74,7 +76,7 @@ public class CgiReplyBucketData {
     }
 
     public void setGhId(String ghId) {
-        this.ghId = ghId == null ? null : ghId.trim();
+        this.ghId = ghId;
     }
 
     public Integer getMsgType() {
@@ -90,7 +92,7 @@ public class CgiReplyBucketData {
     }
 
     public void setTitle(String title) {
-        this.title = title == null ? null : title.trim();
+        this.title = title;
     }
 
     public String getCoverUrl() {
@@ -98,7 +100,7 @@ public class CgiReplyBucketData {
     }
 
     public void setCoverUrl(String coverUrl) {
-        this.coverUrl = coverUrl == null ? null : coverUrl.trim();
+        this.coverUrl = coverUrl;
     }
 
     public String getMiniAppId() {
@@ -106,7 +108,7 @@ public class CgiReplyBucketData {
     }
 
     public void setMiniAppId(String miniAppId) {
-        this.miniAppId = miniAppId == null ? null : miniAppId.trim();
+        this.miniAppId = miniAppId;
     }
 
     public String getMiniPagePath() {
@@ -114,7 +116,7 @@ public class CgiReplyBucketData {
     }
 
     public void setMiniPagePath(String miniPagePath) {
-        this.miniPagePath = miniPagePath == null ? null : miniPagePath.trim();
+        this.miniPagePath = miniPagePath;
     }
 
     public Long getMiniVideoId() {
@@ -125,6 +127,14 @@ public class CgiReplyBucketData {
         this.miniVideoId = miniVideoId;
     }
 
+    public String getRootSourceId() {
+        return rootSourceId;
+    }
+
+    public void setRootSourceId(String rootSourceId) {
+        this.rootSourceId = rootSourceId;
+    }
+
     public Long getPagePathUrlId() {
         return pagePathUrlId;
     }
@@ -138,7 +148,7 @@ public class CgiReplyBucketData {
     }
 
     public void setNewsPublishContentId(String newsPublishContentId) {
-        this.newsPublishContentId = newsPublishContentId == null ? null : newsPublishContentId.trim();
+        this.newsPublishContentId = newsPublishContentId;
     }
 
     public String getPlanId() {
@@ -146,7 +156,7 @@ public class CgiReplyBucketData {
     }
 
     public void setPlanId(String planId) {
-        this.planId = planId == null ? null : planId.trim();
+        this.planId = planId;
     }
 
     public Integer getIsDelete() {
@@ -172,4 +182,32 @@ public class CgiReplyBucketData {
     public void setUpdateTime(Date updateTime) {
         this.updateTime = updateTime;
     }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", strategy=").append(strategy);
+        sb.append(", sort=").append(sort);
+        sb.append(", strategyDt=").append(strategyDt);
+        sb.append(", ghId=").append(ghId);
+        sb.append(", msgType=").append(msgType);
+        sb.append(", title=").append(title);
+        sb.append(", coverUrl=").append(coverUrl);
+        sb.append(", miniAppId=").append(miniAppId);
+        sb.append(", miniPagePath=").append(miniPagePath);
+        sb.append(", miniVideoId=").append(miniVideoId);
+        sb.append(", rootSourceId=").append(rootSourceId);
+        sb.append(", pagePathUrlId=").append(pagePathUrlId);
+        sb.append(", newsPublishContentId=").append(newsPublishContentId);
+        sb.append(", planId=").append(planId);
+        sb.append(", isDelete=").append(isDelete);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
 }

+ 84 - 2
common-module/src/main/java/com/tzld/piaoquan/growth/common/model/po/CgiReplyBucketDataExample.java

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.growth.common.model.po;
 
+import com.tzld.piaoquan.growth.common.utils.page.Page;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -11,8 +12,10 @@ public class CgiReplyBucketDataExample {
 
     protected List<Criteria> oredCriteria;
 
+    protected Page page;
+
     public CgiReplyBucketDataExample() {
-        oredCriteria = new ArrayList<>();
+        oredCriteria = new ArrayList<Criteria>();
     }
 
     public void setOrderByClause(String orderByClause) {
@@ -64,12 +67,20 @@ public class CgiReplyBucketDataExample {
         distinct = false;
     }
 
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
     protected abstract static class GeneratedCriteria {
         protected List<Criterion> criteria;
 
         protected GeneratedCriteria() {
             super();
-            criteria = new ArrayList<>();
+            criteria = new ArrayList<Criterion>();
         }
 
         public boolean isValid() {
@@ -835,6 +846,76 @@ public class CgiReplyBucketDataExample {
             return (Criteria) this;
         }
 
+        public Criteria andRootSourceIdIsNull() {
+            addCriterion("root_source_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdIsNotNull() {
+            addCriterion("root_source_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdEqualTo(String value) {
+            addCriterion("root_source_id =", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotEqualTo(String value) {
+            addCriterion("root_source_id <>", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdGreaterThan(String value) {
+            addCriterion("root_source_id >", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdGreaterThanOrEqualTo(String value) {
+            addCriterion("root_source_id >=", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLessThan(String value) {
+            addCriterion("root_source_id <", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLessThanOrEqualTo(String value) {
+            addCriterion("root_source_id <=", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdLike(String value) {
+            addCriterion("root_source_id like", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotLike(String value) {
+            addCriterion("root_source_id not like", value, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdIn(List<String> values) {
+            addCriterion("root_source_id in", values, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotIn(List<String> values) {
+            addCriterion("root_source_id not in", values, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdBetween(String value1, String value2) {
+            addCriterion("root_source_id between", value1, value2, "rootSourceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andRootSourceIdNotBetween(String value1, String value2) {
+            addCriterion("root_source_id not between", value1, value2, "rootSourceId");
+            return (Criteria) this;
+        }
+
         public Criteria andPagePathUrlIdIsNull() {
             addCriterion("page_path_url_id is null");
             return (Criteria) this;
@@ -1217,6 +1298,7 @@ public class CgiReplyBucketDataExample {
     }
 
     public static class Criteria extends GeneratedCriteria {
+
         protected Criteria() {
             super();
         }

+ 6 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/utils/MessageUtil.java

@@ -18,6 +18,12 @@ public class MessageUtil {
     }
 
     public static String getRootSourceId(String page) {
+        if(StringUtils.isEmpty(page)){
+            return null;
+        }
+        if(!page.contains("rootSourceId")){
+            return null;
+        }
         String translate = URLUtil.translate(page);
         if (translate.contains("rootSourceId=")) {
             String rootSourceId = translate.split("rootSourceId=")[1].split("&")[0];

+ 95 - 72
common-module/src/main/resources/mapper/CgiReplyBucketDataMapper.xml

@@ -13,6 +13,7 @@
     <result column="mini_app_id" jdbcType="VARCHAR" property="miniAppId" />
     <result column="mini_page_path" jdbcType="VARCHAR" property="miniPagePath" />
     <result column="mini_video_id" jdbcType="BIGINT" property="miniVideoId" />
+    <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
     <result column="page_path_url_id" jdbcType="BIGINT" property="pagePathUrlId" />
     <result column="news_publish_content_id" jdbcType="VARCHAR" property="newsPublishContentId" />
     <result column="plan_id" jdbcType="VARCHAR" property="planId" />
@@ -79,9 +80,9 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, strategy, sort, strategy_dt, gh_id, msg_type, title, cover_url, mini_app_id,
-    mini_page_path, mini_video_id, page_path_url_id, news_publish_content_id, plan_id,
-    is_delete, create_time, update_time
+    id, strategy, sort, strategy_dt, gh_id, msg_type, title, cover_url, mini_app_id, 
+    mini_page_path, mini_video_id, root_source_id, page_path_url_id, news_publish_content_id, 
+    plan_id, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample" resultMap="BaseResultMap">
     select
@@ -96,9 +97,12 @@
     <if test="orderByClause != null">
       order by ${orderByClause}
     </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
   </select>
   <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
-    select
+    select 
     <include refid="Base_Column_List" />
     from cgi_reply_bucket_data
     where id = #{id,jdbcType=BIGINT}
@@ -114,21 +118,20 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
-    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
-      SELECT LAST_INSERT_ID()
-    </selectKey>
-    insert into cgi_reply_bucket_data (strategy, sort, strategy_dt,
-      gh_id, msg_type, title,
-      cover_url, mini_app_id, mini_page_path,
-      mini_video_id, page_path_url_id, news_publish_content_id,
-      plan_id, is_delete, create_time,
-      update_time)
-    values (#{strategy,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, #{strategyDt,jdbcType=VARCHAR},
-      #{ghId,jdbcType=VARCHAR}, #{msgType,jdbcType=INTEGER}, #{title,jdbcType=VARCHAR},
-      #{coverUrl,jdbcType=VARCHAR}, #{miniAppId,jdbcType=VARCHAR}, #{miniPagePath,jdbcType=VARCHAR},
-      #{miniVideoId,jdbcType=BIGINT}, #{pagePathUrlId,jdbcType=BIGINT}, #{newsPublishContentId,jdbcType=VARCHAR},
-      #{planId,jdbcType=VARCHAR}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
-      #{updateTime,jdbcType=TIMESTAMP})
+    insert into cgi_reply_bucket_data (id, strategy, sort, 
+      strategy_dt, gh_id, msg_type, 
+      title, cover_url, mini_app_id, 
+      mini_page_path, mini_video_id, root_source_id, 
+      page_path_url_id, news_publish_content_id, plan_id, 
+      is_delete, create_time, update_time
+      )
+    values (#{id,jdbcType=BIGINT}, #{strategy,jdbcType=VARCHAR}, #{sort,jdbcType=INTEGER}, 
+      #{strategyDt,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, #{msgType,jdbcType=INTEGER}, 
+      #{title,jdbcType=VARCHAR}, #{coverUrl,jdbcType=VARCHAR}, #{miniAppId,jdbcType=VARCHAR}, 
+      #{miniPagePath,jdbcType=VARCHAR}, #{miniVideoId,jdbcType=BIGINT}, #{rootSourceId,jdbcType=VARCHAR}, 
+      #{pagePathUrlId,jdbcType=BIGINT}, #{newsPublishContentId,jdbcType=VARCHAR}, #{planId,jdbcType=VARCHAR}, 
+      #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData">
     <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
@@ -136,6 +139,9 @@
     </selectKey>
     insert into cgi_reply_bucket_data
     <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
       <if test="strategy != null">
         strategy,
       </if>
@@ -166,6 +172,9 @@
       <if test="miniVideoId != null">
         mini_video_id,
       </if>
+      <if test="rootSourceId != null">
+        root_source_id,
+      </if>
       <if test="pagePathUrlId != null">
         page_path_url_id,
       </if>
@@ -186,6 +195,9 @@
       </if>
     </trim>
     <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
       <if test="strategy != null">
         #{strategy,jdbcType=VARCHAR},
       </if>
@@ -216,6 +228,9 @@
       <if test="miniVideoId != null">
         #{miniVideoId,jdbcType=BIGINT},
       </if>
+      <if test="rootSourceId != null">
+        #{rootSourceId,jdbcType=VARCHAR},
+      </if>
       <if test="pagePathUrlId != null">
         #{pagePathUrlId,jdbcType=BIGINT},
       </if>
@@ -245,82 +260,86 @@
   <update id="updateByExampleSelective" parameterType="map">
     update cgi_reply_bucket_data
     <set>
-      <if test="row.id != null">
-        id = #{row.id,jdbcType=BIGINT},
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.strategy != null">
+        strategy = #{record.strategy,jdbcType=VARCHAR},
       </if>
-      <if test="row.strategy != null">
-        strategy = #{row.strategy,jdbcType=VARCHAR},
+      <if test="record.sort != null">
+        sort = #{record.sort,jdbcType=INTEGER},
       </if>
-      <if test="row.sort != null">
-        sort = #{row.sort,jdbcType=INTEGER},
+      <if test="record.strategyDt != null">
+        strategy_dt = #{record.strategyDt,jdbcType=VARCHAR},
       </if>
-      <if test="row.strategyDt != null">
-        strategy_dt = #{row.strategyDt,jdbcType=VARCHAR},
+      <if test="record.ghId != null">
+        gh_id = #{record.ghId,jdbcType=VARCHAR},
       </if>
-      <if test="row.ghId != null">
-        gh_id = #{row.ghId,jdbcType=VARCHAR},
+      <if test="record.msgType != null">
+        msg_type = #{record.msgType,jdbcType=INTEGER},
       </if>
-      <if test="row.msgType != null">
-        msg_type = #{row.msgType,jdbcType=INTEGER},
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
       </if>
-      <if test="row.title != null">
-        title = #{row.title,jdbcType=VARCHAR},
+      <if test="record.coverUrl != null">
+        cover_url = #{record.coverUrl,jdbcType=VARCHAR},
       </if>
-      <if test="row.coverUrl != null">
-        cover_url = #{row.coverUrl,jdbcType=VARCHAR},
+      <if test="record.miniAppId != null">
+        mini_app_id = #{record.miniAppId,jdbcType=VARCHAR},
       </if>
-      <if test="row.miniAppId != null">
-        mini_app_id = #{row.miniAppId,jdbcType=VARCHAR},
+      <if test="record.miniPagePath != null">
+        mini_page_path = #{record.miniPagePath,jdbcType=VARCHAR},
       </if>
-      <if test="row.miniPagePath != null">
-        mini_page_path = #{row.miniPagePath,jdbcType=VARCHAR},
+      <if test="record.miniVideoId != null">
+        mini_video_id = #{record.miniVideoId,jdbcType=BIGINT},
       </if>
-      <if test="row.miniVideoId != null">
-        mini_video_id = #{row.miniVideoId,jdbcType=BIGINT},
+      <if test="record.rootSourceId != null">
+        root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
       </if>
-      <if test="row.pagePathUrlId != null">
-        page_path_url_id = #{row.pagePathUrlId,jdbcType=BIGINT},
+      <if test="record.pagePathUrlId != null">
+        page_path_url_id = #{record.pagePathUrlId,jdbcType=BIGINT},
       </if>
-      <if test="row.newsPublishContentId != null">
-        news_publish_content_id = #{row.newsPublishContentId,jdbcType=VARCHAR},
+      <if test="record.newsPublishContentId != null">
+        news_publish_content_id = #{record.newsPublishContentId,jdbcType=VARCHAR},
       </if>
-      <if test="row.planId != null">
-        plan_id = #{row.planId,jdbcType=VARCHAR},
+      <if test="record.planId != null">
+        plan_id = #{record.planId,jdbcType=VARCHAR},
       </if>
-      <if test="row.isDelete != null">
-        is_delete = #{row.isDelete,jdbcType=INTEGER},
+      <if test="record.isDelete != null">
+        is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
-      <if test="row.createTime != null">
-        create_time = #{row.createTime,jdbcType=TIMESTAMP},
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
       </if>
-      <if test="row.updateTime != null">
-        update_time = #{row.updateTime,jdbcType=TIMESTAMP},
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       </if>
     </set>
-    <if test="example != null">
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
   <update id="updateByExample" parameterType="map">
     update cgi_reply_bucket_data
-    set id = #{row.id,jdbcType=BIGINT},
-      strategy = #{row.strategy,jdbcType=VARCHAR},
-      sort = #{row.sort,jdbcType=INTEGER},
-      strategy_dt = #{row.strategyDt,jdbcType=VARCHAR},
-      gh_id = #{row.ghId,jdbcType=VARCHAR},
-      msg_type = #{row.msgType,jdbcType=INTEGER},
-      title = #{row.title,jdbcType=VARCHAR},
-      cover_url = #{row.coverUrl,jdbcType=VARCHAR},
-      mini_app_id = #{row.miniAppId,jdbcType=VARCHAR},
-      mini_page_path = #{row.miniPagePath,jdbcType=VARCHAR},
-      mini_video_id = #{row.miniVideoId,jdbcType=BIGINT},
-      page_path_url_id = #{row.pagePathUrlId,jdbcType=BIGINT},
-      news_publish_content_id = #{row.newsPublishContentId,jdbcType=VARCHAR},
-      plan_id = #{row.planId,jdbcType=VARCHAR},
-      is_delete = #{row.isDelete,jdbcType=INTEGER},
-      create_time = #{row.createTime,jdbcType=TIMESTAMP},
-      update_time = #{row.updateTime,jdbcType=TIMESTAMP}
-    <if test="example != null">
+    set id = #{record.id,jdbcType=BIGINT},
+      strategy = #{record.strategy,jdbcType=VARCHAR},
+      sort = #{record.sort,jdbcType=INTEGER},
+      strategy_dt = #{record.strategyDt,jdbcType=VARCHAR},
+      gh_id = #{record.ghId,jdbcType=VARCHAR},
+      msg_type = #{record.msgType,jdbcType=INTEGER},
+      title = #{record.title,jdbcType=VARCHAR},
+      cover_url = #{record.coverUrl,jdbcType=VARCHAR},
+      mini_app_id = #{record.miniAppId,jdbcType=VARCHAR},
+      mini_page_path = #{record.miniPagePath,jdbcType=VARCHAR},
+      mini_video_id = #{record.miniVideoId,jdbcType=BIGINT},
+      root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
+      page_path_url_id = #{record.pagePathUrlId,jdbcType=BIGINT},
+      news_publish_content_id = #{record.newsPublishContentId,jdbcType=VARCHAR},
+      plan_id = #{record.planId,jdbcType=VARCHAR},
+      is_delete = #{record.isDelete,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
   </update>
@@ -357,6 +376,9 @@
       <if test="miniVideoId != null">
         mini_video_id = #{miniVideoId,jdbcType=BIGINT},
       </if>
+      <if test="rootSourceId != null">
+        root_source_id = #{rootSourceId,jdbcType=VARCHAR},
+      </if>
       <if test="pagePathUrlId != null">
         page_path_url_id = #{pagePathUrlId,jdbcType=BIGINT},
       </if>
@@ -390,6 +412,7 @@
       mini_app_id = #{miniAppId,jdbcType=VARCHAR},
       mini_page_path = #{miniPagePath,jdbcType=VARCHAR},
       mini_video_id = #{miniVideoId,jdbcType=BIGINT},
+      root_source_id = #{rootSourceId,jdbcType=VARCHAR},
       page_path_url_id = #{pagePathUrlId,jdbcType=BIGINT},
       news_publish_content_id = #{newsPublishContentId,jdbcType=VARCHAR},
       plan_id = #{planId,jdbcType=VARCHAR},

+ 23 - 0
offline-module/src/main/java/com/tzld/piaoquan/offline/job/AutoReplyVideoDataJob.java

@@ -17,6 +17,8 @@ import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.LarkRobotUtil;
+import com.tzld.piaoquan.growth.common.utils.MessageUtil;
+import com.tzld.piaoquan.growth.common.utils.page.Page;
 import com.xxl.job.core.biz.model.ReturnT;
 import com.xxl.job.core.handler.annotation.XxlJob;
 import lombok.extern.slf4j.Slf4j;
@@ -221,4 +223,25 @@ public class AutoReplyVideoDataJob {
         return columns;
     }
 
+    @XxlJob("updateRootSourceIdJob")
+    public ReturnT<String> updateRootSourceId(String param) {
+        CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
+        example.createCriteria().andRootSourceIdIsNull();
+        List<CgiReplyBucketData> cgiReplyBucketData = cgiReplyBucketDataMapper.selectByExample(example);
+        if (!CollectionUtils.isEmpty(cgiReplyBucketData)) {
+            for (CgiReplyBucketData replyBucketData : cgiReplyBucketData) {
+                String rootSourceId = MessageUtil.getRootSourceId(replyBucketData.getMiniPagePath());
+                if(StringUtils.isEmpty(rootSourceId)){
+                    continue;
+                }
+                CgiReplyBucketData updateReplyBucketData = new CgiReplyBucketData();
+                updateReplyBucketData.setId(replyBucketData.getId());
+                updateReplyBucketData.setRootSourceId(rootSourceId);
+                cgiReplyBucketDataMapper.updateByPrimaryKeySelective(updateReplyBucketData);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
 }