package cn.lihongjie.coal.acDeviceSupplier.repository;

import cn.lihongjie.coal.acDeviceSupplier.entity.AcDeviceSupplierEntity;
import cn.lihongjie.coal.base.dao.BaseRepository;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface AcDeviceSupplierRepository extends BaseRepository<AcDeviceSupplierEntity> {

    @Query("select exists(select 1 from AcDeviceEntity e where e.supplier.id in :ids)")
        boolean isLinked(@Param("ids") List<String> ids);

}
