Advertisement
Guest User

Untitled

a guest
Dec 16th, 2020
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.24 KB | None | 0 0
  1.     @Query(value = "select resource from ResourceEntity resource "
  2.             + "join resource.resourceFiles files "
  3.             + "left join resource.resourceLog logs "
  4.             + "where "
  5.             //filtering
  6.             + "(:name='' or LOWER(resource.name) like CONCAT('%',:name,'%')) "
  7.             + "and LOWER(resource.type) like LOWER(CONCAT('%',:type,'%')) "
  8. //            + "and (COALESCE(:comment) is null or LOWER(files.comment) like LOWER(CONCAT('%',:comment,'%'))) "
  9. //            + "and (COALESCE(:modifiedBy) is null or :modifiedBy='' or LOWER(logs.author.firstName) like CONCAT('%',:modifiedBy,'%')  or LOWER(logs.author.lastName) like CONCAT('%',:modifiedBy,'%')) "
  10. //            + "and (COALESCE(:modifiedOn) is null or logs.date in (:modifiedOn)) "
  11.             + "group by resource.id")
  12.     Page<ResourceEntity> filter(Pageable pageable,
  13.                                 @Param("name") @Nullable String name,
  14.                                 @Param("type") @Nullable String type);
  15. //                                @Param("comment") @Nullable String comment);
  16. //                                @Param("modifiedBy") @Nullable String modifiedB,
  17. //                                @Param("modifiedOn") @Nullable List<Date> modifiedOn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement