Browse Source

查询增加字段

xueyiming 7 months ago
parent
commit
8c7aa14f12

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/MatchVideo.java

@@ -27,6 +27,8 @@ public class MatchVideo {
 
     private Integer processTimes;
 
+    private Integer publishFlag;
+
     private String response;
 
     public Integer getId() {
@@ -125,6 +127,14 @@ public class MatchVideo {
         this.processTimes = processTimes;
     }
 
+    public Integer getPublishFlag() {
+        return publishFlag;
+    }
+
+    public void setPublishFlag(Integer publishFlag) {
+        this.publishFlag = publishFlag;
+    }
+
     public String getResponse() {
         return response;
     }
@@ -151,6 +161,7 @@ public class MatchVideo {
         sb.append(", requestTimestamp=").append(requestTimestamp);
         sb.append(", updateTime=").append(updateTime);
         sb.append(", processTimes=").append(processTimes);
+        sb.append(", publishFlag=").append(publishFlag);
         sb.append(", response=").append(response);
         sb.append("]");
         return sb.toString();

+ 60 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/MatchVideoExample.java

@@ -885,6 +885,66 @@ public class MatchVideoExample {
             addCriterion("process_times not between", value1, value2, "processTimes");
             return (Criteria) this;
         }
+
+        public Criteria andPublishFlagIsNull() {
+            addCriterion("publish_flag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagIsNotNull() {
+            addCriterion("publish_flag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagEqualTo(Integer value) {
+            addCriterion("publish_flag =", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagNotEqualTo(Integer value) {
+            addCriterion("publish_flag <>", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagGreaterThan(Integer value) {
+            addCriterion("publish_flag >", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagGreaterThanOrEqualTo(Integer value) {
+            addCriterion("publish_flag >=", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagLessThan(Integer value) {
+            addCriterion("publish_flag <", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagLessThanOrEqualTo(Integer value) {
+            addCriterion("publish_flag <=", value, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagIn(List<Integer> values) {
+            addCriterion("publish_flag in", values, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagNotIn(List<Integer> values) {
+            addCriterion("publish_flag not in", values, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagBetween(Integer value1, Integer value2) {
+            addCriterion("publish_flag between", value1, value2, "publishFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishFlagNotBetween(Integer value1, Integer value2) {
+            addCriterion("publish_flag not between", value1, value2, "publishFlag");
+            return (Criteria) this;
+        }
     }
 
     public static class Criteria extends GeneratedCriteria {

+ 6 - 4
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java

@@ -40,9 +40,10 @@ public class ContentServiceImpl implements ContentService {
     @Autowired
     private PublishContentMapper publishContentMapper;
 
-    public MatchVideo getContent(String contentId, String ghId) {
+    public MatchVideo getContent(String contentId, String ghId, Integer publishFlag) {
         MatchVideoExample matchVideoExample = new MatchVideoExample();
-        matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId);
+        matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId)
+                .andPublishFlagEqualTo(publishFlag);
         List<MatchVideo> matchVideos = matchVideoMapper.selectByExample(matchVideoExample);
         if (CollectionUtils.isEmpty(matchVideos)) {
             return null;
@@ -60,9 +61,10 @@ public class ContentServiceImpl implements ContentService {
         return publishMiniprograms;
     }
 
-    public String updateMatchContent(String contentId, String ghId, JSONArray jsonArray) {
+    public String updateMatchContent(String contentId, String ghId, JSONArray jsonArray, Integer publishFlag) {
         MatchVideoExample matchVideoExample = new MatchVideoExample();
-        matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId);
+        matchVideoExample.createCriteria().andGhIdEqualTo(ghId).andContentIdEqualTo(contentId)
+                .andPublishFlagEqualTo(publishFlag);
         List<MatchVideo> matchVideos = matchVideoMapper.selectByExample(matchVideoExample);
         if (CollectionUtils.isEmpty(matchVideos)) {
             return null;

+ 2 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -232,7 +232,7 @@ public class CoreServiceImpl implements CoreService {
                     try {
                         MatchContent matchContent = queue.take();
                         log.info("matchContent={}", matchContent);
-                        MatchVideo content = contentService.getContent(matchContent.getSourceId(), matchContent.getGhId());
+                        MatchVideo content = contentService.getContent(matchContent.getSourceId(), matchContent.getGhId(), 2);
                         if (content != null) {
                             Integer contentStatus = content.getContentStatus();
                             if (ContentStatusEnum.isSuccess(contentStatus)) {
@@ -540,7 +540,7 @@ public class CoreServiceImpl implements CoreService {
                         publishMiniprogramMapper.insertSelective(publishMiniprogram);
                         publishMiniprogramList.add(publishMiniprogram);
                     }
-                    String traceId = contentService.updateMatchContent(publishArticleData.getSourceId(), planAccount.getGhId(), jsonArray);
+                    String traceId = contentService.updateMatchContent(publishArticleData.getSourceId(), planAccount.getGhId(), jsonArray, 2);
                     contentService.updatePublishContentTraceId(traceId, publishContent.getId());
                 }
 

+ 24 - 5
long-article-server/src/main/resources/mapper/MatchVideoMapper.xml

@@ -14,6 +14,7 @@
     <result column="request_timestamp" jdbcType="INTEGER" property="requestTimestamp" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
     <result column="process_times" jdbcType="INTEGER" property="processTimes" />
+    <result column="publish_flag" jdbcType="INTEGER" property="publishFlag" />
   </resultMap>
   <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="com.tzld.piaoquan.longarticle.model.po.MatchVideo">
     <result column="response" jdbcType="LONGVARCHAR" property="response" />
@@ -78,7 +79,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, trace_id, content_id, flow_pool_level, gh_id, account_name, content_status, content_status_update_time, 
-    success_status, request_timestamp, update_time, process_times
+    success_status, request_timestamp, update_time, process_times, publish_flag
   </sql>
   <sql id="Blob_Column_List">
     response
@@ -142,12 +143,14 @@
       flow_pool_level, gh_id, account_name, 
       content_status, content_status_update_time, 
       success_status, request_timestamp, update_time, 
-      process_times, response)
+      process_times, publish_flag, response
+      )
     values (#{id,jdbcType=INTEGER}, #{traceId,jdbcType=VARCHAR}, #{contentId,jdbcType=VARCHAR}, 
       #{flowPoolLevel,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, 
       #{contentStatus,jdbcType=INTEGER}, #{contentStatusUpdateTime,jdbcType=INTEGER}, 
       #{successStatus,jdbcType=INTEGER}, #{requestTimestamp,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, 
-      #{processTimes,jdbcType=INTEGER}, #{response,jdbcType=LONGVARCHAR})
+      #{processTimes,jdbcType=INTEGER}, #{publishFlag,jdbcType=INTEGER}, #{response,jdbcType=LONGVARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.MatchVideo">
     insert into long_articles_match_videos
@@ -188,6 +191,9 @@
       <if test="processTimes != null">
         process_times,
       </if>
+      <if test="publishFlag != null">
+        publish_flag,
+      </if>
       <if test="response != null">
         response,
       </if>
@@ -229,6 +235,9 @@
       <if test="processTimes != null">
         #{processTimes,jdbcType=INTEGER},
       </if>
+      <if test="publishFlag != null">
+        #{publishFlag,jdbcType=INTEGER},
+      </if>
       <if test="response != null">
         #{response,jdbcType=LONGVARCHAR},
       </if>
@@ -279,6 +288,9 @@
       <if test="record.processTimes != null">
         process_times = #{record.processTimes,jdbcType=INTEGER},
       </if>
+      <if test="record.publishFlag != null">
+        publish_flag = #{record.publishFlag,jdbcType=INTEGER},
+      </if>
       <if test="record.response != null">
         response = #{record.response,jdbcType=LONGVARCHAR},
       </if>
@@ -301,6 +313,7 @@
       request_timestamp = #{record.requestTimestamp,jdbcType=INTEGER},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP},
       process_times = #{record.processTimes,jdbcType=INTEGER},
+      publish_flag = #{record.publishFlag,jdbcType=INTEGER},
       response = #{record.response,jdbcType=LONGVARCHAR}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
@@ -319,7 +332,8 @@
       success_status = #{record.successStatus,jdbcType=INTEGER},
       request_timestamp = #{record.requestTimestamp,jdbcType=INTEGER},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP},
-      process_times = #{record.processTimes,jdbcType=INTEGER}
+      process_times = #{record.processTimes,jdbcType=INTEGER},
+      publish_flag = #{record.publishFlag,jdbcType=INTEGER}
     <if test="_parameter != null">
       <include refid="Update_By_Example_Where_Clause" />
     </if>
@@ -360,6 +374,9 @@
       <if test="processTimes != null">
         process_times = #{processTimes,jdbcType=INTEGER},
       </if>
+      <if test="publishFlag != null">
+        publish_flag = #{publishFlag,jdbcType=INTEGER},
+      </if>
       <if test="response != null">
         response = #{response,jdbcType=LONGVARCHAR},
       </if>
@@ -379,6 +396,7 @@
       request_timestamp = #{requestTimestamp,jdbcType=INTEGER},
       update_time = #{updateTime,jdbcType=TIMESTAMP},
       process_times = #{processTimes,jdbcType=INTEGER},
+      publish_flag = #{publishFlag,jdbcType=INTEGER},
       response = #{response,jdbcType=LONGVARCHAR}
     where id = #{id,jdbcType=INTEGER}
   </update>
@@ -394,7 +412,8 @@
       success_status = #{successStatus,jdbcType=INTEGER},
       request_timestamp = #{requestTimestamp,jdbcType=INTEGER},
       update_time = #{updateTime,jdbcType=TIMESTAMP},
-      process_times = #{processTimes,jdbcType=INTEGER}
+      process_times = #{processTimes,jdbcType=INTEGER},
+      publish_flag = #{publishFlag,jdbcType=INTEGER}
     where id = #{id,jdbcType=INTEGER}
   </update>
 </mapper>

+ 2 - 2
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -49,7 +49,7 @@
                              targetProject="/Users/shimeng/Desktop/project/long-article-manage/long-article-server/src/main/java">
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
-<!--        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="">-->
+        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="" />
 <!--            <columnOverride column="response" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_text" domainObjectName="LongArticlesText" alias="">-->
@@ -63,7 +63,7 @@
 <!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
 <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 
-                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>
+<!--                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
 <!--                <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>-->
 
     </context>