package com.docus.server.collect.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.docus.server.collect.domain.TaskConfig;
import com.docus.server.collect.infrastructure.mapper.TaskConfigMapper;
import com.docus.server.collect.service.ITaskConfigService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

@Service
public class TaskConfigServiceImpl extends ServiceImpl<TaskConfigMapper, TaskConfig> implements ITaskConfigService {
    @Transactional
    @Override
    public void updateAllPointerDate(String id, Date date) {
        TaskConfig taskConfig = super.getById(id);
        taskConfig.setAllPointerTime(date);
        super.updateById(taskConfig);
    }

    @Transactional
    @Override
    public void updateIncPointerDate(String id, Date date) {
        TaskConfig taskConfig = super.getById(id);
        taskConfig.setIncPointerTime(date);
        super.updateById(taskConfig);
    }


    @Override
    public TaskConfig getTaskConfig(String id) {
        return super.getById(id);
    }

}
