Advertisement
Guest User

Untitled

a guest
Dec 21st, 2020
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.86 KB | None | 0 0
  1.     @Query(value = "select resource from ResourceEntity resource "
  2.             + "join resource.resourceFiles files "
  3.             + "left join resource.resourceLogs logs "
  4.             + "left join logs.author author "
  5.             + "where "
  6.             //filtering
  7.             + "(:name='' or LOWER(resource.name) like CONCAT('%',:name,'%')) "
  8.             + "and (COALESCE(:types) is null or resource.type in (:types)) "
  9.             + "and (:comment='' or LOWER(files.comment) like LOWER(CONCAT('%',:comment,'%'))) "
  10.             + "and (:modifiedBy='' or LOWER(logs.author.firstName) like CONCAT('%',:modifiedBy,'%')  or LOWER(logs.author.lastName) like CONCAT('%',:modifiedBy,'%')) "
  11.             + "and (cast(:startDate as date) is null or logs.date between cast(:startDate as date) and cast(:endDate as date)) "
  12.             + "group by (resource.id, author.firstName)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement