package com.zcxk.track.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zcxk.track.dao.TaskTrackMapper;
import com.zcxk.track.entity.TaskTrack;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;


/**
 * 任务轨迹服务接口
 *
 * @author yjy
 * @since 2021-1-16
 */
@Service
public class TaskTrackService extends ServiceImpl<TaskTrackMapper, TaskTrack> {
    @Resource
    private TaskTrackMapper taskTrackMapper;
    /**
     * 增加数据
     *
     * @param
     * @return
     */
    public boolean insert(TaskTrack taskTrack) {
        return this.save(taskTrack);
    }
    /**
     * 修改数据
     *
     * @param
     * @return
     */
    public boolean updateTrack(TaskTrack taskTrack) {
        return  this.updateById(taskTrack);
    }
    /**
     * 查询数据
     *
     * @param
     * @return 单条数据
     */
    public TaskTrack selectTaskTrack(Integer taskId,Integer userId){
        return this.getOne(new QueryWrapper<TaskTrack>().eq("USER_ID",userId)
                .eq("TASK_ID",taskId));
    }
}
