package com.yihu.figure.dao.patient;

import com.yihu.figure.model.patient.PatientInfo;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.List;

/**
 * Created by yeshijie on 2017/3/6.
 */
public interface PatientInfoDao extends PagingAndSortingRepository<PatientInfo, Long> {
    @Query("from PatientInfo p where p.code=?1 ")
    PatientInfo findByCode(String patientCode);

    @Query("from PatientInfo p ")
    List<PatientInfo> findAllPatient();

    @Query("from PatientInfo p where (p.code='test1' or p.code='test2'or p.code='test3') order by p.id asc")
    List<PatientInfo> findByHasCode();
}
