Skip to content
Snippets Groups Projects
Commit 29de6b06 authored by Guiusepe's avatar Guiusepe
Browse files

switched results to numbers

parent e834d9f8
No related branches found
No related tags found
3 merge requests!309Merge new updates into master,!279Homologa,!278Enrollment situation tmp
Pipeline #28120 failed
...@@ -739,15 +739,23 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => { ...@@ -739,15 +739,23 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
universityEnrollmentApp.get('/enter_situation ', rqf.parse(), (req, res, next) => { universityEnrollmentApp.get('/enter_situation ', rqf.parse(), (req, res, next) => {
req.sql.from('localoferta_ens_superior_matricula2') req.sql.from('localoferta_ens_superior_matricula2')
.field('SUM(CASE WHEN cod_aluno_situacao=2 THEN 1 ELSE 0 END)', 'cursando') .field('SUM(CASE WHEN cod_aluno_situacao=2 AND ingressante=1 THEN 1 ELSE 0 END)', 'cursando')
.field('SUM(CASE WHEN cod_aluno_situacao=6 THEN 1 ELSE 0 END)', 'concluinte') .field('SUM(CASE WHEN cod_aluno_situacao=6 AND ingressante=1THEN 1 ELSE 0 END)', 'concluinte')
.field('SUM(CASE WHEN cod_aluno_situacao=4 OR cod_aluno_situacao=5 OR cod_aluno_situacao=7 THEN 1 ELSE 0 END)', 'evadido') .field('SUM(CASE WHEN (cod_aluno_situacao=4 OR cod_aluno_situacao=5 OR cod_aluno_situacao=7) AND ingressante=1 THEN 1 ELSE 0 END)', 'evadido')
.field('SUM(CASE WHEN cod_aluno_situacao=3 THEN 1 ELSE 0 END)', 'trancado') .field('SUM(CASE WHEN cod_aluno_situacao=3 AND ingressante=1 THEN 1 ELSE 0 END)', 'trancado')
.field('COUNT(*)', 'total') .field('COUNT(*)', 'total')
.where('ano_censo=2018') .where('ano_censo=2018')
.where('cod_nivel_academico=1') .where('cod_nivel_academico=1')
.where('cod_grau_academico=2 OR cod_grau_academico=4') .where('cod_grau_academico=2 OR cod_grau_academico=4')
.where('localoferta_cod_uf=41') .where('localoferta_cod_uf=41')
next() next()
}, rqf.build(), query, id2str.transform(), response('universityEnrollment')); }, rqf.build(), query, (req, res, next) => {
for (var res of req.result){
res.cursando = Number(res.cursando);
res.concluinte = Number(res.concluinte);
res.evadido = Number(res.evadido);
}
next();
}, id2str.transform(), response('enterSituation'));
module.exports = universityEnrollmentApp; module.exports = universityEnrollmentApp;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment