package com.ywt.outpatient.domain.entity.center;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

public interface TransferTreatmentRepository extends JpaRepository<TransferTreatment, Integer> {

    @Query(value = "select * from transfer_treatment where from_doctor_id = ? and patient_id = ? and is_deleted = 0 order by create_time desc limit 1", nativeQuery = true)
    TransferTreatment getLastTransfer(int doctorId, int patientId);
}
