
package org.jeecg.modules.workFlow.flowlong.mybatisplus.mapper;

import org.jeecg.modules.workFlow.flowlong.engine.entity.FlwProcess;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;

import java.util.List;

/**
 * 流程定义 Mapper
 *

 */
public interface FlwProcessMapper extends BaseMapper<FlwProcess> {

    default List<FlwProcess> selectListByProcessKey(String tenantId, String processKey) {
        return this.selectList(Wrappers.<FlwProcess>lambdaQuery()
                .eq(FlwProcess::getProcessKey, processKey)
                .eq(StringUtils.isNotBlank(tenantId), FlwProcess::getTenantId, tenantId)
                .orderByDesc(FlwProcess::getProcessVersion));
    }
}
