package com.bonus.material.work.mapper;

import com.bonus.common.biz.domain.lease.LeaseApplyInfo;
import com.bonus.material.work.domain.SysWorkflowRecord;
import com.bonus.material.work.domain.SysWorkflowRecordHistory;
import com.bonus.material.work.domain.dto.SysWorkflowAuditDto;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SysWorkflowRecordMapper {

    // 增加审批流任务信息
    int addSysWorkflowRecord(SysWorkflowRecord sysWorkflowRecord);

    // 修改审批流任务信息
    int updateSysWorkflowRecord(SysWorkflowRecord sysWorkflowRecord);



    // 根据任务id，查询审批流任务信息
    SysWorkflowAuditDto getSysWorkflowRecodeByTaskId(@Param("taskId") Integer taskId);

    // 根据任务id+审批流类型id ， 查询审批流任务记录信息
    SysWorkflowAuditDto getSysWorkflowRecodeByTaskIdAndType(@Param("taskId") Integer taskId, @Param("taskType") Integer taskType, @Param("workflowId") Integer workflowId);

    SysWorkflowRecordHistory getAuditStatus(SysWorkflowRecordHistory sysWorkflowRecordHistory);

    List<SysWorkflowRecordHistory> getAuditUserByTaskId(SysWorkflowRecordHistory sysWorkflowRecordHistory);

    List<SysWorkflowRecordHistory> getAuditUserByRecordId(@Param("recordId") Integer recordId);

    int updateSysWorkflowType(SysWorkflowRecord sysWorkflowRecord);

    /**
     * 判断该任务是否已经在sys_workflow_record表中创建
     * @param leaseApplyInfo
     * @return
     */
    int selectSysWorkflowRecordByTaskId(LeaseApplyInfo leaseApplyInfo);

    int selectLeaseAgreementIdByRecordId(Integer taskId);
}
