-
Notifications
You must be signed in to change notification settings - Fork 18
/
questions.json
278 lines (278 loc) · 10 KB
/
questions.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
[
{
"text": "פירוט כל הכספים שהארגון קיבל ב <period>",
"query": ["with a as (",
"select year_paid as \"שנה\", budget_code as \"תקנה תקציבית\", budget_code, supporting_ministry->>0 as \"משרד\", amount_paid as \"סך כולל\", support_title as \"תיאור\", 'תמיכה' as \"סוג ההוצאה\"",
"from supports_by_payment_year where entity_id = ':id' and amount_paid>0 and year_paid :period union",
"select min_year as \"שנה\", budget_code as \"תקנה תקציבית\", budget_code, publisher_name as \"משרד\", executed as \"סך כולל\", purpose as \"תיאור\", 'רכש' as \"סוג ההוצאה\"",
"from contract_spending where entity_id = ':id' and executed > 0 and min_year :period)",
"select * from a order by \"שנה\" desc, \"סך כולל\" desc"
],
"parameters": {
"period": {
"כל השנים": ">0",
"2008": "=2008",
"2009": "=2009",
"2010": "=2010",
"2011": "=2011",
"2012": "=2012",
"2013": "=2013",
"2014": "=2014",
"2015": "=2015",
"2016": "=2016",
"2017": "=2017",
"2018": "=2018",
"2019": "=2019",
"2020": "=2020",
"2021": "=2021",
"2022": "=2022",
"2023": "=2023",
"2024": "=2024"
}
},
"defaults": {
"period": "כל השנים"
},
"headers": [
"שנה",
"תקנה תקציבית:budget_code:search_term(budget_code)",
"משרד",
"סך כולל:number",
"תיאור",
"סוג ההוצאה"
]
},
{
"text": "התקנות מהן הארגון קיבל תמיכות, לפי סה״כ כספים עבור בקשות שאושרו ב <period>",
"query": ["SELECT SUPPORT_TITLE AS \"נושא\", ",
"budget_code, ",
"budget_code \"מספר תקנה\", ",
"sum(amount_approved) as \"סה״כ אושר\", ",
"sum(amount_paid) as \"סה״כ שולם\", ",
"min(year_requested) || '-' || max(year_requested) as \"תקופה\" ",
"FROM raw_supports WHERE year_requested :period AND entity_id=':id' GROUP BY 1, 2, 3 ORDER BY 3 DESC nulls last"],
"parameters": {
"period": {
"כל השנים": ">0",
"2008": "=2008",
"2009": "=2009",
"2010": "=2010",
"2011": "=2011",
"2012": "=2012",
"2013": "=2013",
"2014": "=2014",
"2015": "=2015",
"2016": "=2016",
"2017": "=2017",
"2018": "=2018",
"2019": "=2019",
"2020": "=2020",
"2021": "=2021",
"2022": "=2022",
"2023": "=2023",
"2024": "=2024"
}
},
"headers": [
"נושא",
"מספר תקנה:budget_code:search_term(budget_code)",
"סה״כ אושר:number",
"סה״כ שולם:number",
"תקופה"
],
"defaults": {
"period": "כל השנים"
}
},
{
"text": " פירוט כלל התמיכות לארגון שאושרו ב <period>",
"query": ["SELECT year_requested AS \"שנה\",",
"supporting_ministry AS \"משרד\",",
"request_type AS \"סוג תמיכה\",",
"support_title AS \"נושא\", ",
"'supports/' || budget_code || '/' || year_requested || '/' || recipient || '/' || request_type AS item_id, ",
"sum(amount_approved) as \"סה״כ אושר\",",
"sum(amount_paid) as \"סה״כ שולם\"",
"FROM raw_supports WHERE year_requested :period AND entity_id=':id' GROUP BY 1, 2, 3, 4, 5"],
"parameters": {
"period": {
"כל השנים": ">0",
"2008": "=2008",
"2009": "=2009",
"2010": "=2010",
"2011": "=2011",
"2012": "=2012",
"2013": "=2013",
"2014": "=2014",
"2015": "=2015",
"2016": "=2016",
"2017": "=2017",
"2018": "=2018",
"2019": "=2019",
"2020": "=2020",
"2021": "=2021",
"2022": "=2022",
"2023": "=2023",
"2024": "=2024"
}
},
"defaults": {
"period": "כל השנים"
},
"headers": [
"נושא:item_link(item_id)",
"משרד",
"סוג תמיכה",
"שנה",
"סה״כ אושר:number",
"סה״כ שולם:number"
]
},
{
"text": "המכרזים והפטורים ממכרז עם הארגון - <scope>",
"query": ["select tender_type_he as \"סוג הליך הרכש\",",
"coalesce(page_title, description) as \"כותרת\",",
"regulation as \"תקנהֿ\",",
"publisher as \"מפרסם\",",
"volume as \"היקף\",",
"description as \"תיאור\", ",
"'tenders/' || tender_type || '/' || publication_id || '/' || tender_id as item_id, ",
"date(claim_date) as \"מועד סיום התהליך\",",
"start_date as \"תחילת ההתקשרות\",",
"end_date as \"סיום ההתקשרות\",",
"soproc_tender as \"רכש חברתי\"",
"from procurement_tenders_processed",
"where (entity_id=':id' or",
"awardees::text like '%%:id%%') and :scope"],
"headers": [
"סוג הליך הרכש",
"כותרת:item_link(item_id)",
"תקנהֿ",
"מפרסם",
"תיאור",
"היקף:number",
"מועד סיום התהליך",
"תחילת ההתקשרות",
"סיום ההתקשרות",
"רכש חברתי:yesno"
],
"parameters": {
"scope": {
"הכל": "true",
"רכש חברתי": "soproc_tender is true"
}
},
"defaults": {
"scope": "הכל"
}
},
{
"text": " סיכום ההתקשרויות עם הארגון מ <period>",
"query": ["SELECT sum(volume) AS \"סה״כ היקף\", ",
"sum(executed) AS \"סה״כ בוצע\",",
"currency AS \"מטבע\",",
"((publisher->>0) || '/' || (purchasing_unit->>0)) AS \"היחידה הרוכשת\",",
"purchase_method->>0 AS \"אופן הרכישה\",",
"min(min_year)||' - '||max(max_year) AS \"תקופה\"",
"FROM contract_spending WHERE entity_id=':id' AND ((:period <= min_year) OR (min_year IS NULL AND :period <= max_year)) GROUP BY 3,4,5 ORDER BY 1 DESC nulls LAST"],
"parameters": {
"period": {
"כל השנים": "0",
"2008": "2008",
"2009": "2009",
"2010": "2010",
"2011": "2011",
"2012": "2012",
"2013": "2013",
"2014": "2014",
"2015": "2015",
"2016": "2016",
"2017": "2017",
"2018": "2018",
"2019": "2019",
"2020": "2020",
"2021": "2021",
"2022": "2022",
"2023": "2023",
"2024": "2024"
}
},
"defaults": {
"period": "כל השנים"
},
"headers": [
"היחידה הרוכשת",
"אופן הרכישה",
"תקופה",
"מטבע",
"סה״כ היקף:number",
"סה״כ בוצע:number"
]
},
{
"text": " פירוט כל ההתקשרויות עם הארגון ב <period>",
"query": ["SELECT volume AS \"היקף\",",
"executed AS \"ביצוע\",",
"currency AS \"מטבע\", min_year||'-'||max_year AS \"תקופה\", ",
"purpose AS \"תיאור\", ",
"'contract-spending/' || publisher_name || '/' || order_id || '/' || budget_code AS item_id, ",
"purchase_method->>0 AS \"אופן רכישה\",",
"((publisher->>0) || '/' || (purchasing_unit->>0)) AS \"היחידה הרוכשת\",",
"order_date AS \"תאריך הזמנה\",",
"start_date AS \"תאריך התחלה\",",
"end_date AS \"תאריך סיום\",",
"case when manof_excerpts is not null and jsonb_array_length(manof_excerpts) > 0 then ((manof_excerpts->0)::jsonb)->>'soproc_name' else null end as \"שירות חברתי\",",
"case when manof_excerpts is not null and jsonb_array_length(manof_excerpts) > 0 then 'activities/gov_social_service/' || (((manof_excerpts->0)::jsonb)->>'soproc_id')::text else null end as soproc_id",
"FROM contract_spending WHERE entity_id=':id' AND ((:period BETWEEN min_year AND max_year) or (min_year is null and :period <= max_year) or (max_year is null and :period >= min_year) or (:period is null))"],
"parameters": {
"period": {
"כל השנים": "null",
"2014": "2014",
"2015": "2015",
"2016": "2016",
"2017": "2017",
"2018": "2018",
"2019": "2019",
"2020": "2020",
"2021": "2021",
"2022": "2022",
"2023": "2023",
"2024": "2024"
}
},
"defaults": {
"period": "כל השנים"
},
"headers": [
"היחידה הרוכשת",
"תיאור:item_link(item_id)",
"אופן רכישה",
"היקף:number",
"ביצוע:number",
"מטבע",
"תאריך הזמנה",
"תאריך התחלה",
"תאריך סיום",
"תקופה",
"שירות חברתי:item_link(soproc_id)"
]
},
{
"text": "פירוט כל שירותי הרכש החברתי אשר הארגון מפעיל",
"query": [
"WITH s AS (SELECT office, id, name, jsonb_array_elements(suppliers) AS supplier from activities",
"where suppliers IS NOT NULL AND suppliers::text != 'null'",
") SELECT office as \"משרד\", name as \"שם השירות\", supplier->'geo' as \"איזורי הפעלה\",",
"'activities/gov_social_service/' || id as svc_id,",
"'units/gov_social_service_unit/' || office as unit_id",
"from s where supplier->>'entity_id' = ':id'"
],
"parameters": {},
"defaults": {},
"headers": [
"שם השירות:item_link(svc_id)",
"משרד:item_link(unit_id)",
"איזורי הפעלה:comma-separated"
]
}
]