package com.qmth.distributed.print.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.qmth.distributed.print.business.bean.dto.approvalForm.ApprovalInfo;
import com.qmth.distributed.print.business.bean.result.TFFlowLogResult;
import com.qmth.distributed.print.business.entity.TFFlowLog;
import com.qmth.teachcloud.common.enums.FlowApproveOperationEnum;

import java.util.List;

/**
 * <p>
 * 流程流水表 服务类
 * </p>
 *
 * @author wangliang
 * @since 2021-08-02
 */
public interface TFFlowLogService extends IService<TFFlowLog> {

    /**
     * 根据流程id查询流程状态
     *
     * @param flowId
     * @param schoolId
     * @return
     */
    List<TFFlowLog> findByFlowId(Long flowId, Long schoolId);

    /**
     * 根据实体id查询
     *
     * @param objectId
     * @return
     */
    List<TFFlowLogResult> findByObjectId(Long objectId);

    /**
     * 查找最后一条审批记录
     *
     * @param flowId
     * @param schoolId
     * @param flowApproveOperationEnum
     * @return
     */
    TFFlowLog findByLast(Long flowId, Long schoolId, FlowApproveOperationEnum flowApproveOperationEnum);

    /**
     * 根据流程id查询审批表
     *
     * @param flowId 流程id
     * @return 审批表
     */
    List<ApprovalInfo> findApprovalInfoByFlowId(Long flowId);
}
