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.resourceLogs logs "
- + "left join logs.author author "
- + "where "
- //filtering
- + "(:name='' or LOWER(resource.name) like CONCAT('%',:name,'%')) "
- + "and (COALESCE(:types) is null or resource.type in (:types)) "
- + "and (:comment='' or LOWER(files.comment) like LOWER(CONCAT('%',:comment,'%'))) "
- + "and (:modifiedBy='' or LOWER(logs.author.firstName) like CONCAT('%',:modifiedBy,'%') or LOWER(logs.author.lastName) like CONCAT('%',:modifiedBy,'%')) "
- + "and (cast(:startDate as date) is null or logs.date between cast(:startDate as date) and cast(:endDate as date)) "
- + "group by (resource.id, author.firstName)")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement