server: get lon lat for capital cities

This commit is contained in:
2025-10-21 16:50:57 +09:00
parent 6a5b738f93
commit 13bd605a20

View File

@ -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
}