Procházet zdrojové kódy

Merge branch 'dev-xym-add-deepseek' of Server/features-tools into master

xueyiming před 2 měsíci
rodič
revize
b4e5f71723

+ 2 - 0
src/main/java/com/tzld/piaoquan/featurestools/dao/mapper/CreativeVideoUnderstanderMapper.java

@@ -33,4 +33,6 @@ public interface CreativeVideoUnderstanderMapper {
     int updateByPrimaryKeyWithBLOBs(CreativeVideoUnderstander record);
 
     int updateByPrimaryKey(CreativeVideoUnderstander record);
+
+    List<Integer> selectPriority();
 }

+ 6 - 1
src/main/java/com/tzld/piaoquan/featurestools/job/CreativeVideoUnderstandJob.java

@@ -62,8 +62,13 @@ public class CreativeVideoUnderstandJob {
                     countDownLatch.countDown();
                 }));
             }
+            List<Integer> priorityList = creativeVideoUnderstanderMapper.selectPriority();
+            if (CollectionUtils.isEmpty(priorityList)) {
+                return ReturnT.SUCCESS;
+            }
+            Integer first = priorityList.get(0);
             CreativeVideoUnderstanderExample example = new CreativeVideoUnderstanderExample();
-            example.createCriteria().andStatusEqualTo(0);
+            example.createCriteria().andStatusEqualTo(0).andPriorityEqualTo(first);
             long count = creativeVideoUnderstanderMapper.countByExample(example);
             int pageSize = 1000;
             int pageNum = (int) (count / pageSize) + 1;

+ 11 - 0
src/main/java/com/tzld/piaoquan/featurestools/model/po/CreativeVideoUnderstander.java

@@ -15,6 +15,8 @@ public class CreativeVideoUnderstander {
 
     private Date videoFileExpireTime;
 
+    private Integer priority;
+
     private Integer retryCount;
 
     private Integer status;
@@ -73,6 +75,14 @@ public class CreativeVideoUnderstander {
         this.videoFileExpireTime = videoFileExpireTime;
     }
 
+    public Integer getPriority() {
+        return priority;
+    }
+
+    public void setPriority(Integer priority) {
+        this.priority = priority;
+    }
+
     public Integer getRetryCount() {
         return retryCount;
     }
@@ -125,6 +135,7 @@ public class CreativeVideoUnderstander {
         sb.append(", videoFileName=").append(videoFileName);
         sb.append(", videoFileStatus=").append(videoFileStatus);
         sb.append(", videoFileExpireTime=").append(videoFileExpireTime);
+        sb.append(", priority=").append(priority);
         sb.append(", retryCount=").append(retryCount);
         sb.append(", status=").append(status);
         sb.append(", createTime=").append(createTime);

+ 60 - 0
src/main/java/com/tzld/piaoquan/featurestools/model/po/CreativeVideoUnderstanderExample.java

@@ -506,6 +506,66 @@ public class CreativeVideoUnderstanderExample {
             return (Criteria) this;
         }
 
+        public Criteria andPriorityIsNull() {
+            addCriterion("priority is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityIsNotNull() {
+            addCriterion("priority is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityEqualTo(Integer value) {
+            addCriterion("priority =", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityNotEqualTo(Integer value) {
+            addCriterion("priority <>", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityGreaterThan(Integer value) {
+            addCriterion("priority >", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityGreaterThanOrEqualTo(Integer value) {
+            addCriterion("priority >=", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityLessThan(Integer value) {
+            addCriterion("priority <", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityLessThanOrEqualTo(Integer value) {
+            addCriterion("priority <=", value, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityIn(List<Integer> values) {
+            addCriterion("priority in", values, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityNotIn(List<Integer> values) {
+            addCriterion("priority not in", values, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityBetween(Integer value1, Integer value2) {
+            addCriterion("priority between", value1, value2, "priority");
+            return (Criteria) this;
+        }
+
+        public Criteria andPriorityNotBetween(Integer value1, Integer value2) {
+            addCriterion("priority not between", value1, value2, "priority");
+            return (Criteria) this;
+        }
+
         public Criteria andRetryCountIsNull() {
             addCriterion("retry_count is null");
             return (Criteria) this;

+ 31 - 5
src/main/resources/mapper/CreativeVideoUnderstanderMapper.xml

@@ -8,6 +8,7 @@
     <result column="video_file_name" jdbcType="VARCHAR" property="videoFileName" />
     <result column="video_file_status" jdbcType="VARCHAR" property="videoFileStatus" />
     <result column="video_file_expire_time" jdbcType="TIMESTAMP" property="videoFileExpireTime" />
+    <result column="priority" jdbcType="INTEGER" property="priority" />
     <result column="retry_count" jdbcType="INTEGER" property="retryCount" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
@@ -76,7 +77,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, creative_id, video_url, video_file_name, video_file_status, video_file_expire_time, 
-    retry_count, `status`, create_time, update_time
+    priority, retry_count, `status`, create_time, update_time
   </sql>
   <sql id="Blob_Column_List">
     understander_text
@@ -138,12 +139,14 @@
   <insert id="insert" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander">
     insert into creative_video_understander (id, creative_id, video_url, 
       video_file_name, video_file_status, video_file_expire_time, 
-      retry_count, `status`, create_time, 
-      update_time, understander_text)
+      priority, retry_count, `status`, 
+      create_time, update_time, understander_text
+      )
     values (#{id,jdbcType=BIGINT}, #{creativeId,jdbcType=BIGINT}, #{videoUrl,jdbcType=VARCHAR}, 
       #{videoFileName,jdbcType=VARCHAR}, #{videoFileStatus,jdbcType=VARCHAR}, #{videoFileExpireTime,jdbcType=TIMESTAMP}, 
-      #{retryCount,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP}, #{understanderText,jdbcType=LONGVARCHAR})
+      #{priority,jdbcType=INTEGER}, #{retryCount,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{understanderText,jdbcType=LONGVARCHAR}
+      )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.featurestools.model.po.CreativeVideoUnderstander">
     insert into creative_video_understander
@@ -166,6 +169,9 @@
       <if test="videoFileExpireTime != null">
         video_file_expire_time,
       </if>
+      <if test="priority != null">
+        priority,
+      </if>
       <if test="retryCount != null">
         retry_count,
       </if>
@@ -201,6 +207,9 @@
       <if test="videoFileExpireTime != null">
         #{videoFileExpireTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="priority != null">
+        #{priority,jdbcType=INTEGER},
+      </if>
       <if test="retryCount != null">
         #{retryCount,jdbcType=INTEGER},
       </if>
@@ -245,6 +254,9 @@
       <if test="record.videoFileExpireTime != null">
         video_file_expire_time = #{record.videoFileExpireTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="record.priority != null">
+        priority = #{record.priority,jdbcType=INTEGER},
+      </if>
       <if test="record.retryCount != null">
         retry_count = #{record.retryCount,jdbcType=INTEGER},
       </if>
@@ -273,6 +285,7 @@
       video_file_name = #{record.videoFileName,jdbcType=VARCHAR},
       video_file_status = #{record.videoFileStatus,jdbcType=VARCHAR},
       video_file_expire_time = #{record.videoFileExpireTime,jdbcType=TIMESTAMP},
+      priority = #{record.priority,jdbcType=INTEGER},
       retry_count = #{record.retryCount,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -290,6 +303,7 @@
       video_file_name = #{record.videoFileName,jdbcType=VARCHAR},
       video_file_status = #{record.videoFileStatus,jdbcType=VARCHAR},
       video_file_expire_time = #{record.videoFileExpireTime,jdbcType=TIMESTAMP},
+      priority = #{record.priority,jdbcType=INTEGER},
       retry_count = #{record.retryCount,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
@@ -316,6 +330,9 @@
       <if test="videoFileExpireTime != null">
         video_file_expire_time = #{videoFileExpireTime,jdbcType=TIMESTAMP},
       </if>
+      <if test="priority != null">
+        priority = #{priority,jdbcType=INTEGER},
+      </if>
       <if test="retryCount != null">
         retry_count = #{retryCount,jdbcType=INTEGER},
       </if>
@@ -341,6 +358,7 @@
       video_file_name = #{videoFileName,jdbcType=VARCHAR},
       video_file_status = #{videoFileStatus,jdbcType=VARCHAR},
       video_file_expire_time = #{videoFileExpireTime,jdbcType=TIMESTAMP},
+      priority = #{priority,jdbcType=INTEGER},
       retry_count = #{retryCount,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
@@ -355,10 +373,18 @@
       video_file_name = #{videoFileName,jdbcType=VARCHAR},
       video_file_status = #{videoFileStatus,jdbcType=VARCHAR},
       video_file_expire_time = #{videoFileExpireTime,jdbcType=TIMESTAMP},
+      priority = #{priority,jdbcType=INTEGER},
       retry_count = #{retryCount,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}
     where id = #{id,jdbcType=BIGINT}
   </update>
+
+  <select id="selectPriority"  resultType="java.lang.Integer">
+    select distinct priority
+    from creative_video_understander
+    where status = 0
+    order by priority desc
+  </select>
 </mapper>

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

@@ -49,8 +49,9 @@
                              targetProject="/Users/shimeng/Desktop/project/features-tools/src/main/java">
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
+        <table tableName="creative_video_understander" domainObjectName="CreativeVideoUnderstander" alias=""/>
 
-        <table tableName="creative_video_understander_summarize" domainObjectName="CreativeVideoSummarize" alias=""/>
+<!--        <table tableName="creative_video_understander_summarize" domainObjectName="CreativeVideoSummarize" alias=""/>-->
 
     </context>