Interface JpaSpaceStatsRepo

  • All Superinterfaces:
    org.springframework.data.repository.CrudRepository<SpaceStats,​Long>, org.springframework.data.jpa.repository.JpaRepository<SpaceStats,​Long>, org.springframework.data.repository.PagingAndSortingRepository<SpaceStats,​Long>, org.springframework.data.repository.query.QueryByExampleExecutor<SpaceStats>, org.springframework.data.repository.Repository<SpaceStats,​Long>

    @Repository("spaceStatsRepo")
    public interface JpaSpaceStatsRepo
    extends org.springframework.data.jpa.repository.JpaRepository<SpaceStats,​Long>
    Author:
    Daniel Bernstein
    • Method Detail

      • getByAccountIdAndStoreIdAndSpaceId

        @Query(nativeQuery=true,
               value="select    unix_timestamp(date_format(min(modified), \'%Y-%m-%d 23:59:59\')) 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("accountId")
                                                          String accountId,
                                                          @Param("storeId")
                                                          String storeId,
                                                          @Param("spaceId")
                                                          String spaceId,
                                                          @Param("start")
                                                          Date start,
                                                          @Param("end")
                                                          Date end,
                                                          @Param("interval")
                                                          String interval)
      • getByAccountIdAndStoreId

        @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 23:59:59\')) 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("accountId")
                                                String accountId,
                                                @Param("storeId")
                                                String storeId,
                                                @Param("start")
                                                Date start,
                                                @Param("end")
                                                Date end,
                                                @Param("interval")
                                                String interval)
      • getByAccountIdAndStoreIdAndDay

        @Query(nativeQuery=true,
               value="select    unix_timestamp(date_format(min(modified), \'%Y-%m-%d 23:59:59\')) 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("accountId")
                                                      String accountId,
                                                      @Param("storeId")
                                                      String storeId,
                                                      @Param("start")
                                                      Date start,
                                                      @Param("end")
                                                      Date end)