package com.yihu.jw.thirdUpload;

import com.yihu.jw.entity.thirdUpload.BaseNsOnlineAskDO;
import com.yihu.jw.entity.thirdUpload.BaseNsOnlineMedDO;
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 BaseNsOnlineAskDao extends PagingAndSortingRepository<BaseNsOnlineAskDO, String>, JpaSpecificationExecutor<BaseNsOnlineAskDO> {
    @Query("from BaseNsOnlineAskDO")
    List<BaseNsOnlineAskDO> findAll();

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

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

}
