-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: AB#6356 update based on review. Change snake to camelcase
- Loading branch information
Showing
15 changed files
with
101 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 19 additions & 16 deletions
35
services/API-service/src/api/data/sql/get-country-event.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,40 @@ | ||
|
||
|
||
|
||
select | ||
to_char(max(end_date) , 'yyyy-mm-dd') as end_date, | ||
to_char(min(start_date), 'yyyy-mm-dd') as start_date, | ||
max(country_code) as country_code, | ||
max(active_trigger::int)::boolean as active_trigger | ||
to_char(max("endDate") , 'yyyy-mm-dd') as "endDate", | ||
to_char(min("startDate"), 'yyyy-mm-dd') as "startDate", | ||
max(country_code) as "countryCode", | ||
max("activeTrigger"::int)::boolean as "activeTrigger" | ||
from | ||
( | ||
select | ||
e.pcode, | ||
e."placeCode" , | ||
coalesce(a2.country_code , a1.country_code) as country_code, | ||
coalesce(a2.population_affected, a1.population_affected) as population_affected, | ||
e.end_date, | ||
e.start_date, | ||
e.active_trigger | ||
e."endDate", | ||
e."startDate", | ||
e."activeTrigger" | ||
from | ||
"IBF-pipeline-output".event_pcode e | ||
"IBF-pipeline-output".event_place_code e | ||
left join "IBF-API"."Admin_area_data2" a2 on | ||
a2.pcode = e.pcode | ||
a2.pcode = e."placeCode" | ||
and a2.current_prev = 'Current' | ||
and a2.country_code is not null | ||
left join "IBF-API"."Admin_area_data1" a1 on | ||
a1.pcode = e.pcode | ||
a1.pcode = e."placeCode" | ||
and a1.current_prev = 'Current' | ||
and a1.country_code is not null | ||
where | ||
closed = false | ||
group by | ||
e.pcode, | ||
e."placeCode", | ||
a2.population_affected, | ||
a1.population_affected, | ||
a2.country_code, | ||
a1.country_code, | ||
e.end_date, | ||
e.start_date, | ||
e."active_trigger" | ||
e."endDate", | ||
e."startDate", | ||
e."activeTrigger" | ||
order by | ||
population_affected desc ) as event_pcode_country where country_code = $1 | ||
population_affected desc ) as event_place_code_country where country_code = $1 |
17 changes: 9 additions & 8 deletions
17
services/API-service/src/api/data/sql/get-triggered-areas.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,35 @@ | ||
select | ||
|
||
select | ||
* | ||
from | ||
( | ||
select | ||
e.pcode, | ||
e."placeCode", | ||
coalesce(a2.name, a1.name) as name, | ||
coalesce(a2.population_affected, a1.population_affected) as population_affected, | ||
coalesce(a2.population_affected, a1.population_affected) as "populationAffected", | ||
e.id | ||
from | ||
"IBF-pipeline-output".event_pcode e | ||
"IBF-pipeline-output".event_place_code e | ||
left join "IBF-API"."Admin_area_data2" a2 on | ||
a2.pcode = e.pcode | ||
a2.pcode = e."placeCode" | ||
and a2.country_code = $1 | ||
and a2.name is not null | ||
and a2.current_prev = 'Current' | ||
left join "IBF-API"."Admin_area_data1" a1 on | ||
a1.pcode = e.pcode | ||
a1.pcode = e."placeCode" | ||
and a1.current_prev = 'Current' | ||
and a1.name is not null | ||
and a1.country_code = $2 | ||
where | ||
closed = false | ||
group by | ||
e.pcode, | ||
e."placeCode", | ||
a2.population_affected, | ||
a1.population_affected, | ||
a2.name, | ||
a1.name, | ||
e.id | ||
order by | ||
population_affected desc ) as ec | ||
"populationAffected" desc ) as ec | ||
where | ||
name is not null |
14 changes: 7 additions & 7 deletions
14
services/API-service/src/api/event/event-place-code.entity.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.