diff --git a/src/libs/routes/infrastructure.js b/src/libs/routes/infrastructure.js index de76386fccdf836f4b0cd942bf5b7b5a4b5843a0..15eabde480a2433ab5b0e8f3b4d6bd9c86e40dfb 100644 --- a/src/libs/routes/infrastructure.js +++ b/src/libs/routes/infrastructure.js @@ -152,17 +152,6 @@ rqf.addField({ foreign: 'regiao_id', foreignTable: 'escola' } -}).addValue({ - name: 'year', - table: 'escola', - tableField: 'ano_censo', - resultField: 'year', - where: { - relation: '=', - type: 'integer', - field: 'ano_censo', - table: 'escola' - } }).addValue({ name: 'location', table: 'escola', @@ -203,7 +192,27 @@ rqf.addField({ type: 'integer', field: 'dependencia_adm_priv' } -}) +}).addValue({ + name: 'min_year', + table: 'escola', + tableField: 'ano_censo', + resultField: 'year', + where: { + relation: '>=', + type: 'integer', + field: 'ano_censo' + } +}).addValue({ + name: 'max_year', + table: 'escola', + tableField: 'ano_censo', + resultField: 'year', + where: { + relation: '<=', + type: 'integer', + field: 'ano_censo' + } +}); function matchQueries(queryTotal, queryPartial) { let match = [];