fixed ilike function for native query

This commit is contained in:
dashevchenko 2023-11-03 15:05:30 +02:00
parent 3bc89c35af
commit 5267b641f2

View File

@ -39,7 +39,7 @@ public interface NotificationTargetRepository extends JpaRepository<Notification
Pageable pageable);
@Query(value = "SELECT * FROM notification_target t WHERE t.tenant_id = :tenantId " +
"AND (:searchText IS NULL OR ilike(t.name, concat('%', :searchText, '%')) = true) " +
"AND (:searchText IS NULL OR t.name ILIKE concat('%', :searchText, '%')) " +
"AND (cast(t.configuration as json) ->> 'type' <> 'PLATFORM_USERS' OR " +
"cast(t.configuration as json) -> 'usersFilter' ->> 'type' IN :usersFilterTypes)", nativeQuery = true)
Page<NotificationTargetEntity> findByTenantIdAndSearchTextAndUsersFilterTypeIfPresent(@Param("tenantId") UUID tenantId,