@itwin/grouping-mapping-widget 0.3.4 → 0.5.0
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/lib/cjs/formula/FormulaDataTypeResolver.d.ts +12 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js +50 -0
- package/lib/cjs/formula/FormulaDataTypeResolver.js.map +1 -0
- package/lib/cjs/formula/FormulaFunctionProvider.js +59 -59
- package/lib/cjs/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaOperatorsProvider.js +7 -7
- package/lib/cjs/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.d.ts +6 -0
- package/lib/cjs/formula/{FormulaTokensValidator.js → FormulaTokensDataTypeResolver.js} +33 -31
- package/lib/cjs/formula/FormulaTokensDataTypeResolver.js.map +1 -0
- package/lib/cjs/formula/Types.d.ts +2 -2
- package/lib/cjs/formula/Types.js.map +1 -1
- package/lib/cjs/grouping-mapping-widget.d.ts +9 -0
- package/lib/cjs/grouping-mapping-widget.js +9 -1
- package/lib/cjs/grouping-mapping-widget.js.map +1 -1
- package/lib/cjs/widget/GroupingMappingWidget.d.ts +3 -4
- package/lib/cjs/widget/GroupingMappingWidget.js +3 -4
- package/lib/cjs/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/cjs/widget/IMappingClient.d.ts +327 -0
- package/lib/cjs/widget/IMappingClient.js +7 -0
- package/lib/cjs/widget/IMappingClient.js.map +1 -0
- package/lib/cjs/widget/components/CalculatedPropertyAction.js +7 -6
- package/lib/cjs/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/CalculatedPropertyTable.js +6 -5
- package/lib/cjs/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/ConfirmMappingsImport.js +6 -5
- package/lib/cjs/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationAction.js +8 -7
- package/lib/cjs/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/cjs/widget/components/CustomCalculationTable.js +6 -5
- package/lib/cjs/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupAction.d.ts +2 -1
- package/lib/cjs/widget/components/GroupAction.js +21 -14
- package/lib/cjs/widget/components/GroupAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyAction.js +19 -10
- package/lib/cjs/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/cjs/widget/components/GroupPropertyTable.js +6 -5
- package/lib/cjs/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js +8 -5
- package/lib/cjs/widget/components/GroupQueryBuilderContainer.js.map +1 -1
- package/lib/cjs/widget/components/GroupTile.d.ts +13 -0
- package/lib/cjs/widget/components/GroupTile.js +18 -0
- package/lib/cjs/widget/components/GroupTile.js.map +1 -0
- package/lib/cjs/widget/components/GroupTile.scss +32 -0
- package/lib/cjs/widget/components/Grouping.js +215 -166
- package/lib/cjs/widget/components/Grouping.js.map +1 -1
- package/lib/cjs/widget/components/Grouping.scss +39 -4
- package/lib/cjs/widget/components/GroupingMapping.d.ts +18 -11
- package/lib/cjs/widget/components/GroupingMapping.js +24 -15
- package/lib/cjs/widget/components/GroupingMapping.js.map +1 -1
- package/lib/cjs/widget/components/Mapping.js +20 -17
- package/lib/cjs/widget/components/Mapping.js.map +1 -1
- package/lib/cjs/widget/components/MappingAction.js +8 -7
- package/lib/cjs/widget/components/MappingAction.js.map +1 -1
- package/lib/cjs/widget/components/PropertyMenu.js +34 -26
- package/lib/cjs/widget/components/PropertyMenu.js.map +1 -1
- package/lib/cjs/widget/components/QueryBuilder.d.ts +10 -4
- package/lib/cjs/widget/components/QueryBuilder.js +223 -141
- package/lib/cjs/widget/components/QueryBuilder.js.map +1 -1
- package/lib/cjs/widget/components/SelectIModel.js +13 -4
- package/lib/cjs/widget/components/SelectIModel.js.map +1 -1
- package/lib/cjs/widget/components/SelectMappings.js +9 -8
- package/lib/cjs/widget/components/SelectMappings.js.map +1 -1
- package/lib/cjs/widget/components/SelectProject.js +13 -4
- package/lib/cjs/widget/components/SelectProject.js.map +1 -1
- package/lib/cjs/widget/components/{GroupQueryBuilderContext.d.ts → context/GroupQueryBuilderContext.d.ts} +2 -1
- package/lib/cjs/widget/components/{GroupQueryBuilderContext.js → context/GroupQueryBuilderContext.js} +2 -1
- package/lib/cjs/widget/components/context/GroupQueryBuilderContext.js.map +1 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.d.ts +11 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js +37 -0
- package/lib/cjs/widget/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/cjs/widget/components/context/MappingClientContext.d.ts +7 -0
- package/lib/cjs/widget/components/context/MappingClientContext.js +30 -0
- package/lib/cjs/widget/components/context/MappingClientContext.js.map +1 -0
- package/lib/cjs/widget/components/property-grid/PropertyGrid.d.ts +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js +5 -5
- package/lib/cjs/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js +2 -2
- package/lib/cjs/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/cjs/widget/components/property-grid/PropertyView.js +14 -6
- package/lib/cjs/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/cjs/widget/components/utils.d.ts +6 -0
- package/lib/cjs/widget/components/utils.js +9 -1
- package/lib/cjs/widget/components/utils.js.map +1 -1
- package/lib/cjs/widget/components/utils.scss +12 -3
- package/lib/cjs/widget/components/viewerUtils.d.ts +19 -0
- package/lib/cjs/widget/components/viewerUtils.js +224 -3
- package/lib/cjs/widget/components/viewerUtils.js.map +1 -1
- package/lib/cjs/widget/hooks/useFormulaValidation.d.ts +1 -1
- package/lib/cjs/widget/hooks/useFormulaValidation.js +7 -6
- package/lib/cjs/widget/hooks/useFormulaValidation.js.map +1 -1
- package/lib/esm/formula/FormulaDataTypeResolver.d.ts +12 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js +46 -0
- package/lib/esm/formula/FormulaDataTypeResolver.js.map +1 -0
- package/lib/esm/formula/FormulaFunctionProvider.js +59 -59
- package/lib/esm/formula/FormulaFunctionProvider.js.map +1 -1
- package/lib/esm/formula/FormulaOperatorsProvider.js +7 -7
- package/lib/esm/formula/FormulaOperatorsProvider.js.map +1 -1
- package/lib/esm/formula/FormulaTokensDataTypeResolver.d.ts +6 -0
- package/lib/esm/formula/{FormulaTokensValidator.js → FormulaTokensDataTypeResolver.js} +31 -29
- package/lib/esm/formula/FormulaTokensDataTypeResolver.js.map +1 -0
- package/lib/esm/formula/Types.d.ts +2 -2
- package/lib/esm/formula/Types.js.map +1 -1
- package/lib/esm/grouping-mapping-widget.d.ts +9 -0
- package/lib/esm/grouping-mapping-widget.js +6 -0
- package/lib/esm/grouping-mapping-widget.js.map +1 -1
- package/lib/esm/widget/GroupingMappingWidget.d.ts +3 -4
- package/lib/esm/widget/GroupingMappingWidget.js +3 -4
- package/lib/esm/widget/GroupingMappingWidget.js.map +1 -1
- package/lib/esm/widget/IMappingClient.d.ts +327 -0
- package/lib/esm/widget/IMappingClient.js +6 -0
- package/lib/esm/widget/IMappingClient.js.map +1 -0
- package/lib/esm/widget/components/CalculatedPropertyAction.js +8 -7
- package/lib/esm/widget/components/CalculatedPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/CalculatedPropertyTable.js +7 -6
- package/lib/esm/widget/components/CalculatedPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/ConfirmMappingsImport.js +7 -6
- package/lib/esm/widget/components/ConfirmMappingsImport.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationAction.js +9 -8
- package/lib/esm/widget/components/CustomCalculationAction.js.map +1 -1
- package/lib/esm/widget/components/CustomCalculationTable.js +7 -6
- package/lib/esm/widget/components/CustomCalculationTable.js.map +1 -1
- package/lib/esm/widget/components/GroupAction.d.ts +2 -1
- package/lib/esm/widget/components/GroupAction.js +23 -16
- package/lib/esm/widget/components/GroupAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyAction.js +20 -11
- package/lib/esm/widget/components/GroupPropertyAction.js.map +1 -1
- package/lib/esm/widget/components/GroupPropertyTable.js +7 -6
- package/lib/esm/widget/components/GroupPropertyTable.js.map +1 -1
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js +8 -5
- package/lib/esm/widget/components/GroupQueryBuilderContainer.js.map +1 -1
- package/lib/esm/widget/components/GroupTile.d.ts +13 -0
- package/lib/esm/widget/components/GroupTile.js +11 -0
- package/lib/esm/widget/components/GroupTile.js.map +1 -0
- package/lib/esm/widget/components/GroupTile.scss +32 -0
- package/lib/esm/widget/components/Grouping.js +220 -171
- package/lib/esm/widget/components/Grouping.js.map +1 -1
- package/lib/esm/widget/components/Grouping.scss +39 -4
- package/lib/esm/widget/components/GroupingMapping.d.ts +18 -11
- package/lib/esm/widget/components/GroupingMapping.js +25 -15
- package/lib/esm/widget/components/GroupingMapping.js.map +1 -1
- package/lib/esm/widget/components/Mapping.js +21 -18
- package/lib/esm/widget/components/Mapping.js.map +1 -1
- package/lib/esm/widget/components/MappingAction.js +9 -8
- package/lib/esm/widget/components/MappingAction.js.map +1 -1
- package/lib/esm/widget/components/PropertyMenu.js +36 -28
- package/lib/esm/widget/components/PropertyMenu.js.map +1 -1
- package/lib/esm/widget/components/QueryBuilder.d.ts +10 -4
- package/lib/esm/widget/components/QueryBuilder.js +224 -142
- package/lib/esm/widget/components/QueryBuilder.js.map +1 -1
- package/lib/esm/widget/components/SelectIModel.js +14 -5
- package/lib/esm/widget/components/SelectIModel.js.map +1 -1
- package/lib/esm/widget/components/SelectMappings.js +10 -9
- package/lib/esm/widget/components/SelectMappings.js.map +1 -1
- package/lib/esm/widget/components/SelectProject.js +14 -5
- package/lib/esm/widget/components/SelectProject.js.map +1 -1
- package/lib/esm/widget/components/{GroupQueryBuilderContext.d.ts → context/GroupQueryBuilderContext.d.ts} +2 -1
- package/lib/esm/widget/components/{GroupQueryBuilderContext.js → context/GroupQueryBuilderContext.js} +2 -1
- package/lib/esm/widget/components/context/GroupQueryBuilderContext.js.map +1 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.d.ts +11 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js +14 -0
- package/lib/esm/widget/components/context/GroupingApiConfigContext.js.map +1 -0
- package/lib/esm/widget/components/context/MappingClientContext.d.ts +7 -0
- package/lib/esm/widget/components/context/MappingClientContext.js +25 -0
- package/lib/esm/widget/components/context/MappingClientContext.js.map +1 -0
- package/lib/esm/widget/components/property-grid/PropertyGrid.d.ts +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGrid.js +6 -6
- package/lib/esm/widget/components/property-grid/PropertyGrid.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.d.ts +1 -1
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js +2 -2
- package/lib/esm/widget/components/property-grid/PropertyGridWrapper.js.map +1 -1
- package/lib/esm/widget/components/property-grid/PropertyView.js +14 -6
- package/lib/esm/widget/components/property-grid/PropertyView.js.map +1 -1
- package/lib/esm/widget/components/utils.d.ts +6 -0
- package/lib/esm/widget/components/utils.js +6 -0
- package/lib/esm/widget/components/utils.js.map +1 -1
- package/lib/esm/widget/components/utils.scss +12 -3
- package/lib/esm/widget/components/viewerUtils.d.ts +19 -0
- package/lib/esm/widget/components/viewerUtils.js +207 -3
- package/lib/esm/widget/components/viewerUtils.js.map +1 -1
- package/lib/esm/widget/hooks/useFormulaValidation.d.ts +1 -1
- package/lib/esm/widget/hooks/useFormulaValidation.js +7 -6
- package/lib/esm/widget/hooks/useFormulaValidation.js.map +1 -1
- package/package.json +30 -30
- package/lib/cjs/formula/FormulaTokensValidator.d.ts +0 -5
- package/lib/cjs/formula/FormulaTokensValidator.js.map +0 -1
- package/lib/cjs/formula/FormulaValidator.d.ts +0 -3
- package/lib/cjs/formula/FormulaValidator.js +0 -35
- package/lib/cjs/formula/FormulaValidator.js.map +0 -1
- package/lib/cjs/widget/components/GroupQueryBuilderContext.js.map +0 -1
- package/lib/esm/formula/FormulaTokensValidator.d.ts +0 -5
- package/lib/esm/formula/FormulaTokensValidator.js.map +0 -1
- package/lib/esm/formula/FormulaValidator.d.ts +0 -3
- package/lib/esm/formula/FormulaValidator.js +0 -31
- package/lib/esm/formula/FormulaValidator.js.map +0 -1
- package/lib/esm/widget/components/GroupQueryBuilderContext.js.map +0 -1
|
@@ -12,8 +12,13 @@ class QueryBuilder {
|
|
|
12
12
|
constructor(provider) {
|
|
13
13
|
this.dataProvider = provider;
|
|
14
14
|
}
|
|
15
|
+
isCategory(propertyField) {
|
|
16
|
+
var _a;
|
|
17
|
+
const classInfo = (_a = propertyField.properties[0].property.navigationPropertyInfo) === null || _a === void 0 ? void 0 : _a.classInfo;
|
|
18
|
+
return (classInfo === null || classInfo === void 0 ? void 0 : classInfo.name) === "BisCore:GeometricElement3dIsInCategory";
|
|
19
|
+
}
|
|
15
20
|
async addProperty(prop) {
|
|
16
|
-
var _a, _b, _c, _d, _e;
|
|
21
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
17
22
|
// TODO: only handle primitive properties now
|
|
18
23
|
if (((_a = prop.value) === null || _a === void 0 ? void 0 : _a.valueFormat) !== appui_abstract_1.PropertyValueFormat.Primitive) {
|
|
19
24
|
itwinui_react_1.toaster.warning("Only primitive types are supported for now.");
|
|
@@ -31,35 +36,42 @@ class QueryBuilder {
|
|
|
31
36
|
String(prop.value.value).indexOf("'") >= 0) {
|
|
32
37
|
prop.value.value = replaceAll(prop.value.value.toString(), "'", "''");
|
|
33
38
|
}
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
// get descriptor
|
|
40
|
+
const descriptor = await ((_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getContentDescriptor());
|
|
41
|
+
const propertyField = (await ((_c = this.dataProvider) === null || _c === void 0 ? void 0 : _c.getFieldByPropertyRecord(prop)));
|
|
42
|
+
if (!descriptor || !propertyField) {
|
|
36
43
|
itwinui_react_1.toaster.negative("Error. Failed to fetch field for this property record.");
|
|
37
44
|
return false;
|
|
38
45
|
}
|
|
39
46
|
// get the special cases
|
|
40
47
|
const isNavigation = prop.property.typename.toLowerCase() === "navigation";
|
|
41
|
-
const
|
|
48
|
+
const isCategory = isNavigation && this.isCategory(propertyField);
|
|
49
|
+
const isAspect = ((_d = propertyField.parent) === null || _d === void 0 ? void 0 : _d.pathToPrimaryClass.find((a) => {
|
|
42
50
|
var _a, _b;
|
|
43
51
|
return ((_a = a.relationshipInfo) === null || _a === void 0 ? void 0 : _a.name) ===
|
|
44
52
|
QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||
|
|
45
53
|
((_b = a.relationshipInfo) === null || _b === void 0 ? void 0 : _b.name) === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS;
|
|
46
54
|
})) !== undefined;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
for (let i = 0; i < propertyField.properties.length; i++) {
|
|
56
|
+
const className = propertyField.properties[i].property.classInfo.name.replace(":", ".");
|
|
57
|
+
const propertyName = isNavigation
|
|
58
|
+
? isCategory
|
|
59
|
+
? `${propertyField.properties[i].property.name}.CodeValue`
|
|
60
|
+
: `${propertyField.properties[i].property.name}.id`
|
|
61
|
+
: propertyField.properties[i].property.name;
|
|
62
|
+
const propertyValue = isNavigation
|
|
63
|
+
? isCategory
|
|
64
|
+
? (_e = prop.value.displayValue) !== null && _e !== void 0 ? _e : ""
|
|
65
|
+
: prop.value.value.id
|
|
66
|
+
: prop.value.value;
|
|
67
|
+
if (!isAspect &&
|
|
68
|
+
((_f = propertyField.parent) === null || _f === void 0 ? void 0 : _f.pathToPrimaryClass) &&
|
|
69
|
+
((_g = propertyField.parent) === null || _g === void 0 ? void 0 : _g.pathToPrimaryClass.length) > 0) {
|
|
70
|
+
this.addRelatedProperty(i, propertyField, propertyName, propertyValue, isAspect);
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
this.addPropertyToQuery(i, className, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), isCategory, false);
|
|
74
|
+
}
|
|
63
75
|
}
|
|
64
76
|
return true;
|
|
65
77
|
}
|
|
@@ -73,7 +85,7 @@ class QueryBuilder {
|
|
|
73
85
|
}
|
|
74
86
|
return false;
|
|
75
87
|
}
|
|
76
|
-
addRelatedProperty(propertyField, propertyName, propertyValue, isAspect) {
|
|
88
|
+
addRelatedProperty(unionIndex, propertyField, propertyName, propertyValue, isAspect) {
|
|
77
89
|
var _a, _b;
|
|
78
90
|
const paths = [...((_b = (_a = propertyField.parent) === null || _a === void 0 ? void 0 : _a.pathToPrimaryClass) !== null && _b !== void 0 ? _b : [])];
|
|
79
91
|
paths.reverse().forEach((path) => {
|
|
@@ -82,32 +94,56 @@ class QueryBuilder {
|
|
|
82
94
|
const targetClassName = (_b = path.targetClassInfo) === null || _b === void 0 ? void 0 : _b.name.replace(":", ".");
|
|
83
95
|
const relClassName = (_c = path.relationshipInfo) === null || _c === void 0 ? void 0 : _c.name.replace(":", ".");
|
|
84
96
|
if (!path.isForwardRelationship) {
|
|
85
|
-
this.addPropertyToQuery(targetClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, true);
|
|
86
|
-
this.addPropertyToQuery(relClassName, `TargetECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, true);
|
|
97
|
+
this.addPropertyToQuery(unionIndex, targetClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, false, true);
|
|
98
|
+
this.addPropertyToQuery(unionIndex, relClassName, `TargetECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, false, true);
|
|
87
99
|
if (((_d = path.sourceClassInfo) === null || _d === void 0 ? void 0 : _d.name) ===
|
|
88
100
|
((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.contentClassInfo.name)) {
|
|
89
|
-
this.addPropertyToQuery(sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), true);
|
|
101
|
+
this.addPropertyToQuery(unionIndex, sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), false, true);
|
|
90
102
|
}
|
|
91
103
|
else {
|
|
92
|
-
this.addPropertyToQuery(sourceClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, true);
|
|
104
|
+
this.addPropertyToQuery(unionIndex, sourceClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, false, true);
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
else {
|
|
96
|
-
this.addPropertyToQuery(targetClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, true);
|
|
97
|
-
this.addPropertyToQuery(relClassName, `SourceECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, true);
|
|
108
|
+
this.addPropertyToQuery(unionIndex, targetClassName, `ECInstanceId`, `${relClassName}.TargetECInstanceId`, isAspect, false, false, true);
|
|
109
|
+
this.addPropertyToQuery(unionIndex, relClassName, `SourceECInstanceId`, `${sourceClassName}.ECInstanceId`, isAspect, false, false, true);
|
|
98
110
|
if (((_f = path.sourceClassInfo) === null || _f === void 0 ? void 0 : _f.name) ===
|
|
99
111
|
((_g = propertyField.parent) === null || _g === void 0 ? void 0 : _g.contentClassInfo.name)) {
|
|
100
|
-
this.addPropertyToQuery(sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), true);
|
|
112
|
+
this.addPropertyToQuery(unionIndex, sourceClassName, propertyName, propertyValue, isAspect, this._needsQuote(propertyField), false, true);
|
|
101
113
|
}
|
|
102
114
|
else {
|
|
103
|
-
this.addPropertyToQuery(sourceClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, true);
|
|
115
|
+
this.addPropertyToQuery(unionIndex, sourceClassName, `ECInstanceId`, `${relClassName}.SourceECInstanceId`, isAspect, false, false, true);
|
|
104
116
|
}
|
|
105
117
|
}
|
|
106
118
|
});
|
|
107
119
|
}
|
|
108
|
-
addPropertyToQuery(className, propertyName, propertyValue, isAspect, needsQuote, isRelational) {
|
|
109
|
-
if (this.query === undefined || this.query.
|
|
120
|
+
addPropertyToQuery(unionIndex, className, propertyName, propertyValue, isAspect, needsQuote, isCategory, isRelational) {
|
|
121
|
+
if (this.query === undefined || this.query.unions.length === 0) {
|
|
110
122
|
this.query = {
|
|
123
|
+
unions: [
|
|
124
|
+
{
|
|
125
|
+
classes: [
|
|
126
|
+
{
|
|
127
|
+
className,
|
|
128
|
+
isAspect,
|
|
129
|
+
isRelational,
|
|
130
|
+
properties: [
|
|
131
|
+
{
|
|
132
|
+
name: propertyName,
|
|
133
|
+
value: propertyValue,
|
|
134
|
+
needsQuote,
|
|
135
|
+
isCategory,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
],
|
|
140
|
+
},
|
|
141
|
+
],
|
|
142
|
+
};
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
if (this.query.unions.length <= unionIndex) {
|
|
146
|
+
this.query.unions.push({
|
|
111
147
|
classes: [
|
|
112
148
|
{
|
|
113
149
|
className,
|
|
@@ -118,14 +154,15 @@ class QueryBuilder {
|
|
|
118
154
|
name: propertyName,
|
|
119
155
|
value: propertyValue,
|
|
120
156
|
needsQuote,
|
|
157
|
+
isCategory,
|
|
121
158
|
},
|
|
122
159
|
],
|
|
123
160
|
},
|
|
124
161
|
],
|
|
125
|
-
};
|
|
162
|
+
});
|
|
126
163
|
return;
|
|
127
164
|
}
|
|
128
|
-
const foundClass = this.query.classes.find((c) => c.className === className);
|
|
165
|
+
const foundClass = this.query.unions[unionIndex].classes.find((c) => c.className === className);
|
|
129
166
|
if (foundClass) {
|
|
130
167
|
foundClass.isRelational = isRelational;
|
|
131
168
|
if (!foundClass.properties.find((x) => x.name === propertyName)) {
|
|
@@ -133,11 +170,12 @@ class QueryBuilder {
|
|
|
133
170
|
name: propertyName,
|
|
134
171
|
value: propertyValue,
|
|
135
172
|
needsQuote,
|
|
173
|
+
isCategory,
|
|
136
174
|
});
|
|
137
175
|
}
|
|
138
176
|
}
|
|
139
177
|
else {
|
|
140
|
-
this.query.classes.push({
|
|
178
|
+
this.query.unions[unionIndex].classes.push({
|
|
141
179
|
className,
|
|
142
180
|
isRelational,
|
|
143
181
|
properties: [
|
|
@@ -145,6 +183,7 @@ class QueryBuilder {
|
|
|
145
183
|
name: propertyName,
|
|
146
184
|
value: propertyValue,
|
|
147
185
|
needsQuote,
|
|
186
|
+
isCategory,
|
|
148
187
|
},
|
|
149
188
|
],
|
|
150
189
|
isAspect,
|
|
@@ -152,35 +191,45 @@ class QueryBuilder {
|
|
|
152
191
|
}
|
|
153
192
|
}
|
|
154
193
|
async removeProperty(prop) {
|
|
155
|
-
var _a, _b, _c, _d;
|
|
156
|
-
if (this.query === undefined || this.query.
|
|
194
|
+
var _a, _b, _c, _d, _e;
|
|
195
|
+
if (this.query === undefined || this.query.unions.length === 0) {
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
if (this.query.unions.length === 1 &&
|
|
199
|
+
this.query.unions[0].classes.length === 0) {
|
|
157
200
|
return;
|
|
158
201
|
}
|
|
159
|
-
const
|
|
160
|
-
|
|
202
|
+
const descriptor = await ((_a = this.dataProvider) === null || _a === void 0 ? void 0 : _a.getContentDescriptor());
|
|
203
|
+
const propertyField = (await ((_b = this.dataProvider) === null || _b === void 0 ? void 0 : _b.getFieldByPropertyRecord(prop)));
|
|
204
|
+
if (!descriptor || !propertyField) {
|
|
161
205
|
return;
|
|
162
206
|
}
|
|
163
|
-
const isAspect = ((
|
|
207
|
+
const isAspect = ((_c = propertyField.parent) === null || _c === void 0 ? void 0 : _c.pathToPrimaryClass.find((a) => {
|
|
164
208
|
var _a, _b;
|
|
165
209
|
return ((_a = a.relationshipInfo) === null || _a === void 0 ? void 0 : _a.name) ===
|
|
166
210
|
QueryBuilder.UNIQUE_ASPECT_PRIMARY_CLASS ||
|
|
167
211
|
((_b = a.relationshipInfo) === null || _b === void 0 ? void 0 : _b.name) === QueryBuilder.MULTI_ASPECT_PRIMARY_CLASS;
|
|
168
212
|
})) !== undefined;
|
|
169
213
|
const isNavigation = prop.property.typename.toLowerCase() === "navigation";
|
|
170
|
-
const
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
214
|
+
const isCategory = isNavigation && this.isCategory(propertyField);
|
|
215
|
+
for (let i = 0; i < propertyField.properties.length; i++) {
|
|
216
|
+
const propertyName = isNavigation
|
|
217
|
+
? isCategory
|
|
218
|
+
? `${propertyField.properties[i].property.name}.CodeValue`
|
|
219
|
+
: `${propertyField.properties[i].property.name}.id`
|
|
220
|
+
: propertyField.properties[i].property.name;
|
|
221
|
+
const className = propertyField.properties[i].property.classInfo.name.replace(":", ".");
|
|
222
|
+
if (!isAspect &&
|
|
223
|
+
((_d = propertyField.parent) === null || _d === void 0 ? void 0 : _d.pathToPrimaryClass) &&
|
|
224
|
+
((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.pathToPrimaryClass.length) > 0) {
|
|
225
|
+
this.removeRelatedProperty(i, propertyField, propertyName);
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
this.removePropertyFromQuery(i, className, propertyName);
|
|
229
|
+
}
|
|
181
230
|
}
|
|
182
231
|
}
|
|
183
|
-
removeRelatedProperty(propertyField, propertyName) {
|
|
232
|
+
removeRelatedProperty(unionIndex, propertyField, propertyName) {
|
|
184
233
|
var _a, _b;
|
|
185
234
|
const paths = [...((_b = (_a = propertyField.parent) === null || _a === void 0 ? void 0 : _a.pathToPrimaryClass) !== null && _b !== void 0 ? _b : [])];
|
|
186
235
|
paths.reverse().forEach((path) => {
|
|
@@ -189,32 +238,32 @@ class QueryBuilder {
|
|
|
189
238
|
const targetClassName = (_b = path.targetClassInfo) === null || _b === void 0 ? void 0 : _b.name.replace(":", ".");
|
|
190
239
|
const relClassName = (_c = path.relationshipInfo) === null || _c === void 0 ? void 0 : _c.name.replace(":", ".");
|
|
191
240
|
if (!path.isForwardRelationship) {
|
|
192
|
-
this.removePropertyFromQuery(targetClassName, `ECInstanceId`);
|
|
193
|
-
this.removePropertyFromQuery(relClassName, `TargetECInstanceId`);
|
|
241
|
+
this.removePropertyFromQuery(unionIndex, targetClassName, `ECInstanceId`);
|
|
242
|
+
this.removePropertyFromQuery(unionIndex, relClassName, `TargetECInstanceId`);
|
|
194
243
|
if (((_d = path.sourceClassInfo) === null || _d === void 0 ? void 0 : _d.name) ===
|
|
195
244
|
((_e = propertyField.parent) === null || _e === void 0 ? void 0 : _e.contentClassInfo.name)) {
|
|
196
|
-
this.removePropertyFromQuery(sourceClassName, propertyName);
|
|
245
|
+
this.removePropertyFromQuery(unionIndex, sourceClassName, propertyName);
|
|
197
246
|
}
|
|
198
247
|
else {
|
|
199
|
-
this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);
|
|
248
|
+
this.removePropertyFromQuery(unionIndex, sourceClassName, `ECInstanceId`);
|
|
200
249
|
}
|
|
201
250
|
}
|
|
202
251
|
else {
|
|
203
|
-
this.removePropertyFromQuery(targetClassName, `ECInstanceId`);
|
|
204
|
-
this.removePropertyFromQuery(relClassName, `SourceECInstanceId`);
|
|
252
|
+
this.removePropertyFromQuery(unionIndex, targetClassName, `ECInstanceId`);
|
|
253
|
+
this.removePropertyFromQuery(unionIndex, relClassName, `SourceECInstanceId`);
|
|
205
254
|
if (((_f = path.sourceClassInfo) === null || _f === void 0 ? void 0 : _f.name) ===
|
|
206
255
|
((_g = propertyField.parent) === null || _g === void 0 ? void 0 : _g.contentClassInfo.name)) {
|
|
207
|
-
this.removePropertyFromQuery(sourceClassName, propertyName);
|
|
256
|
+
this.removePropertyFromQuery(unionIndex, sourceClassName, propertyName);
|
|
208
257
|
}
|
|
209
258
|
else {
|
|
210
|
-
this.removePropertyFromQuery(sourceClassName, `ECInstanceId`);
|
|
259
|
+
this.removePropertyFromQuery(unionIndex, sourceClassName, `ECInstanceId`);
|
|
211
260
|
}
|
|
212
261
|
}
|
|
213
262
|
});
|
|
214
263
|
}
|
|
215
|
-
removePropertyFromQuery(className, propertyName) {
|
|
264
|
+
removePropertyFromQuery(unionIndex, className, propertyName) {
|
|
216
265
|
var _a, _b, _c, _d;
|
|
217
|
-
const foundClass = (_a = this.query) === null || _a === void 0 ? void 0 : _a.classes.find((c) => c.className === className);
|
|
266
|
+
const foundClass = (_a = this.query) === null || _a === void 0 ? void 0 : _a.unions[unionIndex].classes.find((c) => c.className === className);
|
|
218
267
|
if (foundClass) {
|
|
219
268
|
const foundPropertyIndex = foundClass.properties.findIndex((p) => p.name === propertyName);
|
|
220
269
|
if (foundPropertyIndex > -1) {
|
|
@@ -222,123 +271,156 @@ class QueryBuilder {
|
|
|
222
271
|
}
|
|
223
272
|
if (foundClass.properties.length === 0) {
|
|
224
273
|
// remove the entire class if all properties are removed
|
|
225
|
-
const foundClassIndex = (_c = (_b = this.query) === null || _b === void 0 ? void 0 : _b.classes.findIndex((c) => c.className === className)) !== null && _c !== void 0 ? _c : -1;
|
|
274
|
+
const foundClassIndex = (_c = (_b = this.query) === null || _b === void 0 ? void 0 : _b.unions[unionIndex].classes.findIndex((c) => c.className === className)) !== null && _c !== void 0 ? _c : -1;
|
|
226
275
|
if (foundClassIndex > -1) {
|
|
227
|
-
(_d = this.query) === null || _d === void 0 ? void 0 : _d.classes.splice(foundClassIndex, 1);
|
|
276
|
+
(_d = this.query) === null || _d === void 0 ? void 0 : _d.unions[unionIndex].classes.splice(foundClassIndex, 1);
|
|
228
277
|
}
|
|
229
278
|
}
|
|
230
279
|
}
|
|
231
280
|
}
|
|
281
|
+
categoryQuery(codeValue) {
|
|
282
|
+
return ` JOIN bis.Category ON bis.Category.ECInstanceId = bis.GeometricElement3d.category.id AND ((bis.Category.CodeValue='${codeValue}') OR (bis.Category.UserLabel='${codeValue}'))`;
|
|
283
|
+
}
|
|
232
284
|
buildQueryString() {
|
|
233
|
-
if (this.query === undefined ||
|
|
285
|
+
if (this.query === undefined ||
|
|
286
|
+
this.query.unions.length === 0 ||
|
|
287
|
+
this.query.unions[0].classes.length === 0) {
|
|
234
288
|
return "";
|
|
235
289
|
}
|
|
236
|
-
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
if (joinClass.
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
if (this._isFloat(joinClass.properties[0].value)) {
|
|
257
|
-
queryString += ` ON ROUND(${joinClassName}.${joinClass.properties[0].name}, `;
|
|
258
|
-
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
259
|
-
queryString += `${Number(joinClass.properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
290
|
+
let unionQuery = "";
|
|
291
|
+
for (const union of this.query.unions) {
|
|
292
|
+
const baseClass = union.classes[0];
|
|
293
|
+
const baseClassName = baseClass.className;
|
|
294
|
+
const baseIdName = baseClass.isAspect
|
|
295
|
+
? `${baseClassName}.Element.id`
|
|
296
|
+
: `${baseClassName}.ECInstanceId`;
|
|
297
|
+
let queryString = `SELECT ${baseIdName}${baseClass.isAspect ? " ECInstanceId" : ""} FROM ${baseClassName}`;
|
|
298
|
+
if (union.classes.length > 1) {
|
|
299
|
+
for (let i = 1; i < union.classes.length; i++) {
|
|
300
|
+
const joinClass = union.classes[i];
|
|
301
|
+
const joinClassName = joinClass.className;
|
|
302
|
+
const joinIdName = joinClass.isAspect
|
|
303
|
+
? `${joinClassName}.Element.id`
|
|
304
|
+
: `${joinClassName}.ECInstanceId`;
|
|
305
|
+
if (joinClass.isRelational) {
|
|
306
|
+
queryString += ` JOIN ${joinClassName}`;
|
|
307
|
+
if (joinClass.properties.length > 0) {
|
|
308
|
+
if (joinClass.properties[0].isCategory) {
|
|
309
|
+
queryString += this.categoryQuery(joinClass.properties[0].value.toString());
|
|
260
310
|
}
|
|
261
311
|
else {
|
|
262
|
-
|
|
312
|
+
if (joinClass.properties[0].needsQuote) {
|
|
313
|
+
queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}='${joinClass.properties[0].value}'`;
|
|
314
|
+
}
|
|
315
|
+
else {
|
|
316
|
+
if (this._isFloat(joinClass.properties[0].value)) {
|
|
317
|
+
queryString += ` ON ROUND(${joinClassName}.${joinClass.properties[0].name}, `;
|
|
318
|
+
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
319
|
+
queryString += `${Number(joinClass.properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
queryString += ` ON ${joinClassName}.${joinClass.properties[0].name}=${joinClass.properties[0].value}`;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
263
325
|
}
|
|
264
326
|
}
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
queryString += ` AND ${joinIdName} = ${baseIdName}`;
|
|
269
|
-
}
|
|
270
|
-
for (const property of joinClass.properties) {
|
|
271
|
-
if (property.needsQuote) {
|
|
272
|
-
queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
|
|
327
|
+
// when base is regular property, link base to first joined relational property
|
|
328
|
+
if (!baseClass.isRelational && i === 1) {
|
|
329
|
+
queryString += ` AND ${joinIdName} = ${baseIdName}`;
|
|
273
330
|
}
|
|
274
|
-
|
|
275
|
-
if (
|
|
276
|
-
queryString +=
|
|
277
|
-
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
278
|
-
queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
331
|
+
for (const property of joinClass.properties) {
|
|
332
|
+
if (property.isCategory) {
|
|
333
|
+
queryString += this.categoryQuery(property.value.toString());
|
|
279
334
|
}
|
|
280
335
|
else {
|
|
281
|
-
|
|
336
|
+
if (property.needsQuote) {
|
|
337
|
+
queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
|
|
338
|
+
}
|
|
339
|
+
else {
|
|
340
|
+
if (this._isFloat(property.value)) {
|
|
341
|
+
queryString += ` AND ROUND(${joinClassName}.${property.name}, `;
|
|
342
|
+
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
343
|
+
queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
344
|
+
}
|
|
345
|
+
else {
|
|
346
|
+
queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
282
349
|
}
|
|
283
350
|
}
|
|
284
351
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
|
|
291
|
-
}
|
|
292
|
-
else {
|
|
293
|
-
if (this._isFloat(property.value)) {
|
|
294
|
-
queryString += ` AND ROUND(${joinClassName}.${property.name}, `;
|
|
295
|
-
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
296
|
-
queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
352
|
+
else {
|
|
353
|
+
queryString += ` JOIN ${joinClassName} ON ${joinIdName} = ${baseIdName}`;
|
|
354
|
+
for (const property of joinClass.properties) {
|
|
355
|
+
if (property.isCategory) {
|
|
356
|
+
queryString += this.categoryQuery(property.value.toString());
|
|
297
357
|
}
|
|
298
358
|
else {
|
|
299
|
-
|
|
359
|
+
if (property.needsQuote) {
|
|
360
|
+
queryString += ` AND ${joinClassName}.${property.name}='${property.value}'`;
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
if (this._isFloat(property.value)) {
|
|
364
|
+
queryString += ` AND ROUND(${joinClassName}.${property.name}, `;
|
|
365
|
+
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
366
|
+
queryString += `${Number(property.value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
367
|
+
}
|
|
368
|
+
else {
|
|
369
|
+
queryString += ` AND ${joinClassName}.${property.name}=${property.value}`;
|
|
370
|
+
}
|
|
371
|
+
}
|
|
300
372
|
}
|
|
301
373
|
}
|
|
302
374
|
}
|
|
303
375
|
}
|
|
304
376
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
queryString += ` WHERE ${baseClassName}.${properties[0].name}='${properties[0].value}'`;
|
|
310
|
-
}
|
|
311
|
-
else {
|
|
312
|
-
if (this._isFloat(properties[0].value)) {
|
|
313
|
-
queryString += ` WHERE ROUND(${baseClassName}.${properties[0].name}, `;
|
|
314
|
-
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
315
|
-
queryString += `${Number(properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
377
|
+
const properties = baseClass.properties;
|
|
378
|
+
if (properties.length > 0) {
|
|
379
|
+
if (properties[0].isCategory) {
|
|
380
|
+
queryString += this.categoryQuery(properties[0].value.toString());
|
|
316
381
|
}
|
|
317
382
|
else {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
if (properties.length > 1) {
|
|
322
|
-
for (let i = 1; i < properties.length; i++) {
|
|
323
|
-
if (properties[i].needsQuote) {
|
|
324
|
-
queryString += ` AND ${baseClassName}.${properties[i].name}='${properties[i].value}'`;
|
|
383
|
+
if (properties[0].needsQuote) {
|
|
384
|
+
queryString += ` WHERE ${baseClassName}.${properties[0].name}='${properties[0].value}'`;
|
|
325
385
|
}
|
|
326
386
|
else {
|
|
327
|
-
if (this._isFloat(properties[
|
|
328
|
-
queryString += `
|
|
387
|
+
if (this._isFloat(properties[0].value)) {
|
|
388
|
+
queryString += ` WHERE ROUND(${baseClassName}.${properties[0].name}, `;
|
|
329
389
|
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
330
|
-
queryString += `${Number(properties[
|
|
390
|
+
queryString += `${Number(properties[0].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
331
391
|
}
|
|
332
392
|
else {
|
|
333
|
-
queryString += `
|
|
393
|
+
queryString += ` WHERE ${baseClassName}.${properties[0].name}=${properties[0].value}`;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
if (properties.length > 1) {
|
|
398
|
+
for (let i = 1; i < properties.length; i++) {
|
|
399
|
+
if (properties[i].isCategory) {
|
|
400
|
+
queryString += this.categoryQuery(properties[i].value.toString());
|
|
401
|
+
}
|
|
402
|
+
else {
|
|
403
|
+
if (properties[i].needsQuote) {
|
|
404
|
+
queryString += ` AND ${baseClassName}.${properties[i].name}='${properties[i].value}'`;
|
|
405
|
+
}
|
|
406
|
+
else {
|
|
407
|
+
if (this._isFloat(properties[i].value)) {
|
|
408
|
+
queryString += ` AND ROUND(${baseClassName}.${properties[i].name}, `;
|
|
409
|
+
queryString += `${QueryBuilder.DEFAULT_DOUBLE_PRECISION})=`;
|
|
410
|
+
queryString += `${Number(properties[i].value).toFixed(QueryBuilder.DEFAULT_DOUBLE_PRECISION)}`;
|
|
411
|
+
}
|
|
412
|
+
else {
|
|
413
|
+
queryString += ` AND ${baseClassName}.${properties[i].name}=${properties[i].value}`;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
334
416
|
}
|
|
335
417
|
}
|
|
336
418
|
}
|
|
337
419
|
}
|
|
420
|
+
unionQuery += `${queryString} UNION `;
|
|
338
421
|
}
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
return queryString;
|
|
422
|
+
unionQuery = unionQuery.slice(0, unionQuery.length - 7);
|
|
423
|
+
return unionQuery;
|
|
342
424
|
}
|
|
343
425
|
_isFloat(n) {
|
|
344
426
|
return Number(n) === n && n % 1 !== 0;
|