Skip to content
Snippets Groups Projects
Commit e2b79a95 authored by es23's avatar es23 :coffee:
Browse files

region state city agg

parent cae2bd90
No related branches found
No related tags found
1 merge request!492Indicador Número de Matrículas do Ensino Superior (novo)
......@@ -65,7 +65,32 @@ superiorEnrollmentAggregateApp.get('/qtd_graduates', (req, res, next) => {
.where('curso_superior_agregado.ano_censo >= 2020')
next();
})
}, query, response('qtd_graduates'));
superiorEnrollmentAggregateApp.get('/ies_name', (req, res, next) => {
req.sql.from('curso_superior_agregado')
.field('DISTINCT curso_superior_agregado.cod_ies', 'ies_cod')
.field('curso_superior_agregado.nome_ies', 'ies_name')
.where('curso_superior_agregado.ano_censo >= 2020')
next();
}, query, response('ies_name'));
superiorEnrollmentAggregateApp.get('/uf_agg', (req, res, next) => {
req.sql.from('curso_superior_agregado')
.field('DISTINCT curso_superior_agregado.cod_uf', 'uf_cod')
.field('curso_superior_agregado.nome_uf', 'uf_name')
.where('curso_superior_agregado.ano_censo >= 2020')
next();
}, query, response('uf_agg'));
superiorEnrollmentAggregateApp.get('/city_agg', (req, res, next) => {
req.sql.from('curso_superior_agregado')
.field('DISTINCT curso_superior_agregado.cod_mun', 'city_cod')
.field('curso_superior_agregado.nome_mun', 'city_name')
.where('curso_superior_agregado.ano_censo >= 2020')
.order('curso_superior_agregado.cod_mun')
next();
}, query, response('city_agg'));
superiorEnrollmentAggregateApp.get('/tp_categ_adm', (req, res, next) => {
req.result = []
......@@ -127,6 +152,58 @@ superiorEnrollmentAggregateApp.get('/cine_detailed', (req, res, next) => {
next();
}, response('cine_detailed'));
superiorEnrollmentAggregateApp.get('/academic_level', (req, res, next) => {
req.result = [];
const defaultCase = null;
for (let i = 0; i <= 3; ++i) {
let obj = {
id: i,
name: id2str.academicLevel(i)
};
if (obj.name !== id2str.academicLevel(defaultCase)){
req.result.push(obj);
}
}
req.result.push({
id: defaultCase,
name: id2str.academicLevel(defaultCase)
});
next();
}, response('academic_level'));
superiorEnrollmentAggregateApp.get('/modality', (req, res, next) => {
req.result = [];
for (let i = 1; i <= 2; ++i) {
req.result.push({
id: i,
name: id2str.modalityShiftSuperior(i)
})
}
next();
}, response('modality'));
superiorEnrollmentAggregateApp.get('/academic_organization', (req, res, next) => {
req.result = [];
for (let i = 1; i <= 5; ++i) {
req.result.push({
id: i,
name: id2str.academicOrganization(i)
})
}
next();
}, response('academic_organization'));
superiorEnrollmentAggregateApp.get('/region_agg', (req, res, next) => {
req.result = [];
for (let i = 1; i <= 5; ++i) {
req.result.push({
id: i,
name: id2str.regionCode(i)
})
}
next();
}, response('region_agg'));
rqf.addField({
name: 'filter',
field: false,
......@@ -281,10 +358,10 @@ rqf.addField({
field: 'cod_uf'
}
}).addValue({
name: 'mun_agg',
name: 'city_agg',
table: 'curso_superior_agregado',
tableField: 'nome_mun',
resultField: 'mun_name',
resultField: 'city_name',
where: {
relation: '=',
type: 'integer',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment