server: get lon lat for capital cities
This commit is contained in:
@ -16,7 +16,13 @@ export class GeneralService {
|
||||
const generalDatabase = '_isGeneral'
|
||||
|
||||
const result = await this.generalDataSource.query(`
|
||||
SELECT * FROM ${generalDatabase}..vRegions;
|
||||
SELECT
|
||||
r.*,
|
||||
CASE WHEN r.capital IS NOT NULL THEN c.longitude END AS capital_longitude,
|
||||
CASE WHEN r.capital IS NOT NULL THEN c.width END AS capital_latitude
|
||||
FROM ${generalDatabase}..vRegions AS r
|
||||
LEFT JOIN ${generalDatabase}..vCities AS c
|
||||
ON r.capital = c.id;
|
||||
`)
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user