package com.yihu.wlyy.repository.doctor;

import com.yihu.wlyy.entity.doctor.observer.DoctorObserver;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by Administrator on 2017/1/3.
 */
public interface DoctorObserverDao extends PagingAndSortingRepository<DoctorObserver, Long>, JpaSpecificationExecutor<DoctorObserver> {

    @Query("select d from DoctorObserver a ,Doctor d where  a.observerDoctorCode=d.code and a.doctorCode=?1 and a.status=1 ")
    List<Doctor> getDoctorObserversByDoctorCode(String doctorCode);
}
