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

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.qmth.distributed.print.business.entity.TFCustomFlow;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * <p>
 * 自定义流程表 Mapper 接口
 * </p>
 *
 * @author wangliang
 * @since 2022-01-21
 */
public interface TFCustomFlowMapper extends BaseMapper<TFCustomFlow> {

    /**
     * 查询版本号
     *
     * @param schoolId
     * @param orgId
     * @param type
     * @return
     */
    TFCustomFlow findMaxVersion(@Param("schoolId") Long schoolId, @Param("orgId") Long orgId, @Param("type") String type);

    /**
     * 查询自定义流程数据列表
     *
     * @param iPage
     * @param name
     * @param schoolId
     * @param orgId
     * @return
     */
    public IPage<TFCustomFlow> list(IPage<Map> iPage, @Param("name") String name, @Param("schoolId") Long schoolId, @Param("orgId") Long orgId);

    /**
     * 根据key查找id
     *
     * @param flowKey
     * @return
     */
    public String findActIdByFlowKey(@Param("flowKey") String flowKey);
}
