package com.sqx.modules.taskCenter.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sqx.modules.taskCenter.dao.TaskCenterRecordDao;
import com.sqx.modules.taskCenter.entity.TaskCenterRecord;
import com.sqx.modules.taskCenter.service.TaskCenterRecordService;
import org.springframework.stereotype.Service;

import java.util.Set;

@Service
public class TaskCenterRecordServiceImpl extends ServiceImpl<TaskCenterRecordDao, TaskCenterRecord> implements TaskCenterRecordService {


    @Override
    public Integer countTaskNum(Long userId, Long taskId, String time) {
        return baseMapper.countTaskNum(userId, taskId, time);
    }

    @Override
    public Integer countTaskNum(Set<Long> userId, Long taskId, String time) {
        TaskCenterRecord record = baseMapper.countTaskNumByUserIds(userId, taskId, time);
        return record == null ? 0 : 1;
    }
}

