package com.gyee.frame.service.impl.ticket;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.gyee.frame.model.ticket.Wftaskassign;
import com.gyee.frame.mapper.ticket.WftaskassignMapper;
import com.gyee.frame.service.ticket.WftaskassignService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author chenmh
 * @since 2020-07-21
 */
@Service
public class WftaskassignServiceImpl extends ServiceImpl<WftaskassignMapper, Wftaskassign> implements WftaskassignService {

    @Override
    public List<Wftaskassign> listTaskAssign(double version, String wfName) {
        QueryWrapper<Wftaskassign> wrapper = new QueryWrapper<>();
        wrapper.eq("WFREVISION", version);
        wrapper.eq("WFNAME", wfName);

        List<Wftaskassign> wftaskassigns = baseMapper.selectList(wrapper);

        return wftaskassigns;
    }

    @Override
    public Wftaskassign taskAssign(double nodeId, double version, String wfName) {
        QueryWrapper<Wftaskassign> wrapper = new QueryWrapper<>();
        wrapper.eq("WFREVISION", version);
        wrapper.eq("WFNAME", wfName);
        wrapper.eq("NODEID", nodeId);

        Wftaskassign wftaskassign = baseMapper.selectOne(wrapper);

        return wftaskassign;
    }
}
