5 changed files with 86 additions and 1 deletions
@ -0,0 +1,21 @@ |
|||||
|
package app.repositories; |
||||
|
|
||||
|
import app.entities.db.DonateStat; |
||||
|
import org.springframework.data.domain.Page; |
||||
|
import org.springframework.data.domain.Pageable; |
||||
|
import org.springframework.data.jpa.repository.Query; |
||||
|
import org.springframework.data.repository.PagingAndSortingRepository; |
||||
|
import org.springframework.data.repository.query.Param; |
||||
|
|
||||
|
public interface DonateStatRepository extends PagingAndSortingRepository<DonateStat, Long> { |
||||
|
|
||||
|
@Query(value = "select d from DonateStat d where " + |
||||
|
"(:account_ids_non_exists = true or position(d.steam2 in :account_ids) > 0) and " + |
||||
|
"(:begin_date is null or DATE_PART('EPOCH', d.timestamp) >= :begin_date) and " + |
||||
|
"(:end_date is null or :end_date >= DATE_PART('EPOCH', d.timestamp)) order by d.id desc") |
||||
|
Page<DonateStat> getDonate(Pageable pageable, |
||||
|
@Param(value = "account_ids_non_exists") Boolean account_ids_non_exists, |
||||
|
@Param(value = "account_ids") String account_ids, |
||||
|
@Param(value = "begin_date") Long begin_date, |
||||
|
@Param(value = "end_date") Long end_date); |
||||
|
} |
Loading…
Reference in new issue