package com.iplatform.recvideo.service;
|
|
import com.iplatform.model.po.Rc_task_status;
|
import com.iplatform.model.po.Rc_video_batch;
|
import com.iplatform.reccommon.TaskType;
|
import com.walker.jdbc.service.BaseServiceImpl;
|
import org.springframework.stereotype.Service;
|
|
import java.util.List;
|
import java.util.Map;
|
|
@Service
|
public class VideoLoaderServiceImpl extends BaseServiceImpl {
|
|
private static final String SQL_NEXT_BATCH = "select max(last_value) next_batch_id from rc_task_status where task_type=? and (status='0' or status='1')";
|
|
/**
|
* 查找当前记录中已有的最大批次值。
|
* @return
|
* @date 2022-09-26
|
*/
|
public long queryNextBatchValue(){
|
Map<String, Object> nextBatchMap = this.get(SQL_NEXT_BATCH, new Object[]{TaskType.INDEX_VIDEO_LOAD});
|
if(nextBatchMap == null){
|
return 0;
|
}
|
if(nextBatchMap.get("next_batch_id") == null){
|
return 0;
|
}
|
return Long.parseLong(nextBatchMap.get("next_batch_id").toString());
|
}
|
|
/**
|
* 保存批次视频记录,并添加新的(相似度检索)状态。
|
* @param videoBatchList
|
* @param status
|
* @return
|
* @date 2022-09-26
|
*/
|
public int execSaveBatchAndStatus(List<Rc_video_batch> videoBatchList, Rc_task_status status){
|
this.save(videoBatchList);
|
// this.save(status);
|
return videoBatchList.size();
|
}
|
}
|