package org.springblade.flow.engine.service;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springblade.flow.engine.entity.FlowCate;
import org.springblade.flow.engine.mapper.FlowCateMapper;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;

/**
 * 
 * @author William
 * @date 2023年2月16日 上午10:52:19
 */
@Service
public class FlowCateService extends ServiceImpl<FlowCateMapper, FlowCate> {

	public boolean exist(String name,String tenantId) {
		LambdaQueryWrapper<FlowCate> wrapper = Wrappers.<FlowCate>lambdaQuery();
		wrapper.eq(FlowCate::getName, name);
		wrapper.eq(FlowCate::getTenantId, tenantId);
		FlowCate data = getOne(wrapper);
		return data != null;
	}
}
