AI rule node: fix text search

This commit is contained in:
Dmytro Skarzhynets 2025-07-02 20:37:47 +03:00
parent 5e36a4e522
commit cdcb80ef76
No known key found for this signature in database
GPG Key ID: 2B51652F224037DF
2 changed files with 3 additions and 3 deletions

View File

@ -48,7 +48,7 @@ public class AiModelSettingsEntity extends BaseVersionedEntity<AiModelSettings>
public static final Map<String, String> COLUMN_MAP = Map.of( public static final Map<String, String> COLUMN_MAP = Map.of(
"createdTime", "created_time", "createdTime", "created_time",
"provider", "(configuration -> 'providerConfig' ->> 'provider')", "provider", "(configuration ->> 'provider')",
"modelId", "(configuration -> 'modelConfig' ->> 'modelId')" "modelId", "(configuration -> 'modelConfig' ->> 'modelId')"
); );

View File

@ -42,7 +42,7 @@ interface AiModelSettingsRepository extends JpaRepository<AiModelSettingsEntity,
WHERE ai_model.tenant_id = :tenantId WHERE ai_model.tenant_id = :tenantId
AND (:textSearch IS NULL AND (:textSearch IS NULL
OR ai_model.name ILIKE '%' || :textSearch || '%' OR ai_model.name ILIKE '%' || :textSearch || '%'
OR (ai_model.configuration -> 'providerConfig' ->> 'provider') ILIKE '%' || :textSearch || '%' OR (ai_model.configuration ->> 'provider') ILIKE '%' || :textSearch || '%'
OR (ai_model.configuration -> 'modelConfig' ->> 'modelId') ILIKE '%' || :textSearch || '%') OR (ai_model.configuration -> 'modelConfig' ->> 'modelId') ILIKE '%' || :textSearch || '%')
""", """,
countQuery = """ countQuery = """
@ -51,7 +51,7 @@ interface AiModelSettingsRepository extends JpaRepository<AiModelSettingsEntity,
WHERE ai_model.tenant_id = :tenantId WHERE ai_model.tenant_id = :tenantId
AND (:textSearch IS NULL AND (:textSearch IS NULL
OR ai_model.name ILIKE '%' || :textSearch || '%' OR ai_model.name ILIKE '%' || :textSearch || '%'
OR (ai_model.configuration -> 'providerConfig' ->> 'provider') ILIKE '%' || :textSearch || '%' OR (ai_model.configuration ->> 'provider') ILIKE '%' || :textSearch || '%'
OR (ai_model.configuration -> 'modelConfig' ->> 'modelId') ILIKE '%' || :textSearch || '%') OR (ai_model.configuration -> 'modelConfig' ->> 'modelId') ILIKE '%' || :textSearch || '%')
""", """,
nativeQuery = true nativeQuery = true