package com.boying.dao;
|
|
import com.boying.common.BaseDao;
|
import com.boying.entity.OrderRecord;
|
import org.springframework.data.jpa.repository.Query;
|
import org.springframework.stereotype.Repository;
|
|
import java.util.Date;
|
import java.util.List;
|
|
@Repository("orderRecordDao")
|
public interface OrderRecordDao extends BaseDao<OrderRecord, Long>{
|
|
@Query(value = "select count(id) from OrderRecord where createTime>:yearFirst and createTime<:yearLast")
|
long countByYear(Date yearFirst, Date yearLast);
|
|
@Query(value = "select sum(money) from OrderRecord where createTime>:yearFirst and createTime<:yearLast")
|
Double sumByYear(Date yearFirst, Date yearLast);
|
|
@Query(value = "select a from OrderRecord a where a.createTime>:yearFirst and a.createTime<:yearLast order by a.id desc")
|
List<OrderRecord> findAll2(Date yearFirst, Date yearLast);
|
}
|