package com.yihu.jw.thirdUpload;

import com.yihu.jw.entity.thirdUpload.AchnsDoctorRecordDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
import com.yihu.jw.entity.thirdUpload.UpnsDoctorRecordDO;
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 BaseNsOlineMedDao extends PagingAndSortingRepository<BaseNsOnlineMedDO,String>, JpaSpecificationExecutor<BaseNsOnlineMedDO> {

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

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

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

}
