package com.yihu.jw.thirdUpload;

import com.yihu.jw.entity.base.team.BaseTeamDO;
import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsPrescriptionDrugDO;
import com.yihu.jw.entity.thirdUpload.UpAppointmentOnlineDO;
import com.yihu.jw.entity.thirdUpload.UpNsOrganBaseDO;
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 UpAppointmentOnlineDao extends PagingAndSortingRepository<UpAppointmentOnlineDO, String>, JpaSpecificationExecutor<UpAppointmentOnlineDO> {
    @Query("from UpAppointmentOnlineDO t where t.is_del='1' and t.create_time>=?1 and t.create_time<=?2")
    List<UpAppointmentOnlineDO> findByCreateTime(Date startTime, Date endTime);

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

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

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

}
