package com.boying.dao; import com.boying.common.BaseDao; import com.boying.entity.Ticket; import org.springframework.data.jpa.repository.Query; import org.springframework.stereotype.Repository; import java.util.Date; @Repository("ticketDao") public interface TicketDao extends BaseDao{ @Query(value = "select count(id) from Ticket where createTime>:startTime and createTime<:endTime") long count1(Date startTime, Date endTime); @Query(value = "select count(id) from Ticket where createTime>:startTime and createTime<:endTime and payStatus=1") long count2(Date startTime, Date endTime); @Query(value = "select sum(money) from Ticket where createTime>:startTime and createTime<:endTime") Double sumByPrice(Date startTime, Date endTime); @Query(value = "select count(id) from Ticket where payStatus=1") long count4(); @Query(value = "select count(id) from Ticket") long count5(); @Query(value = "select count(id) from Ticket where type=1 and createTime>:startTime and createTime<:endTime") long count6(Date startTime, Date endTime); @Query(value = "select count(id) from Ticket where type=1 and status=1 and createTime>:startTime and createTime<:endTime") long count7(Date startTime, Date endTime); @Query(value = "select count(id) from Ticket where type=0 and createTime>:startTime and createTime<:endTime") long count8(Date startTime, Date endTime); @Query(value = "select sum(money) from Ticket where createTime>:startTime and createTime<:endTime and type=0") Double sumByPrice2(Date startTime, Date endTime); }