|
|
@ -15,16 +15,15 @@ public interface BanRepository extends PagingAndSortingRepository<Ban, Long> { |
|
|
|
@Query(value = "select b from Ban b where " + |
|
|
|
"(:ban_ids is null or b.id in :ban_ids) and " + |
|
|
|
"(:account_ids is null or b.account_id in :account_ids) and " + |
|
|
|
"(:begin_date is null or b.timestamp >= :begin_date) and " + |
|
|
|
"(:end_date is null or :end_date <= b.timestamp) and " + |
|
|
|
"(:active_null is null or b.active = :active) and " + |
|
|
|
"(:begin_date is null or DATE_PART('EPOCH', b.timestamp) >= :begin_date) and " + |
|
|
|
"(:end_date is null or :end_date <= DATE_PART('EPOCH', b.timestamp)) and " + |
|
|
|
"(:active is null or b.active = :active) and " + |
|
|
|
"(:admin_ids is null or b.unbanned_by_id in :admin_ids)") |
|
|
|
Page<Ban> getBans(Pageable pageable, |
|
|
|
@Param(value = "ban_ids")List<Long> ban_ids, |
|
|
|
@Param(value = "account_ids") List<Long> account_ids, |
|
|
|
@Param(value = "begin_date") Timestamp begin_date, |
|
|
|
@Param(value = "end_date") Timestamp end_date, |
|
|
|
@Param(value = "active_null") Integer active_null, |
|
|
|
@Param(value = "active") boolean active, |
|
|
|
@Param(value = "begin_date") Long begin_date, |
|
|
|
@Param(value = "end_date") Long end_date, |
|
|
|
@Param(value = "active") Boolean active, |
|
|
|
@Param(value = "admin_ids") List<String> admin_ids); |
|
|
|
} |
|
|
|