Add regioncode to FIAS result set
This commit is contained in:
parent
c99db3ceea
commit
9d3590e5a4
@ -13,7 +13,7 @@ db_shemas = dict()
|
||||
db_shemas['ADDROBJ'] = \
|
||||
DbSchema("ADDROBJ",
|
||||
["AOID", "AOGUID", "SHORTNAME", "FORMALNAME", "AOLEVEL", "PARENTGUID", "ACTSTATUS", "LIVESTATUS",
|
||||
"NEXTID"],
|
||||
"NEXTID", "REGIONCODE"],
|
||||
"aoid",
|
||||
"Object")
|
||||
|
||||
|
@ -10,6 +10,7 @@ CREATE TABLE "ADDROBJ" (
|
||||
"actstatus" BOOL,
|
||||
"livestatus" BOOL,
|
||||
"nextid" UUID,
|
||||
"regioncode" int2,
|
||||
CONSTRAINT "aoid" UNIQUE ("aoid"),
|
||||
CONSTRAINT "id_addrobj" PRIMARY KEY ("id")
|
||||
)
|
||||
|
@ -6,4 +6,4 @@ WITH RECURSIVE child_to_parents AS (
|
||||
WHERE "ADDROBJ".aoguid = child_to_parents.parentguid
|
||||
AND "ADDROBJ".actstatus = True AND "ADDROBJ".livestatus = True AND "ADDROBJ".nextid IS NULL
|
||||
)
|
||||
SELECT DISTINCT ON (scname) cs.aoid, cs.aoguid, cs.shortname, cs.formalname, cs.aolevel, s.socrname FROM child_to_parents cs LEFT JOIN "SOCRBASE" s ON s.scname=cs.shortname ORDER BY scname, aolevel;
|
||||
SELECT DISTINCT ON (scname) cs.aoid, cs.aoguid, cs.shortname, cs.formalname, cs.aolevel, cs.regioncode, s.socrname FROM child_to_parents cs LEFT JOIN "SOCRBASE" s ON s.scname=cs.shortname ORDER BY scname, aolevel;
|
||||
|
Loading…
x
Reference in New Issue
Block a user