rez_core 7.1.85 → 7.1.86
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/module/entity/data/filter/service/helpers/flatjson.helper.js +24 -10
- package/dist/module/entity/data/filter/service/helpers/flatjson.helper.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/module/entity/data/filter/service/helpers/flatjson.helper.ts +26 -12
package/package.json
CHANGED
|
@@ -271,18 +271,32 @@ export function buildFlatJsonSelectCondition(
|
|
|
271
271
|
case 'equal':
|
|
272
272
|
case 'contains':
|
|
273
273
|
// Check if value matches - handles both string and array storage
|
|
274
|
-
// For
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
274
|
+
// For multiple values: check if stored value is IN the provided array
|
|
275
|
+
if (arr.length > 1) {
|
|
276
|
+
// Multiple values: check if stored value matches ANY of the provided values
|
|
277
|
+
return {
|
|
278
|
+
query: `(
|
|
279
|
+
e.${jsonColumn}->>'${attr}' IN (:...${key}_str_arr)
|
|
280
|
+
OR (e.${jsonColumn}->'${attr}')::jsonb ?| :${key}_jsonb_arr
|
|
281
|
+
)`,
|
|
282
|
+
params: {
|
|
283
|
+
[`${key}_str_arr`]: arr,
|
|
284
|
+
[`${key}_jsonb_arr`]: arr
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
} else {
|
|
288
|
+
// Single value: check exact match
|
|
289
|
+
return {
|
|
290
|
+
query: `(
|
|
291
|
+
e.${jsonColumn}->>'${attr}' = :${key}_str
|
|
292
|
+
OR (e.${jsonColumn}->'${attr}')::jsonb @> :${key}_arr::jsonb
|
|
293
|
+
)`,
|
|
294
|
+
params: {
|
|
295
|
+
[`${key}_str`]: arr[0],
|
|
296
|
+
[`${key}_arr`]: JSON.stringify([arr[0]])
|
|
297
|
+
},
|
|
298
|
+
};
|
|
299
|
+
}
|
|
286
300
|
case 'not_equal':
|
|
287
301
|
case 'not_contains':
|
|
288
302
|
// Check if value does NOT match - handles both string and array storage
|