query-layers-expression 1.0.7 → 1.0.8
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/build/index.d.ts +1 -1
- package/build/index.js +125 -76
- package/package.json +1 -1
- package/src/index.ts +173 -85
package/build/index.d.ts
CHANGED
|
@@ -18,6 +18,6 @@ declare class QueryExpressionLayers implements queryExpressionType {
|
|
|
18
18
|
statusField?: any;
|
|
19
19
|
qExpression?: any;
|
|
20
20
|
constructor(qValues: any, qFields: any, chartCategory: any, chartCategoryField: any, chartCategoryType: "number" | "string", status: number, statusField: any, qExpression: any);
|
|
21
|
-
queryExpression: (
|
|
21
|
+
queryExpression: () => string;
|
|
22
22
|
}
|
|
23
23
|
export default QueryExpressionLayers;
|
package/build/index.js
CHANGED
|
@@ -4,23 +4,24 @@ class QueryExpressionLayers {
|
|
|
4
4
|
constructor(qValues, qFields, chartCategory, chartCategoryField, chartCategoryType, status, statusField, qExpression) {
|
|
5
5
|
//--- Method ---//
|
|
6
6
|
//--- Query Expression
|
|
7
|
-
this.queryExpression = (
|
|
7
|
+
this.queryExpression = () => {
|
|
8
8
|
//--- Basic query expression
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
this.qValues;
|
|
10
|
+
const query1 = typeof this.qValues?.[0] === "number"
|
|
11
|
+
? `${this.qFields?.[0]} = ${this.qValues?.[0]}`
|
|
12
|
+
: `${this.qFields?.[0]} = '${this.qValues?.[0]}'`;
|
|
13
|
+
const query2 = typeof this.qValues?.[1] === "number"
|
|
14
|
+
? `${this.qFields?.[1]} = ${this.qValues?.[1]}`
|
|
15
|
+
: `${this.qFields?.[1]} = '${this.qValues?.[1]}'`;
|
|
16
|
+
const query3 = typeof this.qValues?.[2] === "number"
|
|
17
|
+
? `${this.qFields?.[2]} = ${this.qValues?.[2]}`
|
|
18
|
+
: `${this.qFields?.[2]} = '${this.qValues?.[2]}'`;
|
|
18
19
|
const query12 = `${query1} AND ${query2}`;
|
|
19
20
|
const query123 = `${query1} AND ${query2} AND ${query3}`;
|
|
20
|
-
const q_status = `${statusField} = ${status}`;
|
|
21
|
-
const q_chartC = chartCategoryType === "string"
|
|
22
|
-
? `${chartCategoryField} = '${chartCategory}'`
|
|
23
|
-
: `${chartCategoryField} = ${chartCategory}`;
|
|
21
|
+
const q_status = `${this.statusField} = ${this.status}`;
|
|
22
|
+
const q_chartC = this.chartCategoryType === "string"
|
|
23
|
+
? `${this.chartCategoryField} = '${this.chartCategory}'`
|
|
24
|
+
: `${this.chartCategoryField} = ${this.chartCategory}`;
|
|
24
25
|
const q_status_chartC = `${q_status} AND ${q_chartC}`;
|
|
25
26
|
const query1_chartC = `${query1} AND ${q_chartC}`;
|
|
26
27
|
const query12_chartC = `${query12} AND ${q_chartC}`;
|
|
@@ -32,141 +33,189 @@ class QueryExpressionLayers {
|
|
|
32
33
|
const query12_status_chartC = `${query12_status} AND ${q_chartC}`;
|
|
33
34
|
const query123_status_chartC = `${query123_status} AND ${q_chartC}`;
|
|
34
35
|
//--- With qExpression
|
|
35
|
-
const query1_qE = `${query1} AND ${qExpression}`;
|
|
36
|
-
const query12_qE = `${query12} AND ${qExpression}`;
|
|
37
|
-
const query123_qE = `${query123} AND ${qExpression}`;
|
|
38
|
-
const q_status_qE = `${q_status} AND ${qExpression}`;
|
|
39
|
-
const q_chartC_qE = `${q_chartC} AND ${qExpression}`;
|
|
40
|
-
const q_status_chartC_qE = `${q_status_chartC} AND ${qExpression}`;
|
|
41
|
-
const query1_chartC_qE = `${query1_chartC} AND ${qExpression}`;
|
|
42
|
-
const query12_chartC_qE = `${query12_chartC} AND ${qExpression}`;
|
|
43
|
-
const query123_chartC_qE = `${query123_chartC} AND ${qExpression}`;
|
|
44
|
-
const query1_status_qE = `${query1_status} AND ${qExpression}`;
|
|
45
|
-
const query12_status_qE = `${query12_status} AND ${qExpression}`;
|
|
46
|
-
const query123_status_qE = `${query123_status} AND ${qExpression}`;
|
|
47
|
-
const query1_status_chartC_qE = `${query1_status_chartC} AND ${qExpression}`;
|
|
48
|
-
const query12_status_chartC_qE = `${query12_status_chartC} AND ${qExpression}`;
|
|
49
|
-
const query123_status_chartC_qE = `${query123_status_chartC} AND ${qExpression}`;
|
|
36
|
+
const query1_qE = `${query1} AND ${this.qExpression}`;
|
|
37
|
+
const query12_qE = `${query12} AND ${this.qExpression}`;
|
|
38
|
+
const query123_qE = `${query123} AND ${this.qExpression}`;
|
|
39
|
+
const q_status_qE = `${q_status} AND ${this.qExpression}`;
|
|
40
|
+
const q_chartC_qE = `${q_chartC} AND ${this.qExpression}`;
|
|
41
|
+
const q_status_chartC_qE = `${q_status_chartC} AND ${this.qExpression}`;
|
|
42
|
+
const query1_chartC_qE = `${query1_chartC} AND ${this.qExpression}`;
|
|
43
|
+
const query12_chartC_qE = `${query12_chartC} AND ${this.qExpression}`;
|
|
44
|
+
const query123_chartC_qE = `${query123_chartC} AND ${this.qExpression}`;
|
|
45
|
+
const query1_status_qE = `${query1_status} AND ${this.qExpression}`;
|
|
46
|
+
const query12_status_qE = `${query12_status} AND ${this.qExpression}`;
|
|
47
|
+
const query123_status_qE = `${query123_status} AND ${this.qExpression}`;
|
|
48
|
+
const query1_status_chartC_qE = `${query1_status_chartC} AND ${this.qExpression}`;
|
|
49
|
+
const query12_status_chartC_qE = `${query12_status_chartC} AND ${this.qExpression}`;
|
|
50
|
+
const query123_status_chartC_qE = `${query123_status_chartC} AND ${this.qExpression}`;
|
|
50
51
|
let expression = "";
|
|
51
|
-
if (qExpression) {
|
|
52
|
-
if (chartCategoryField) {
|
|
53
|
-
if (statusField) {
|
|
54
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
52
|
+
if (this.qExpression) {
|
|
53
|
+
if (this.chartCategoryField) {
|
|
54
|
+
if (this.statusField) {
|
|
55
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
55
56
|
expression = q_status_chartC_qE;
|
|
56
57
|
}
|
|
57
|
-
else if (qValues?.[0] &&
|
|
58
|
+
else if (this.qValues?.[0] &&
|
|
59
|
+
!this.qValues?.[1] &&
|
|
60
|
+
!this.qValues?.[2]) {
|
|
58
61
|
expression = query1_status_chartC_qE;
|
|
59
62
|
}
|
|
60
|
-
else if (qValues?.[0] &&
|
|
63
|
+
else if (this.qValues?.[0] &&
|
|
64
|
+
this.qValues?.[1] &&
|
|
65
|
+
!this.qValues?.[2]) {
|
|
61
66
|
expression = query12_status_chartC_qE;
|
|
62
67
|
}
|
|
63
|
-
else if (qValues?.[0] &&
|
|
68
|
+
else if (this.qValues?.[0] &&
|
|
69
|
+
this.qValues?.[1] &&
|
|
70
|
+
this.qValues?.[2]) {
|
|
64
71
|
expression = query123_status_chartC_qE;
|
|
65
72
|
}
|
|
66
73
|
}
|
|
67
|
-
else if (!statusField) {
|
|
68
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
74
|
+
else if (!this.statusField) {
|
|
75
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
69
76
|
expression = q_chartC_qE;
|
|
70
77
|
}
|
|
71
|
-
else if (qValues?.[0] &&
|
|
78
|
+
else if (this.qValues?.[0] &&
|
|
79
|
+
!this.qValues?.[1] &&
|
|
80
|
+
!this.qValues?.[2]) {
|
|
72
81
|
expression = query1_chartC_qE;
|
|
73
82
|
}
|
|
74
|
-
else if (qValues?.[0] &&
|
|
83
|
+
else if (this.qValues?.[0] &&
|
|
84
|
+
this.qValues?.[1] &&
|
|
85
|
+
!this.qValues?.[2]) {
|
|
75
86
|
expression = query12_chartC_qE;
|
|
76
87
|
}
|
|
77
|
-
else if (qValues?.[0] &&
|
|
88
|
+
else if (this.qValues?.[0] &&
|
|
89
|
+
this.qValues?.[1] &&
|
|
90
|
+
this.qValues?.[2]) {
|
|
78
91
|
expression = query123_chartC_qE;
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
94
|
}
|
|
82
|
-
else if (!chartCategoryField) {
|
|
83
|
-
if (statusField) {
|
|
84
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
95
|
+
else if (!this.chartCategoryField) {
|
|
96
|
+
if (this.statusField) {
|
|
97
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
85
98
|
expression = q_status_qE;
|
|
86
99
|
}
|
|
87
|
-
else if (qValues?.[0] &&
|
|
100
|
+
else if (this.qValues?.[0] &&
|
|
101
|
+
!this.qValues?.[1] &&
|
|
102
|
+
!this.qValues?.[2]) {
|
|
88
103
|
expression = query1_status_qE;
|
|
89
104
|
}
|
|
90
|
-
else if (qValues?.[0] &&
|
|
105
|
+
else if (this.qValues?.[0] &&
|
|
106
|
+
this.qValues?.[1] &&
|
|
107
|
+
!this.qValues?.[2]) {
|
|
91
108
|
expression = query12_status_qE;
|
|
92
109
|
}
|
|
93
|
-
else if (qValues?.[0] &&
|
|
110
|
+
else if (this.qValues?.[0] &&
|
|
111
|
+
this.qValues?.[1] &&
|
|
112
|
+
this.qValues?.[2]) {
|
|
94
113
|
expression = query123_status_qE;
|
|
95
114
|
}
|
|
96
115
|
}
|
|
97
|
-
else if (!statusField) {
|
|
98
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
99
|
-
expression = qExpression;
|
|
116
|
+
else if (!this.statusField) {
|
|
117
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
118
|
+
expression = this.qExpression;
|
|
100
119
|
}
|
|
101
|
-
else if (qValues?.[0] &&
|
|
120
|
+
else if (this.qValues?.[0] &&
|
|
121
|
+
!this.qValues?.[1] &&
|
|
122
|
+
!this.qValues?.[2]) {
|
|
102
123
|
expression = query1_qE;
|
|
103
124
|
}
|
|
104
|
-
else if (qValues?.[0] &&
|
|
125
|
+
else if (this.qValues?.[0] &&
|
|
126
|
+
this.qValues?.[1] &&
|
|
127
|
+
!this.qValues?.[2]) {
|
|
105
128
|
expression = query12_qE;
|
|
106
129
|
}
|
|
107
|
-
else if (qValues?.[0] &&
|
|
130
|
+
else if (this.qValues?.[0] &&
|
|
131
|
+
this.qValues?.[1] &&
|
|
132
|
+
this.qValues?.[2]) {
|
|
108
133
|
expression = query123_qE;
|
|
109
134
|
}
|
|
110
135
|
}
|
|
111
136
|
}
|
|
112
137
|
}
|
|
113
|
-
else if (!qExpression) {
|
|
114
|
-
if (chartCategoryField) {
|
|
115
|
-
if (statusField) {
|
|
116
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
138
|
+
else if (!this.qExpression) {
|
|
139
|
+
if (this.chartCategoryField) {
|
|
140
|
+
if (this.statusField) {
|
|
141
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
117
142
|
expression = q_status_chartC;
|
|
118
143
|
}
|
|
119
|
-
else if (qValues?.[0] &&
|
|
144
|
+
else if (this.qValues?.[0] &&
|
|
145
|
+
!this.qValues?.[1] &&
|
|
146
|
+
!this.qValues?.[2]) {
|
|
120
147
|
expression = query1_status_chartC;
|
|
121
148
|
}
|
|
122
|
-
else if (qValues?.[0] &&
|
|
149
|
+
else if (this.qValues?.[0] &&
|
|
150
|
+
this.qValues?.[1] &&
|
|
151
|
+
!this.qValues?.[2]) {
|
|
123
152
|
expression = query12_status_chartC;
|
|
124
153
|
}
|
|
125
|
-
else if (qValues?.[0] &&
|
|
154
|
+
else if (this.qValues?.[0] &&
|
|
155
|
+
this.qValues?.[1] &&
|
|
156
|
+
this.qValues?.[2]) {
|
|
126
157
|
expression = query123_status_chartC;
|
|
127
158
|
}
|
|
128
159
|
}
|
|
129
|
-
else if (!statusField) {
|
|
130
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
160
|
+
else if (!this.statusField) {
|
|
161
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
131
162
|
expression = q_chartC;
|
|
132
163
|
}
|
|
133
|
-
else if (qValues?.[0] &&
|
|
164
|
+
else if (this.qValues?.[0] &&
|
|
165
|
+
!this.qValues?.[1] &&
|
|
166
|
+
!this.qValues?.[2]) {
|
|
134
167
|
expression = query1_chartC;
|
|
135
168
|
}
|
|
136
|
-
else if (qValues?.[0] &&
|
|
169
|
+
else if (this.qValues?.[0] &&
|
|
170
|
+
this.qValues?.[1] &&
|
|
171
|
+
!this.qValues?.[2]) {
|
|
137
172
|
expression = query12_chartC;
|
|
138
173
|
}
|
|
139
|
-
else if (qValues?.[0] &&
|
|
174
|
+
else if (this.qValues?.[0] &&
|
|
175
|
+
this.qValues?.[1] &&
|
|
176
|
+
this.qValues?.[2]) {
|
|
140
177
|
expression = query123_chartC;
|
|
141
178
|
}
|
|
142
179
|
}
|
|
143
180
|
}
|
|
144
|
-
else if (!chartCategoryField) {
|
|
145
|
-
if (statusField) {
|
|
146
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
181
|
+
else if (!this.chartCategoryField) {
|
|
182
|
+
if (this.statusField) {
|
|
183
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
147
184
|
expression = q_status;
|
|
148
185
|
}
|
|
149
|
-
else if (qValues?.[0] &&
|
|
186
|
+
else if (this.qValues?.[0] &&
|
|
187
|
+
!this.qValues?.[1] &&
|
|
188
|
+
!this.qValues?.[2]) {
|
|
150
189
|
expression = query1_status;
|
|
151
190
|
}
|
|
152
|
-
else if (qValues?.[0] &&
|
|
191
|
+
else if (this.qValues?.[0] &&
|
|
192
|
+
this.qValues?.[1] &&
|
|
193
|
+
!this.qValues?.[2]) {
|
|
153
194
|
expression = query12_status;
|
|
154
195
|
}
|
|
155
|
-
else if (qValues?.[0] &&
|
|
196
|
+
else if (this.qValues?.[0] &&
|
|
197
|
+
this.qValues?.[1] &&
|
|
198
|
+
this.qValues?.[2]) {
|
|
156
199
|
expression = query123_status;
|
|
157
200
|
}
|
|
158
201
|
}
|
|
159
|
-
else if (!statusField) {
|
|
160
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
202
|
+
else if (!this.statusField) {
|
|
203
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
161
204
|
expression = "1=1";
|
|
162
205
|
}
|
|
163
|
-
else if (qValues?.[0] &&
|
|
206
|
+
else if (this.qValues?.[0] &&
|
|
207
|
+
!this.qValues?.[1] &&
|
|
208
|
+
!this.qValues?.[2]) {
|
|
164
209
|
expression = query1;
|
|
165
210
|
}
|
|
166
|
-
else if (qValues?.[0] &&
|
|
211
|
+
else if (this.qValues?.[0] &&
|
|
212
|
+
this.qValues?.[1] &&
|
|
213
|
+
!this.qValues?.[2]) {
|
|
167
214
|
expression = query12;
|
|
168
215
|
}
|
|
169
|
-
else if (qValues?.[0] &&
|
|
216
|
+
else if (this.qValues?.[0] &&
|
|
217
|
+
this.qValues?.[1] &&
|
|
218
|
+
this.qValues?.[2]) {
|
|
170
219
|
expression = query123;
|
|
171
220
|
}
|
|
172
221
|
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -41,36 +41,28 @@ class QueryExpressionLayers implements queryExpressionType {
|
|
|
41
41
|
|
|
42
42
|
//--- Method ---//
|
|
43
43
|
//--- Query Expression
|
|
44
|
-
queryExpression = ({
|
|
45
|
-
qValues,
|
|
46
|
-
qFields,
|
|
47
|
-
chartCategory,
|
|
48
|
-
chartCategoryField,
|
|
49
|
-
chartCategoryType,
|
|
50
|
-
status,
|
|
51
|
-
statusField,
|
|
52
|
-
qExpression,
|
|
53
|
-
}: queryExpressionType) => {
|
|
44
|
+
queryExpression = () => {
|
|
54
45
|
//--- Basic query expression
|
|
46
|
+
this.qValues;
|
|
55
47
|
const query1 =
|
|
56
|
-
typeof qValues?.[0] === "number"
|
|
57
|
-
? `${qFields?.[0]} = ${qValues?.[0]}`
|
|
58
|
-
: `${qFields?.[0]} = '${qValues?.[0]}'`;
|
|
48
|
+
typeof this.qValues?.[0] === "number"
|
|
49
|
+
? `${this.qFields?.[0]} = ${this.qValues?.[0]}`
|
|
50
|
+
: `${this.qFields?.[0]} = '${this.qValues?.[0]}'`;
|
|
59
51
|
const query2 =
|
|
60
|
-
typeof qValues?.[1] === "number"
|
|
61
|
-
? `${qFields?.[1]} = ${qValues?.[1]}`
|
|
62
|
-
: `${qFields?.[1]} = '${qValues?.[1]}'`;
|
|
52
|
+
typeof this.qValues?.[1] === "number"
|
|
53
|
+
? `${this.qFields?.[1]} = ${this.qValues?.[1]}`
|
|
54
|
+
: `${this.qFields?.[1]} = '${this.qValues?.[1]}'`;
|
|
63
55
|
const query3 =
|
|
64
|
-
typeof qValues?.[2] === "number"
|
|
65
|
-
? `${qFields?.[2]} = ${qValues?.[2]}`
|
|
66
|
-
: `${qFields?.[2]} = '${qValues?.[2]}'`;
|
|
56
|
+
typeof this.qValues?.[2] === "number"
|
|
57
|
+
? `${this.qFields?.[2]} = ${this.qValues?.[2]}`
|
|
58
|
+
: `${this.qFields?.[2]} = '${this.qValues?.[2]}'`;
|
|
67
59
|
const query12 = `${query1} AND ${query2}`;
|
|
68
60
|
const query123 = `${query1} AND ${query2} AND ${query3}`;
|
|
69
|
-
const q_status = `${statusField} = ${status}`;
|
|
61
|
+
const q_status = `${this.statusField} = ${this.status}`;
|
|
70
62
|
const q_chartC =
|
|
71
|
-
chartCategoryType === "string"
|
|
72
|
-
? `${chartCategoryField} = '${chartCategory}'`
|
|
73
|
-
: `${chartCategoryField} = ${chartCategory}`;
|
|
63
|
+
this.chartCategoryType === "string"
|
|
64
|
+
? `${this.chartCategoryField} = '${this.chartCategory}'`
|
|
65
|
+
: `${this.chartCategoryField} = ${this.chartCategory}`;
|
|
74
66
|
const q_status_chartC = `${q_status} AND ${q_chartC}`;
|
|
75
67
|
const query1_chartC = `${query1} AND ${q_chartC}`;
|
|
76
68
|
const query12_chartC = `${query12} AND ${q_chartC}`;
|
|
@@ -83,111 +75,207 @@ class QueryExpressionLayers implements queryExpressionType {
|
|
|
83
75
|
const query123_status_chartC = `${query123_status} AND ${q_chartC}`;
|
|
84
76
|
|
|
85
77
|
//--- With qExpression
|
|
86
|
-
const query1_qE = `${query1} AND ${qExpression}`;
|
|
87
|
-
const query12_qE = `${query12} AND ${qExpression}`;
|
|
88
|
-
const query123_qE = `${query123} AND ${qExpression}`;
|
|
89
|
-
const q_status_qE = `${q_status} AND ${qExpression}`;
|
|
90
|
-
const q_chartC_qE = `${q_chartC} AND ${qExpression}`;
|
|
91
|
-
const q_status_chartC_qE = `${q_status_chartC} AND ${qExpression}`;
|
|
92
|
-
const query1_chartC_qE = `${query1_chartC} AND ${qExpression}`;
|
|
93
|
-
const query12_chartC_qE = `${query12_chartC} AND ${qExpression}`;
|
|
94
|
-
const query123_chartC_qE = `${query123_chartC} AND ${qExpression}`;
|
|
95
|
-
const query1_status_qE = `${query1_status} AND ${qExpression}`;
|
|
96
|
-
const query12_status_qE = `${query12_status} AND ${qExpression}`;
|
|
97
|
-
const query123_status_qE = `${query123_status} AND ${qExpression}`;
|
|
98
|
-
const query1_status_chartC_qE = `${query1_status_chartC} AND ${qExpression}`;
|
|
99
|
-
const query12_status_chartC_qE = `${query12_status_chartC} AND ${qExpression}`;
|
|
100
|
-
const query123_status_chartC_qE = `${query123_status_chartC} AND ${qExpression}`;
|
|
78
|
+
const query1_qE = `${query1} AND ${this.qExpression}`;
|
|
79
|
+
const query12_qE = `${query12} AND ${this.qExpression}`;
|
|
80
|
+
const query123_qE = `${query123} AND ${this.qExpression}`;
|
|
81
|
+
const q_status_qE = `${q_status} AND ${this.qExpression}`;
|
|
82
|
+
const q_chartC_qE = `${q_chartC} AND ${this.qExpression}`;
|
|
83
|
+
const q_status_chartC_qE = `${q_status_chartC} AND ${this.qExpression}`;
|
|
84
|
+
const query1_chartC_qE = `${query1_chartC} AND ${this.qExpression}`;
|
|
85
|
+
const query12_chartC_qE = `${query12_chartC} AND ${this.qExpression}`;
|
|
86
|
+
const query123_chartC_qE = `${query123_chartC} AND ${this.qExpression}`;
|
|
87
|
+
const query1_status_qE = `${query1_status} AND ${this.qExpression}`;
|
|
88
|
+
const query12_status_qE = `${query12_status} AND ${this.qExpression}`;
|
|
89
|
+
const query123_status_qE = `${query123_status} AND ${this.qExpression}`;
|
|
90
|
+
const query1_status_chartC_qE = `${query1_status_chartC} AND ${this.qExpression}`;
|
|
91
|
+
const query12_status_chartC_qE = `${query12_status_chartC} AND ${this.qExpression}`;
|
|
92
|
+
const query123_status_chartC_qE = `${query123_status_chartC} AND ${this.qExpression}`;
|
|
101
93
|
|
|
102
94
|
let expression = "";
|
|
103
|
-
if (qExpression) {
|
|
104
|
-
if (chartCategoryField) {
|
|
105
|
-
if (statusField) {
|
|
106
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
95
|
+
if (this.qExpression) {
|
|
96
|
+
if (this.chartCategoryField) {
|
|
97
|
+
if (this.statusField) {
|
|
98
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
107
99
|
expression = q_status_chartC_qE;
|
|
108
|
-
} else if (
|
|
100
|
+
} else if (
|
|
101
|
+
this.qValues?.[0] &&
|
|
102
|
+
!this.qValues?.[1] &&
|
|
103
|
+
!this.qValues?.[2]
|
|
104
|
+
) {
|
|
109
105
|
expression = query1_status_chartC_qE;
|
|
110
|
-
} else if (
|
|
106
|
+
} else if (
|
|
107
|
+
this.qValues?.[0] &&
|
|
108
|
+
this.qValues?.[1] &&
|
|
109
|
+
!this.qValues?.[2]
|
|
110
|
+
) {
|
|
111
111
|
expression = query12_status_chartC_qE;
|
|
112
|
-
} else if (
|
|
112
|
+
} else if (
|
|
113
|
+
this.qValues?.[0] &&
|
|
114
|
+
this.qValues?.[1] &&
|
|
115
|
+
this.qValues?.[2]
|
|
116
|
+
) {
|
|
113
117
|
expression = query123_status_chartC_qE;
|
|
114
118
|
}
|
|
115
|
-
} else if (!statusField) {
|
|
116
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
119
|
+
} else if (!this.statusField) {
|
|
120
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
117
121
|
expression = q_chartC_qE;
|
|
118
|
-
} else if (
|
|
122
|
+
} else if (
|
|
123
|
+
this.qValues?.[0] &&
|
|
124
|
+
!this.qValues?.[1] &&
|
|
125
|
+
!this.qValues?.[2]
|
|
126
|
+
) {
|
|
119
127
|
expression = query1_chartC_qE;
|
|
120
|
-
} else if (
|
|
128
|
+
} else if (
|
|
129
|
+
this.qValues?.[0] &&
|
|
130
|
+
this.qValues?.[1] &&
|
|
131
|
+
!this.qValues?.[2]
|
|
132
|
+
) {
|
|
121
133
|
expression = query12_chartC_qE;
|
|
122
|
-
} else if (
|
|
134
|
+
} else if (
|
|
135
|
+
this.qValues?.[0] &&
|
|
136
|
+
this.qValues?.[1] &&
|
|
137
|
+
this.qValues?.[2]
|
|
138
|
+
) {
|
|
123
139
|
expression = query123_chartC_qE;
|
|
124
140
|
}
|
|
125
141
|
}
|
|
126
|
-
} else if (!chartCategoryField) {
|
|
127
|
-
if (statusField) {
|
|
128
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
142
|
+
} else if (!this.chartCategoryField) {
|
|
143
|
+
if (this.statusField) {
|
|
144
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
129
145
|
expression = q_status_qE;
|
|
130
|
-
} else if (
|
|
146
|
+
} else if (
|
|
147
|
+
this.qValues?.[0] &&
|
|
148
|
+
!this.qValues?.[1] &&
|
|
149
|
+
!this.qValues?.[2]
|
|
150
|
+
) {
|
|
131
151
|
expression = query1_status_qE;
|
|
132
|
-
} else if (
|
|
152
|
+
} else if (
|
|
153
|
+
this.qValues?.[0] &&
|
|
154
|
+
this.qValues?.[1] &&
|
|
155
|
+
!this.qValues?.[2]
|
|
156
|
+
) {
|
|
133
157
|
expression = query12_status_qE;
|
|
134
|
-
} else if (
|
|
158
|
+
} else if (
|
|
159
|
+
this.qValues?.[0] &&
|
|
160
|
+
this.qValues?.[1] &&
|
|
161
|
+
this.qValues?.[2]
|
|
162
|
+
) {
|
|
135
163
|
expression = query123_status_qE;
|
|
136
164
|
}
|
|
137
|
-
} else if (!statusField) {
|
|
138
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
139
|
-
expression = qExpression;
|
|
140
|
-
} else if (
|
|
165
|
+
} else if (!this.statusField) {
|
|
166
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
167
|
+
expression = this.qExpression;
|
|
168
|
+
} else if (
|
|
169
|
+
this.qValues?.[0] &&
|
|
170
|
+
!this.qValues?.[1] &&
|
|
171
|
+
!this.qValues?.[2]
|
|
172
|
+
) {
|
|
141
173
|
expression = query1_qE;
|
|
142
|
-
} else if (
|
|
174
|
+
} else if (
|
|
175
|
+
this.qValues?.[0] &&
|
|
176
|
+
this.qValues?.[1] &&
|
|
177
|
+
!this.qValues?.[2]
|
|
178
|
+
) {
|
|
143
179
|
expression = query12_qE;
|
|
144
|
-
} else if (
|
|
180
|
+
} else if (
|
|
181
|
+
this.qValues?.[0] &&
|
|
182
|
+
this.qValues?.[1] &&
|
|
183
|
+
this.qValues?.[2]
|
|
184
|
+
) {
|
|
145
185
|
expression = query123_qE;
|
|
146
186
|
}
|
|
147
187
|
}
|
|
148
188
|
}
|
|
149
|
-
} else if (!qExpression) {
|
|
150
|
-
if (chartCategoryField) {
|
|
151
|
-
if (statusField) {
|
|
152
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
189
|
+
} else if (!this.qExpression) {
|
|
190
|
+
if (this.chartCategoryField) {
|
|
191
|
+
if (this.statusField) {
|
|
192
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
153
193
|
expression = q_status_chartC;
|
|
154
|
-
} else if (
|
|
194
|
+
} else if (
|
|
195
|
+
this.qValues?.[0] &&
|
|
196
|
+
!this.qValues?.[1] &&
|
|
197
|
+
!this.qValues?.[2]
|
|
198
|
+
) {
|
|
155
199
|
expression = query1_status_chartC;
|
|
156
|
-
} else if (
|
|
200
|
+
} else if (
|
|
201
|
+
this.qValues?.[0] &&
|
|
202
|
+
this.qValues?.[1] &&
|
|
203
|
+
!this.qValues?.[2]
|
|
204
|
+
) {
|
|
157
205
|
expression = query12_status_chartC;
|
|
158
|
-
} else if (
|
|
206
|
+
} else if (
|
|
207
|
+
this.qValues?.[0] &&
|
|
208
|
+
this.qValues?.[1] &&
|
|
209
|
+
this.qValues?.[2]
|
|
210
|
+
) {
|
|
159
211
|
expression = query123_status_chartC;
|
|
160
212
|
}
|
|
161
|
-
} else if (!statusField) {
|
|
162
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
213
|
+
} else if (!this.statusField) {
|
|
214
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
163
215
|
expression = q_chartC;
|
|
164
|
-
} else if (
|
|
216
|
+
} else if (
|
|
217
|
+
this.qValues?.[0] &&
|
|
218
|
+
!this.qValues?.[1] &&
|
|
219
|
+
!this.qValues?.[2]
|
|
220
|
+
) {
|
|
165
221
|
expression = query1_chartC;
|
|
166
|
-
} else if (
|
|
222
|
+
} else if (
|
|
223
|
+
this.qValues?.[0] &&
|
|
224
|
+
this.qValues?.[1] &&
|
|
225
|
+
!this.qValues?.[2]
|
|
226
|
+
) {
|
|
167
227
|
expression = query12_chartC;
|
|
168
|
-
} else if (
|
|
228
|
+
} else if (
|
|
229
|
+
this.qValues?.[0] &&
|
|
230
|
+
this.qValues?.[1] &&
|
|
231
|
+
this.qValues?.[2]
|
|
232
|
+
) {
|
|
169
233
|
expression = query123_chartC;
|
|
170
234
|
}
|
|
171
235
|
}
|
|
172
|
-
} else if (!chartCategoryField) {
|
|
173
|
-
if (statusField) {
|
|
174
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
236
|
+
} else if (!this.chartCategoryField) {
|
|
237
|
+
if (this.statusField) {
|
|
238
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
175
239
|
expression = q_status;
|
|
176
|
-
} else if (
|
|
240
|
+
} else if (
|
|
241
|
+
this.qValues?.[0] &&
|
|
242
|
+
!this.qValues?.[1] &&
|
|
243
|
+
!this.qValues?.[2]
|
|
244
|
+
) {
|
|
177
245
|
expression = query1_status;
|
|
178
|
-
} else if (
|
|
246
|
+
} else if (
|
|
247
|
+
this.qValues?.[0] &&
|
|
248
|
+
this.qValues?.[1] &&
|
|
249
|
+
!this.qValues?.[2]
|
|
250
|
+
) {
|
|
179
251
|
expression = query12_status;
|
|
180
|
-
} else if (
|
|
252
|
+
} else if (
|
|
253
|
+
this.qValues?.[0] &&
|
|
254
|
+
this.qValues?.[1] &&
|
|
255
|
+
this.qValues?.[2]
|
|
256
|
+
) {
|
|
181
257
|
expression = query123_status;
|
|
182
258
|
}
|
|
183
|
-
} else if (!statusField) {
|
|
184
|
-
if (!qValues?.[0] && !qValues?.[1] && !qValues?.[2]) {
|
|
259
|
+
} else if (!this.statusField) {
|
|
260
|
+
if (!this.qValues?.[0] && !this.qValues?.[1] && !this.qValues?.[2]) {
|
|
185
261
|
expression = "1=1";
|
|
186
|
-
} else if (
|
|
262
|
+
} else if (
|
|
263
|
+
this.qValues?.[0] &&
|
|
264
|
+
!this.qValues?.[1] &&
|
|
265
|
+
!this.qValues?.[2]
|
|
266
|
+
) {
|
|
187
267
|
expression = query1;
|
|
188
|
-
} else if (
|
|
268
|
+
} else if (
|
|
269
|
+
this.qValues?.[0] &&
|
|
270
|
+
this.qValues?.[1] &&
|
|
271
|
+
!this.qValues?.[2]
|
|
272
|
+
) {
|
|
189
273
|
expression = query12;
|
|
190
|
-
} else if (
|
|
274
|
+
} else if (
|
|
275
|
+
this.qValues?.[0] &&
|
|
276
|
+
this.qValues?.[1] &&
|
|
277
|
+
this.qValues?.[2]
|
|
278
|
+
) {
|
|
191
279
|
expression = query123;
|
|
192
280
|
}
|
|
193
281
|
}
|