Dmytro Skarzhynets
11 months ago
No known key found for this signature in database
GPG Key ID: 2B51652F224037DF
2 changed files with
3 additions and
3 deletions
-
dao/src/main/java/org/thingsboard/server/dao/model/sql/AiModelSettingsEntity.java
-
dao/src/main/java/org/thingsboard/server/dao/sql/ai/AiModelSettingsRepository.java
|
|
|
@ -48,7 +48,7 @@ public class AiModelSettingsEntity extends BaseVersionedEntity<AiModelSettings> |
|
|
|
|
|
|
|
public static final Map<String, String> COLUMN_MAP = Map.of( |
|
|
|
"createdTime", "created_time", |
|
|
|
"provider", "(configuration -> 'providerConfig' ->> 'provider')", |
|
|
|
"provider", "(configuration ->> 'provider')", |
|
|
|
"modelId", "(configuration -> 'modelConfig' ->> 'modelId')" |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
@ -42,7 +42,7 @@ interface AiModelSettingsRepository extends JpaRepository<AiModelSettingsEntity, |
|
|
|
WHERE ai_model.tenant_id = :tenantId |
|
|
|
AND (:textSearch IS NULL |
|
|
|
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 || '%') |
|
|
|
""", |
|
|
|
countQuery = """ |
|
|
|
@ -51,7 +51,7 @@ interface AiModelSettingsRepository extends JpaRepository<AiModelSettingsEntity, |
|
|
|
WHERE ai_model.tenant_id = :tenantId |
|
|
|
AND (:textSearch IS NULL |
|
|
|
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 || '%') |
|
|
|
""", |
|
|
|
nativeQuery = true |
|
|
|
|