diff --git a/src/libs/routes/transport.js b/src/libs/routes/transport.js index 7adfc80efb56dc84a8554c36b4e8aaaeedbbf4b5..6a322d343f3b7117c350a9a3d6f3ed42de9da95b 100644 --- a/src/libs/routes/transport.js +++ b/src/libs/routes/transport.js @@ -119,6 +119,36 @@ rqf.addField({ name: 'dims', field: true, where: false +}).addValue({ + name: 'school', + table: 'escola', + tableField: ['nome_escola', 'id'], + resultField: ['school_name', 'school_id'], + where: { + relation: '=', + type: 'integer', + field: 'id' + }, + join: { + primary: ['id', 'ano_censo'], + foreign: ['escola_id', 'ano_censo'], + foreignTable: 'matricula' + } +}).addValue({ + name: 'region', + table: 'regiao', + tableField: 'nome', + resultField: 'region_name', + where: { + relation: '=', + type: 'integer', + field: 'id' + }, + join: { + primary: 'id', + foreign: 'regiao_id', + foreignTable: 'matricula' + } }).addValue({ name: 'city', table: 'municipio',