package com.willalp.flow.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.willalp.flow.domain.HsFlowRunningRecord;
import com.willalp.flow.domain.enums.FlowEnum;
import com.willalp.flow.mapper.HsFlowRunningRecordMapper;
import com.willalp.flow.service.IHsFlowRunningRecordService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 流程运行记录Service业务层处理
 *
 * @author willalp
 * @date 2022-10-09
 */
@Service
public class HsFlowRunningRecordServiceImpl extends ServiceImpl<HsFlowRunningRecordMapper, HsFlowRunningRecord>  implements IHsFlowRunningRecordService
{
    @Resource
    private HsFlowRunningRecordMapper hsFlowRunningRecordMapper;

    /**
     * 查询流程运行记录列表
     *
     * @param hsFlowRunningRecord 流程运行记录
     * @return 流程运行记录
     */
    @Override
    public List<HsFlowRunningRecord> selectHsFlowRunningRecordList(HsFlowRunningRecord hsFlowRunningRecord)
    {
        return hsFlowRunningRecordMapper.selectHsFlowRunningRecordList(hsFlowRunningRecord);
    }

    @Override
    public List<HsFlowRunningRecord> selectHsFlowRunningRecordTrue(String taskId) {
        return hsFlowRunningRecordMapper.selectHsFlowRunningRecordTrue(taskId, FlowEnum.RESULT_TRUE.getValue());
    }

    @Override
    public List<HsFlowRunningRecord> getFlowRecordByBusinessId(String businessId) {
        return hsFlowRunningRecordMapper.getFlowRecordByBusinessId(businessId);
    }
}
