Browse Source

疏浚数据修改video_id

zoro 1 year ago
parent
commit
7dc546638a

+ 4 - 1
src/main/java/com/ghjg/shoreline/Schedule/DredgeVideoIdSchedule.java

@@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
+import javax.annotation.PostConstruct;
+
 /**
  * @ClassName: DredgVideoIdSchedule
  * @description: TODO
@@ -23,7 +25,8 @@ public class DredgeVideoIdSchedule {
   @Autowired
   private DredgingProjectShipsService shipsService;
 
-  @Scheduled(cron = "0 0 3 * * ? ")
+  //@Scheduled(cron = "0 0 3 * * ? ")
+  @PostConstruct
   public void updateVideoIdSchedule(){
     List<String> dredgingImportRules =  shipsService.getAllProjectId();
     for (String dredgingImportRule : dredgingImportRules) {

+ 3 - 0
src/main/java/com/ghjg/shoreline/mapper/DredgingProjectShipsMapper.java

@@ -2,11 +2,14 @@ package com.ghjg.shoreline.mapper;
 
 import com.ghjg.shoreline.dto.DredgingProjectShips;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.apache.ibatis.annotations.Mapper;
+
 import java.util.List;
 
 /**
  * @Entity com.ghjg.shoreline.dto.DredgingProjectShips
  */
+@Mapper
 public interface DredgingProjectShipsMapper extends BaseMapper<DredgingProjectShips> {
 
   List<String> getAllProjectId();

+ 1 - 1
src/main/resources/mapper/DredgingProjectShipsMapper.xml

@@ -29,7 +29,7 @@
         ID,VIDEO_ID
     </sql>
   <update id="updateVideoId">
-    update GHJG_CHANNEL.DREDGING_PROJECT_SHIPS SET VIDEO_ID = #{videoId} WHERE NAME = #{Name}
+    update GHJG_CHANNEL.DREDGING_PROJECT_SHIPS SET VIDEO_ID = #{videoId} WHERE NAME = #{Name} and overview_id = #{overviewId}
   </update>
   <select id="getAllProjectId" resultType="java.lang.String">
     select project_overview_id from GHJG_CHANNEL.DREDGING_IMPORT_RULE where IS_USEFUL = 0