package com.yihu.jw.rehabilitation;

import com.yihu.jw.entity.specialist.DoctorPatientRelationDO;
import com.yihu.jw.entity.specialist.rehabilitation.GuidanceMessageLogDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

public interface DoctorPatientRelationDao extends PagingAndSortingRepository<DoctorPatientRelationDO, String>, JpaSpecificationExecutor<DoctorPatientRelationDO> {
    @Query("from DoctorPatientRelationDO t where t.doctor =?1 and t.patient =?2")
    List<DoctorPatientRelationDO> findByDoctorAndPatient(String doctor,String patient);

    @Query("from DoctorPatientRelationDO t where t.doctor =?1 and t.patient =?2 and t.dischargeRecord = ?3")
    DoctorPatientRelationDO findByDoctorAndPatientAndCode(String doctor,String patient,String code);


}
