package com.pharmacopoeia.repository;

import com.pharmacopoeia.entity.BrandRecommendRule;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface BrandRecommendRuleRepository extends JpaRepository<BrandRecommendRule, Integer> {

    List<BrandRecommendRule> findByIsActiveTrueOrderByTierAscKeywordAsc();

    List<BrandRecommendRule> findAllByOrderByTierAscKeywordAsc();

    boolean existsByKeywordAndIdNot(String keyword, Integer id);
}
