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

import com.yihu.jw.entity.hospital.prescription.BaseNatAppointmentDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;

import java.util.Date;
import java.util.List;

public interface BaseNatAppointmentDao extends PagingAndSortingRepository<BaseNatAppointmentDO, Integer>, JpaSpecificationExecutor<BaseNatAppointmentDO> {
    @Query("from BaseNatAppointmentDO t where t.payStatus = 0 ")
    List<BaseNatAppointmentDO> findByPayStatus();

    @Query("from BaseNatAppointmentDO t where  t.payStatus = 0 and t.isSuccess=1 and t.patientId=?1")
    List<BaseNatAppointmentDO> findPayStatusByPatientId(String patientId);


    @Query("from BaseNatAppointmentDO t where t.patientId=?1 and t.payStatus in (0,1) and t.isSuccess=1 ")
    List<BaseNatAppointmentDO> findByTasy(String patientId);


    @Query("select a from BaseNatAppointmentDO a where  a.realOrder =?1 ")
    List<BaseNatAppointmentDO> findByRealOrderList(String realOrder);
}
