@Repository(value="spaceStatsRepo") public interface JpaSpaceStatsRepo extends org.springframework.data.jpa.repository.JpaRepository<SpaceStats,Long>
| Modifier and Type | Field and Description |
|---|---|
static String |
INTERVAL_DAY |
static String |
INTERVAL_MONTH |
static String |
INTERVAL_WEEK |
| Modifier and Type | Method and Description |
|---|---|
List<Object[]> |
getByAccountIdAndStoreId(String accountId,
String storeId,
Date start,
Date end,
String interval) |
List<Object[]> |
getByAccountIdAndStoreIdAndDay(String accountId,
String storeId,
Date start,
Date end) |
List<Object[]> |
getByAccountIdAndStoreIdAndSpaceId(String accountId,
String storeId,
String spaceId,
Date start,
Date end,
String interval) |
deleteAllInBatch, deleteInBatch, findAll, findAll, findAll, findAll, findAll, flush, getOne, save, saveAndFlushfindAllstatic final String INTERVAL_DAY
static final String INTERVAL_WEEK
static final String INTERVAL_MONTH
@Query(nativeQuery=true,
value="select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 00:00:00\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, :interval) from space_stats where account_id = :accountId and store_id = :storeId and space_id = :spaceId and modified between :start and :end group by date_format(modified, :interval), account_id, store_id, space_id")
List<Object[]> getByAccountIdAndStoreIdAndSpaceId(@Param(value="accountId")
String accountId,
@Param(value="storeId")
String storeId,
@Param(value="spaceId")
String spaceId,
@Param(value="start")
Date start,
@Param(value="end")
Date end,
@Param(value="interval")
String interval)
@Query(nativeQuery=true,
value="select a.modified, a.account_id, a.store_id, sum(a.byte_count), sum(a.object_count) from (select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 00:00:00\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, :interval) from space_stats where account_id = :accountId and store_id = :storeId and modified between :start and :end group by date_format(modified, :interval), account_id, store_id, space_id) a group by a.modified, a.account_id, a.store_id")
List<Object[]> getByAccountIdAndStoreId(@Param(value="accountId")
String accountId,
@Param(value="storeId")
String storeId,
@Param(value="start")
Date start,
@Param(value="end")
Date end,
@Param(value="interval")
String interval)
@Query(nativeQuery=true,
value="select unix_timestamp(date_format(min(modified), \'%Y-%m-%d 00:00:00\')) as modified, account_id, store_id, space_id, avg(byte_count) as byte_count, avg(object_count) as object_count, date_format(modified, \'%Y-%m-%d 00:00:00\') from space_stats where account_id = :accountId and store_id = :storeId and modified between :start and :end group by date_format(modified, \'%Y-%m-%d\'), account_id, store_id, space_id")
List<Object[]> getByAccountIdAndStoreIdAndDay(@Param(value="accountId")
String accountId,
@Param(value="storeId")
String storeId,
@Param(value="start")
Date start,
@Param(value="end")
Date end)
Copyright © 2015–2018 DuraSpace. All rights reserved.