package org.springblade.dataextraction.service;

import org.springblade.dataextraction.enity.FinOrderFetchTask;
import org.springblade.dataextraction.mapper.FinOrderFetchTaskMapper;
import org.springframework.stereotype.Service;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

/**
 * @Desc
 * @Author William
 * @DateTime 2022 下午4:32:45
 */
@DS("slave")
@Service
public class FinOrderFetchTaskService extends ServiceImpl<FinOrderFetchTaskMapper, FinOrderFetchTask> {
	
	public int nextTaskId() {
		return baseMapper.nextTaskId();
	}
	
	public void startTask(int taskId) {
		baseMapper.startTask(String.valueOf(taskId));
	}
	
	public FinOrderFetchTask get(int taskId) {
		QueryWrapper<FinOrderFetchTask> wrapper = new QueryWrapper<>();
		wrapper.eq("TASKID", taskId);
		return getOne(wrapper);
	}
	
	public Object getFile(int taskId) {
		return baseMapper.getFile(taskId);
	}
	
	/**
	 * 自订购以来 查询批量导入号码数量限制
	 * 
	 * @return
	 */
	public int getMaxRowsImport() {
		return baseMapper.getMaxRowsImport();
	}
}
