📅  最后修改于: 2022-03-11 15:05:36.483000             🧑  作者: Mango
@Repository
public interface CompanyRepository extends JpaRepository {
@Query("SELECT CASE WHEN COUNT(c) > 0 THEN true ELSE false END FROM Company c WHERE c.name = :companyName")
boolean existsByName(@Param("companyName") String companyName);
}