package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface OrderEvaluationRepository extends JpaRepository<OrderEvaluation, Integer> {

    /**
     * 判断当前订单是否已经评论
     *
     * @param orderId
     * @return
     */
    @Query(value = "SELECT COUNT(1) FROM order_evaluation WHERE order_id = ? limit 1",nativeQuery = true)
    int checkHasEvaluate(int orderId);

}
