package com.yihu.wlyy.repository.patient;

import com.yihu.wlyy.entity.patient.invitation.PatientInvitationLog;
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 2016.08.20.
 */
public interface PatientInvitationLogDao extends PagingAndSortingRepository<PatientInvitationLog, String>, JpaSpecificationExecutor<PatientInvitationLog> {
    @Query(" from PatientInvitationLog a  where a.invitePatientCode = ?3 and a.dealPatientCode=?2 and a.inviteDoctorCode=?1 and a.dealType='0' ")
    List<PatientInvitationLog> getPatientInviteLog(String doctorCode, String patientCode, String invitePatientCode);

    @Query(" from PatientInvitationLog a  where  a.dealPatientCode=?1 and  a.dealType='0'and a.wxPush='1' ")
    List<PatientInvitationLog> findByDealPatientAndWXPush_1(String code);
}
