
package org.jeecg.modules.workFlow.flowlong.mybatisplus.mapper;

import org.jeecg.modules.workFlow.flowlong.engine.assist.Assert;
import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwHisTask;
import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwTask;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * 历史任务 Mapper
 *

 */
public interface FlwHisTaskMapper extends BaseMapper<FlwHisTask> {

    /**
     * 获取历史任务并检查ID的合法性
     *
     * @param id 任务ID
     * @return {@link FlwTask}
     */
    default FlwHisTask getCheckById(Long id) {
        FlwHisTask hisTask = selectById(id);
        Assert.isNull(hisTask, "指定的任务[id=" + id + "]不存在");
        return hisTask;
    }
}
