Interface StatisticRobotRepository

All Superinterfaces:
org.springframework.data.repository.CrudRepository<StatisticRobotEntity,Long>, org.springframework.data.jpa.repository.JpaRepository<StatisticRobotEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<StatisticRobotEntity>, org.springframework.data.repository.ListCrudRepository<StatisticRobotEntity,Long>, org.springframework.data.repository.ListPagingAndSortingRepository<StatisticRobotEntity,Long>, org.springframework.data.repository.PagingAndSortingRepository<StatisticRobotEntity,Long>, org.springframework.data.repository.query.QueryByExampleExecutor<StatisticRobotEntity>, org.springframework.data.repository.Repository<StatisticRobotEntity,Long>

@Repository public interface StatisticRobotRepository extends org.springframework.data.jpa.repository.JpaRepository<StatisticRobotEntity,Long>, org.springframework.data.jpa.repository.JpaSpecificationExecutor<StatisticRobotEntity>
  • Method Details

    • findByUid

    • findByRobotUidAndUserUidAndDateAndHour

      Optional<StatisticRobotEntity> findByRobotUidAndUserUidAndDateAndHour(String robotUid, String userUid, String date, int hour)
    • findByUserUidAndDateAndHour

      Optional<StatisticRobotEntity> findByUserUidAndDateAndHour(String userUid, String date, int hour)
    • findByRobotUidAndDateBetween

      org.springframework.data.domain.Page<StatisticRobotEntity> findByRobotUidAndDateBetween(String robotUid, String startDate, String endDate, org.springframework.data.domain.Pageable pageable)
    • findByUserUidAndDateBetween

      org.springframework.data.domain.Page<StatisticRobotEntity> findByUserUidAndDateBetween(String userUid, String startDate, String endDate, org.springframework.data.domain.Pageable pageable)
    • findAllByUserUidAndDateBetween

      @Query("SELECT s FROM StatisticRobotEntity s WHERE s.userUid = ?1 AND s.date BETWEEN ?2 AND ?3") List<StatisticRobotEntity> findAllByUserUidAndDateBetween(String userUid, String startDate, String endDate)
    • sumTotalCostByUserUidAndDateBetween

      @Query("SELECT COALESCE(SUM(s.totalCost), 0) FROM StatisticRobotEntity s WHERE s.userUid = ?1 AND s.date BETWEEN ?2 AND ?3") BigDecimal sumTotalCostByUserUidAndDateBetween(String userUid, String startDate, String endDate)
    • sumTotalTokensByUserUidAndDateBetween

      @Query("SELECT COALESCE(SUM(s.totalTokens), 0) FROM StatisticRobotEntity s WHERE s.userUid = ?1 AND s.date BETWEEN ?2 AND ?3") long sumTotalTokensByUserUidAndDateBetween(String userUid, String startDate, String endDate)
    • updateStatusForDateBefore

      @Modifying @Query("UPDATE StatisticRobotEntity s SET s.status = ?2 WHERE s.date < ?1") void updateStatusForDateBefore(String date, String status)