diff --git a/src/libs/routes_v1/uniLocalOfferAggregate.js b/src/libs/routes_v1/uniLocalOfferAggregate.js index ab50ef375a07d81922aa4f8aa65a7e94581d41ba..f50afff10d25cb8e73f9399dfef810795ad01bc1 100644 --- a/src/libs/routes_v1/uniLocalOfferAggregate.js +++ b/src/libs/routes_v1/uniLocalOfferAggregate.js @@ -46,6 +46,36 @@ rqf.addField({ name: 'dims', field: true, where: false +}).addValue({ + name: 'min_year', + table: 'curso_superior_agregado', + tableField: 'ano_censo', + resultField: 'year', + where: { + relation: '>=', + type: 'integer', + field: 'ano_censo' + } +}).addValue({ + name: 'max_year', + table: 'curso_superior_agregado', + tableField: '', + resultField: 'year', + where: { + relation: '<=', + type: 'integer', + field: 'ano_censo' + } +}).addValue({ + name: 'region', + table: 'curso_superior_agregado', + tableField: 'cod_reg', + resultField: 'region_id', + where: { + relation: '=', + type: 'integer', + field: 'cod_reg' + } }).addValue({ name: 'state', table: 'estado', @@ -83,6 +113,9 @@ uniLocalOfferAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => req.sql.from('curso_superior_agregado') .field('DISTINCT curso_superior_agregado.cod_ies', 'id') .field('ies_ens_superior.nome_ies', 'name') + .field('curso_superior_agregado.cod_mun', 'city_id') + .field('curso_superior_agregado.cod_uf', 'state_id') + .field('curso_superior_agregado.cod_reg', 'region_id') .join('ies_ens_superior', null, 'curso_superior_agregado.cod_ies = ies_ens_superior.cod_ies and curso_superior_agregado.ano_censo = ies_ens_superior.ano_censo') .order('curso_superior_agregado.cod_ies') next();