package com.qmth.sop.business.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qmth.sop.business.bean.result.TFFlowLogResult;
import com.qmth.sop.business.entity.TFFlowLog;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 流程流水表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2023-07-17
 */
public interface TFFlowLogMapper extends BaseMapper<TFFlowLog> {

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

    /**
     * 查询最后一条日志审批记录
     *
     * @param flowId
     * @return
     */
    TFFlowLog findByLastFlowLog(@Param("flowId") Long flowId);

    /**
     * 查询最后一条日志审批记录
     *
     * @param flowId
     * @return
     */
    String findByLastFlowLogApproveUser(@Param("flowId") Long flowId);
}
