package com.rongyichuang.rating.repository; import com.rongyichuang.rating.entity.RatingScheme; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; import org.springframework.data.jpa.repository.Query; import org.springframework.data.repository.query.Param; import org.springframework.stereotype.Repository; /** * 评分模板数据访问层 */ @Repository public interface RatingSchemeRepository extends JpaRepository { /** * 根据名称模糊查询评分模板 */ @Query("SELECT rs FROM RatingScheme rs WHERE rs.name LIKE %:name%") Page findByNameContaining(@Param("name") String name, Pageable pageable); /** * 检查模板是否被比赛使用(暂时返回false,等Activity实体创建后再实现) */ default boolean isUsedByActivity(Long schemeId) { // TODO: 等Activity实体创建后实现此方法 return false; } }