package com.yihu.jw.hospital.mapping.dao;

import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

/**
 * Created by Trick on 2019/5/27.
 */
public interface PatientMappingDao extends PagingAndSortingRepository<PatientMappingDO, String>, JpaSpecificationExecutor<PatientMappingDO> {

    PatientMappingDO findByIdcardAndSource(String idcard,String source);
    @Query("from PatientMappingDO t where t.mappingCode=?1 and t.source=?2")
    PatientMappingDO findByMappingCodeAndSource(String mappingCode,String source);

    PatientMappingDO findByPatient(String patient);

    PatientMappingDO findByMappingCode(String mappingCode);
    PatientMappingDO findByIdcard(String idCard);
}
