Skip to content
Snippets Groups Projects
Commit e450bde4 authored by Fernando Gbur dos Santos's avatar Fernando Gbur dos Santos
Browse files

[ADD] Adding new filters and new fields to query

parent bf7a6dac
No related branches found
No related tags found
3 merge requests!434Homologa,!429Dev -> Hom,!427Course aggregate fix
...@@ -46,6 +46,36 @@ rqf.addField({ ...@@ -46,6 +46,36 @@ rqf.addField({
name: 'dims', name: 'dims',
field: true, field: true,
where: false 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({ }).addValue({
name: 'state', name: 'state',
table: 'estado', table: 'estado',
...@@ -83,6 +113,9 @@ uniLocalOfferAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => ...@@ -83,6 +113,9 @@ uniLocalOfferAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, next) =>
req.sql.from('curso_superior_agregado') req.sql.from('curso_superior_agregado')
.field('DISTINCT curso_superior_agregado.cod_ies', 'id') .field('DISTINCT curso_superior_agregado.cod_ies', 'id')
.field('ies_ens_superior.nome_ies', 'name') .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') .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') .order('curso_superior_agregado.cod_ies')
next(); next();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment