package com.yihu.wlyy.repository.consult;

import com.yihu.wlyy.entity.consult.Evaluate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;


/**
 * Created by 卓 on 2017/5/10.
 */
public interface EvaluateDao extends PagingAndSortingRepository<Evaluate, Long>, JpaSpecificationExecutor<Evaluate> {
    /**
     * 获取某个咨询的评分
     * @param consult
     * @return
     */
    List<Evaluate> findByConsult(String consult);

    /**
     * 根据咨询获取实名或者匿名评分
     * @param consult
     * @return
     */
    List<Evaluate> findByConsultAndType(String consult,int type);

    /**
     * 根据医生获取实名或者匿名评分
     * @param doctor
     * @return
     */
    List<Evaluate> findByDoctorAndType(String doctor,int type);

}
