|
@ -13,17 +13,20 @@ import java.util.List; |
|
|
public interface BanRepository extends PagingAndSortingRepository<Ban, Long> { |
|
|
public interface BanRepository extends PagingAndSortingRepository<Ban, Long> { |
|
|
|
|
|
|
|
|
@Query(value = "select b from Ban b where " + |
|
|
@Query(value = "select b from Ban b where " + |
|
|
"(:ban_ids is null or b.id in :ban_ids) and " + |
|
|
"(:ban_ids_non_exists = true or b.id in :ban_ids) and " + |
|
|
"(:account_ids is null or b.account_id in :account_ids) and " + |
|
|
"(:account_ids_non_exists = true or b.account_id in :account_ids) and " + |
|
|
"(:begin_date is null or DATE_PART('EPOCH', b.timestamp) >= :begin_date) 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 " + |
|
|
"(:end_date is null or :end_date <= DATE_PART('EPOCH', b.timestamp)) and " + |
|
|
"(:active is null or b.active = :active) and " + |
|
|
"(:active is null or b.active = :active) and " + |
|
|
"(:admin_ids is null or b.unbanned_by_id in :admin_ids) order by b.id desc") |
|
|
"(:admin_ids_non_exists = true or b.unbanned_by_id in :admin_ids) order by b.id desc") |
|
|
Page<Ban> getBans(Pageable pageable, |
|
|
Page<Ban> getBans(Pageable pageable, |
|
|
|
|
|
@Param(value = "ban_ids_non_exists") Boolean ban_ids_non_exists, |
|
|
@Param(value = "ban_ids") Iterable<Long> ban_ids, |
|
|
@Param(value = "ban_ids") Iterable<Long> ban_ids, |
|
|
|
|
|
@Param(value = "account_ids_non_exists") Boolean account_ids_non_exists, |
|
|
@Param(value = "account_ids") Iterable<Long> account_ids, |
|
|
@Param(value = "account_ids") Iterable<Long> account_ids, |
|
|
@Param(value = "begin_date") Long begin_date, |
|
|
@Param(value = "begin_date") Long begin_date, |
|
|
@Param(value = "end_date") Long end_date, |
|
|
@Param(value = "end_date") Long end_date, |
|
|
@Param(value = "active") Boolean active, |
|
|
@Param(value = "active") Boolean active, |
|
|
|
|
|
@Param(value = "admin_ids_non_exists") Boolean admin_ids_non_exists, |
|
|
@Param(value = "admin_ids") Iterable<String> admin_ids); |
|
|
@Param(value = "admin_ids") Iterable<String> admin_ids); |
|
|
} |
|
|
} |
|
|