package com.yaoai.domain.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.yaoai.domain.entity.TenantModelProvider;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface TenantModelProviderMapper extends BaseMapper<TenantModelProvider> {

    default List<TenantModelProvider> findByTenant(Long tenantId) {
        return selectList(Wrappers.<TenantModelProvider>lambdaQuery()
                .eq(TenantModelProvider::getTenantId, tenantId)
                .orderByAsc(TenantModelProvider::getId));
    }

    default List<TenantModelProvider> findByTenantAndCapability(Long tenantId, String capability) {
        return selectList(Wrappers.<TenantModelProvider>lambdaQuery()
                .eq(TenantModelProvider::getTenantId, tenantId)
                .eq(TenantModelProvider::getCapability, capability)
                .orderByAsc(TenantModelProvider::getId));
    }
}
