Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Query(value = "select resource from ResourceEntity resource "
- + "join resource.resourceFiles files "
- + "left join resource.resourceLog logs "
- + "where "
- //filtering
- + "(:name='' or LOWER(resource.name) like CONCAT('%',:name,'%')) "
- + "and LOWER(resource.type) like LOWER(CONCAT('%',:type,'%')) "
- // + "and (COALESCE(:comment) is null or LOWER(files.comment) like LOWER(CONCAT('%',:comment,'%'))) "
- // + "and (COALESCE(:modifiedBy) is null or :modifiedBy='' or LOWER(logs.author.firstName) like CONCAT('%',:modifiedBy,'%') or LOWER(logs.author.lastName) like CONCAT('%',:modifiedBy,'%')) "
- // + "and (COALESCE(:modifiedOn) is null or logs.date in (:modifiedOn)) "
- + "group by resource.id")
- Page<ResourceEntity> filter(Pageable pageable,
- @Param("name") @Nullable String name,
- @Param("type") @Nullable String type);
- // @Param("comment") @Nullable String comment);
- // @Param("modifiedBy") @Nullable String modifiedB,
- // @Param("modifiedOn") @Nullable List<Date> modifiedOn);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement