package com.yihu.jw.thirdUpload;

import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.thirdUpload.*;
import feign.Param;
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 UpnsDoctorRecordDao extends PagingAndSortingRepository<UpnsDoctorRecordDO, String>, JpaSpecificationExecutor<UpnsDoctorRecordDO> {
    @Query("from UpnsDoctorRecordDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorRecordDO> findByCreateTime(Date startTime, Date endTime);

    @Query("from UpnsDoctorRecordDO d where d.id = ?1 AND d.is_del ='1'")
    UpnsDoctorRecordDO findById(String id);

    @Query("from UpnsDoctorRecordDO")
    List<UpnsDoctorRecordDO> findAll();

    @Query("from UpnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    List<UpnsDoctorRecordDO> finAllByDate(Date startTime, Date endTime);

    @Query("select count(1) from UpnsDoctorRecordDO t where t.create_time>=?1 and t.create_time<=?2")
    String findCount(Date startTime, Date endTime);

}
