You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
1.3 KiB
26 lines
1.3 KiB
package app.repositories;
|
|
|
|
import app.entities.db.DbFile;
|
|
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;
|
|
|
|
import java.util.UUID;
|
|
|
|
public interface FilePSRepository extends PagingAndSortingRepository<DbFile, UUID> {
|
|
|
|
@Query("select f from DbFile f where (f.deleted = false or f.deleted is null) and " +
|
|
"(:steam64_non_exists = true or position(f.uploader in :steam64_ids) > 0) and " +
|
|
"(:begin_date_null is null or DATE_PART('EPOCH', f.timestamp) >= :begin_date) and " +
|
|
"(:end_date_null is null or :end_date >= DATE_PART('EPOCH', f.timestamp)) " +
|
|
"order by f.timestamp desc")
|
|
Page<DbFile> getFiles(Pageable pageable,
|
|
@Param(value = "steam64_non_exists") Boolean steam64_non_exists,
|
|
@Param(value = "steam64_ids") String steam64_ids,
|
|
@Param(value = "begin_date") Long begin_date,
|
|
@Param(value = "end_date") Long end_date,
|
|
@Param(value = "begin_date_null") Long begin_date_null,
|
|
@Param(value = "end_date_null") Long end_date_null);
|
|
}
|
|
|