Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ public interface AppUserRepository extends JpaRepository<AppUser, String> {
@Query("""
SELECT u
FROM AppUser u
WHERE (:email IS NULL OR LOWER(COALESCE(u.email, '')) LIKE LOWER(CONCAT('%', :email, '%')))
AND (:name IS NULL OR LOWER(COALESCE(u.name, '')) LIKE LOWER(CONCAT('%', :name, '%')))
WHERE (:email IS NULL OR LOWER(CAST(COALESCE(u.email, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:email AS string), '%')))
AND (:name IS NULL OR LOWER(CAST(COALESCE(u.name, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:name AS string), '%')))
AND (:role IS NULL OR u.role = :role)
AND (:active IS NULL OR u.active = :active)
""")
Expand All @@ -41,10 +41,11 @@ Page<AppUser> findAllWithFilters(@Param("email") String email, @Param("name") St
@Query("""
SELECT u
FROM AppUser u
WHERE LOWER(COALESCE(u.email, '')) LIKE LOWER(CONCAT('%', :search, '%'))
OR LOWER(COALESCE(u.name, '')) LIKE LOWER(CONCAT('%', :search, '%'))
OR LOWER(COALESCE(u.githubLogin, '')) LIKE LOWER(CONCAT('%', :search, '%'))
OR LOWER(COALESCE(u.githubId, '')) LIKE LOWER(CONCAT('%', :search, '%'))
WHERE (:search IS NULL OR
LOWER(CAST(COALESCE(u.email, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:search AS string), '%'))
OR LOWER(CAST(COALESCE(u.name, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:search AS string), '%'))
OR LOWER(CAST(COALESCE(u.githubLogin, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:search AS string), '%'))
OR LOWER(CAST(COALESCE(u.githubId, '') AS string)) LIKE LOWER(CONCAT('%', CAST(:search AS string), '%')))
""")
Page<AppUser> searchUsers(@Param("search") String search, Pageable pageable);
}
Loading