diff --git a/src/libs/convert/enrolledVacanciesFreshmen.js b/src/libs/convert/enrolledVacanciesFreshmen.js
new file mode 100644
index 0000000000000000000000000000000000000000..890445cd0775c3728cea9192a183cb757bf256f5
--- /dev/null
+++ b/src/libs/convert/enrolledVacanciesFreshmen.js
@@ -0,0 +1,32 @@
+/*
+Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
+Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
+
+This file is part of simcaq-node.
+
+simcaq-node is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+simcaq-node is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with simcaq-node.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+module.exports = function enrolledVacanciesFreshmen(id) {
+  switch (id) {
+      case 1:
+      return 'Ingresso';
+      case 2:
+      return 'Vagas totais';
+      case 3:
+      return 'Inscritos';
+      default:
+      return 'Não definido';
+  }
+};
diff --git a/src/libs/convert/enrollmentSituation.js b/src/libs/convert/enrollmentSituation.js
new file mode 100644
index 0000000000000000000000000000000000000000..9b709ea2b8842e2f259ae518f753405746600910
--- /dev/null
+++ b/src/libs/convert/enrollmentSituation.js
@@ -0,0 +1,33 @@
+/*
+Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
+Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
+
+This file is part of simcaq-node.
+
+simcaq-node is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+simcaq-node is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with simcaq-node.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+module.exports = function enrollmentSituation(id) {
+    switch (id) {
+        case 1:
+        return 'Ingressante';
+        case 2:
+        return 'Cursando';
+        case 3:
+        return 'Concluintes';
+        default:
+        return 'Não definido';
+    }
+};
+  
diff --git a/src/libs/convert/enterSituation.js b/src/libs/convert/enterSituation.js
new file mode 100644
index 0000000000000000000000000000000000000000..1fe551d944e176d99fef590890acc836b05b4e14
--- /dev/null
+++ b/src/libs/convert/enterSituation.js
@@ -0,0 +1,35 @@
+/*
+Copyright (C) 2022 Centro de Computacao Cientifica e Software Livre
+Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
+
+This file is part of simcaq-node.
+
+simcaq-node is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+simcaq-node is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with simcaq-node.  If not, see <https://www.gnu.org/licenses/>.
+*/
+
+module.exports = function enterSituation(id) {
+    switch (id) {
+        case 1:
+        return 'Cursando';
+        case 2:
+        return 'Concluinte';
+        case 3:
+        return 'Evadido';
+        case 4:
+        return 'Trancado';
+        default:
+        return 'Não definido';
+    }
+};
+  
diff --git a/src/libs/middlewares/id2str.js b/src/libs/middlewares/id2str.js
index b86232cac7a547430b6cddd4c588e304194ce5a4..668faa80dd7f0075f64ee85a8ab46334cd56b7e8 100644
--- a/src/libs/middlewares/id2str.js
+++ b/src/libs/middlewares/id2str.js
@@ -89,6 +89,9 @@ const finishUniversity = require(`${libs}/convert/finishUniversity`);
 const initialTraining = require(`${libs}/convert/initialTraining`);
 const posTraining = require(`${libs}/convert/posTraining`);
 const licentiateDegree = require(`${libs}/convert/licentiateDegree`);
+const enrolledVacanciesFreshmen = require(`${libs}/convert/enrolledVacanciesFreshmen`);
+const enterSituation = require(`${libs}/convert/enterSituation`);
+const enrollmentSituation = require(`${libs}/convert/enrollmentSituation`);
 
 const ids = {
     gender_id: gender,
@@ -169,7 +172,10 @@ const ids = {
     finish_id: finishUniversity,
     initial_training_id: initialTraining,
     pos_training_id: posTraining,
-    licentiate_degree_id: licentiateDegree
+    licentiate_degree_id: licentiateDegree,
+    enrolled_vacancies_freshmen: enrolledVacanciesFreshmen,
+    enter_situation: enterSituation,
+    enrollment_situation: enrollmentSituation
 };
 
 function transform(removeId=false) {
@@ -277,5 +283,8 @@ module.exports = {
     finishUniversity,
     initialTraining,
     posTraining,
-    licentiateDegree
+    licentiateDegree,
+    enrolledVacanciesFreshmen,
+    enterSituation,
+    enrollmentSituation
 };
diff --git a/src/libs/middlewares/reqQueryFields.js b/src/libs/middlewares/reqQueryFields.js
index 37a377774080c66de4561efb524a88a6e29f96bb..36c33d3805ad9f6718c13e3b350a052adba61d13 100644
--- a/src/libs/middlewares/reqQueryFields.js
+++ b/src/libs/middlewares/reqQueryFields.js
@@ -11,10 +11,11 @@ const nullFields = [
     "Não classificada"
 ]
 
-function parseWhereValue(type, value) {
+function parseWhereValue(type, value, relation) {
     if(type === 'integer') return parseInt(value, 10);
     if(type === 'double') return parseFloat(value);
-    if(type === 'string') return '%'+value+'%';
+    if(type === 'string' && relation === 'LIKE') return '%'+value+'%';
+    if(type === 'string') return value;
     if(type === 'boolean') {
         if(value === null || typeof value === 'boolean') {
             return value;
@@ -306,14 +307,14 @@ class ReqQueryFields {
                                     let whereString = '(';
                                     for(let i = 0; i < whereValue.length; ++i) {
                                         whereString += whereField;
-                                        whereValues.push(parseWhereValue(value.where.type, whereValue[i]));
+                                        whereValues.push(parseWhereValue(value.where.type, whereValue[i], value.where.relation));
                                         if(i < whereValue.length-1) {
                                             whereString += ' OR ';
                                         }
                                     }
                                     whereString += ')';
                                 } else {
-                                    whereValues.push(parseWhereValue(value.where.type, whereValue));
+                                    whereValues.push(parseWhereValue(value.where.type, whereValue, value.where.relation));
                                 }
                             });
 
@@ -326,7 +327,7 @@ class ReqQueryFields {
                                 let arrayWhereValues = [];
                                 for(let i = 0; i < whereValue.length; ++i) {
                                     let curRelation = value.where.relation;
-                                    let curValue = parseWhereValue(value.where.type, whereValue[i])
+                                    let curValue = parseWhereValue(value.where.type, whereValue[i],value.where.relation)
                                     if (isNull(k, curValue) ) {
                                         curValue = null;
                                         curRelation = "is";
@@ -341,7 +342,7 @@ class ReqQueryFields {
                                 whereString += ')';
                                 sql.where(whereString, ...arrayWhereValues);
                             } else {
-                                let curValue = parseWhereValue(value.where.type, whereValue)
+                                let curValue = parseWhereValue(value.where.type, whereValue, value.where.relation)
                                 let curRelation = value.where.relation;
                                 
                                 if (isNull(k, curValue) ) {
diff --git a/src/libs/routes/api.js b/src/libs/routes/api.js
index 31fc9257c397fabc7d2eacd7a9348ee163b1f982..7fa6818b899bec190e320373e605b81b7aeb76a5 100644
--- a/src/libs/routes/api.js
+++ b/src/libs/routes/api.js
@@ -130,6 +130,8 @@ const universityLocalOffer = require(`${libs}/routes/universityLocalOffer`);
 
 const message = require(`${libs}/routes/message`);
 
+const courseStudents = require(`${libs}/routes/courseStudents`);
+
 api.get('/', (req, res) => {
     res.json({ msg: 'SimCAQ API is running' });
 });
@@ -186,4 +188,6 @@ api.use('/location', location);
 api.use('/disciplines', disciplines);
 api.use('/universityLocalOffer', universityLocalOffer);
 api.use('/message', message);
+api.use('/course_students', courseStudents);
+
 module.exports = api;
diff --git a/src/libs/routes/classroomCount.js b/src/libs/routes/classroomCount.js
index 249538dd3b2b2c9da6b109fbdc3d1df6fed1b00d..601b02346be7cca359cc1195303b90897f5e31f3 100644
--- a/src/libs/routes/classroomCount.js
+++ b/src/libs/routes/classroomCount.js
@@ -548,8 +548,8 @@ classroomCountApp.post('/', rqf.parse(), (req, res, next) => {
                 result.push(obj);
                 currentClassroomObj = obj;
 
-
-                while (req.teacher[ti].city_id !== classroom.city_id) {       // match da tabela de professores.
+                var id_attribute = req.dims.school ? "school_id" : "city_id"
+                while (req.teacher[ti][id_attribute] !== classroom[id_attribute]) {       // match da tabela de professores.
                     ti++;
                 }
 
diff --git a/src/libs/routes/courseStudents.js b/src/libs/routes/courseStudents.js
new file mode 100644
index 0000000000000000000000000000000000000000..cd0aea1b23ab514c752c709e91f8d28fc1bc694b
--- /dev/null
+++ b/src/libs/routes/courseStudents.js
@@ -0,0 +1,204 @@
+const express = require('express');
+
+const courseStudentsApp = express.Router();
+
+const libs = `${process.cwd()}/libs`;
+
+const squel = require('squel');
+
+const query = require(`${libs}/middlewares/query`).query;
+
+const ReqQueryFields = require(`${libs}/middlewares/reqQueryFields`);
+
+const response = require(`${libs}/middlewares/response`);
+
+const id2str = require(`${libs}/middlewares/id2str`);
+
+let rqf = new ReqQueryFields();
+
+courseStudentsApp.get('/enrolled_vacancies_freshmen', (req, res, next) => {
+    req.result = [];
+    for(let i = 1; i <= 3; ++i) {
+        req.result.push({
+            id: i,
+            name: id2str.enrolledVacanciesFreshmen(i)
+        });
+    };
+    next();
+}, response('enrolled_vacancies_freshmen'));
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+})
+.addValueToField({
+    name: 'state',
+    table: 'ies_ens_superior',
+    tableField: 'cod_uf_ies',
+    resultField: 'state_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'cod_uf_ies',
+	    table: 'ies_ens_superior'
+    }
+}, 'filter')
+.addValueToField({
+    name: 'min_year',
+    table: 'curso_ens_superior',
+    tableField: 'ano_censo',
+    resultField: 'year',
+    where: {
+        relation: '>=',
+        type: 'integer',
+        field: 'ano_censo',
+        table: 'curso_ens_superior'
+    }
+}, 'filter')
+.addValueToField({
+    name: 'max_year',
+    table: 'curso_ens_superior',
+    tableField: 'ano_censo',
+    resultField: 'year',
+    where: {
+        relation: '<=',
+        type: 'integer',
+        field: 'ano_censo',
+        table: 'ies_ens_superior'
+    }
+}, 'filter')
+.addValue({
+    name: 'upper_adm_dependency',
+    table: 'curso_ens_superior',
+    tableField: 'par_categoria_administrativa',
+    resultField: 'upper_adm_dependency_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'par_categoria_administrativa', //cod_categoria_administrativa
+        table: 'curso_ens_superior'
+    }
+})
+.addValue({
+    name: 'course',
+    table: 'curso_ens_superior',
+    tableField: 'nome_curso',
+    resultField: 'course_name',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_curso',
+        table: 'curso_ens_superior'
+    }
+})
+.addValue({
+    name: 'upper_education_mod',
+    table: 'curso_ens_superior',
+    tableField: 'cod_modalidade_ensino',
+    resultField: 'upper_education_mod_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'cod_modalidade_ensino',
+        table: 'curso_ens_superior'
+    }
+})
+.addValue({
+    name: 'academic_organization',
+    table: 'curso_ens_superior',
+    tableField: 'cod_organizacao_academica',
+    resultField: 'academic_organization_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'cod_organizacao_academica',
+        table: 'curso_ens_superior'
+    }
+})
+.addValue({
+    name: 'mesoregion',
+    table: 'municipio',
+    tableField: ['nome_mesorregiao', 'mesorregiao_id'],
+    resultField: ['mesoregion_name', 'mesoregion_id'],
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'mesorregiao_id',
+        table: 'municipio'
+    },
+    join: {
+        primary: 'id',
+        foreign: 'cod_municipio_ies',
+        foreignTable: 'ies_ens_superior'
+    }
+})
+.addValue({
+    name: 'microregion',
+    table: 'municipio',
+    tableField: ['nome_microrregiao', 'microrregiao_id'],
+    resultField: ['microregion_name', 'microregion_id'],
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'microrregiao_id',
+        table: 'municipio'
+    },
+    join: {
+        primary: 'id',
+        foreign: 'cod_municipio_ies',
+        foreignTable: 'ies_ens_superior'
+    }
+})
+.addValue({
+    name: 'city',
+    table: 'municipio',
+    tableField: ['id', 'nome'],
+    resultField: ['city_id', 'city_name'],
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'id',
+        table: 'municipio'
+    },
+    join: {
+        primary: 'id',
+        foreign: 'cod_municipio_ies',
+        foreignTable: 'ies_ens_superior'
+    }
+})
+
+
+
+courseStudentsApp.get('/', rqf.parse(), (req, res, next) => {
+    req.sql.field("curso_ens_superior.ano_censo", "year")
+    .field("SUM(curso_ens_superior.quantidade_inscritos_total)", "inscritos_total")
+    .field("SUM(curso_ens_superior.quantidade_vagas_totais)", "vagas_totais")
+    .field("SUM(curso_ens_superior.quantidade_ingresso_curso)", "ingresso_curso")
+    .from("curso_ens_superior")
+    .join("ies_ens_superior ON curso_ens_superior.ano_censo = ies_ens_superior.ano_censo AND curso_ens_superior.cod_ies = ies_ens_superior.cod_ies")
+    .where("curso_ens_superior.cod_nivel_academico = 1")
+    .where("curso_ens_superior.cod_grau_academico = 2 OR curso_ens_superior.cod_grau_academico = 4")
+    .group("curso_ens_superior.ano_censo")
+    .order("curso_ens_superior.ano_censo")
+    next();
+
+}, rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString()); 
+    next();
+}, query, (req, res, next) => {
+    for (var res of req.result){
+        res.inscritos_total = Number(res.inscritos_total);
+        res.vagas_totais = Number(res.vagas_totais);
+        res.ingresso_curso = Number(res.ingresso_curso);
+        res.total = null;
+    }
+
+    next();
+}, id2str.transform(), response('course_students'))
+
+module.exports = courseStudentsApp;
diff --git a/src/libs/routes/disciplines.js b/src/libs/routes/disciplines.js
index d43d8d319c5539afd635879e3604deced5bbe112..23bdcfa366fec499bf79b6f149a24ff28c5b5cc8 100644
--- a/src/libs/routes/disciplines.js
+++ b/src/libs/routes/disciplines.js
@@ -628,7 +628,7 @@ disciplinesApp.get('/', rqf.parse(), (req, res, next) => {
 	// else {
 		let disciplinesNotSuitable = [];
 		let disciplinesSuitable = [];
-
+        console.log(req.result);
 		req.result.forEach((r) => {
 			let objNotSuitable = {
 				total: parseInt(r.total) - parseInt(r.total_suitable),
diff --git a/src/libs/routes/enrollment.js b/src/libs/routes/enrollment.js
index b3310b30cbcdc0c9f4316dd1de1179936ba4bfa3..c3a1e68d3d2ab0aae30bd37a120ec489d1d09439 100644
--- a/src/libs/routes/enrollment.js
+++ b/src/libs/routes/enrollment.js
@@ -588,6 +588,16 @@ rqf.addField({
       type: 'boolean',
       field: 'exclusiva_especial'
   }
+}).addValue({
+    name: 'period_not',
+    table: 'matricula',
+    tableField: 'turma_turno_id',
+    resultField: 'period_id',
+    where: {
+        relation: '<>',
+        type: 'integer',
+        field: 'turma_turno_id'
+    }
 });
 
 enrollmentApp.get('/', rqf.parse(), (req, res, next) => {
diff --git a/src/libs/routes/universityEnrollment.js b/src/libs/routes/universityEnrollment.js
index f12626f3ac3d072467128102435133628f3a7e58..6d1a08f197e8b140084fafe90f38f8756c8595c2 100644
--- a/src/libs/routes/universityEnrollment.js
+++ b/src/libs/routes/universityEnrollment.js
@@ -286,6 +286,30 @@ universityEnrollmentApp.get('/age_student_code', function (req, res, next) {
     next();
 }, response('age_student_code'));
 
+
+universityEnrollmentApp.get('/enter_situation/student_enter_situation', function (req, res, next) {
+    req.result = [];
+    for (var i = 1; i <= 4; ++i) {
+        req.result.push({
+            id: i,
+            name: id2str.enterSituation(i)
+        });
+    };
+    next();
+}, response('student_enter_situation'));
+
+
+universityEnrollmentApp.get('/enter_situation/student_enrollment_situation', function (req, res, next) {
+    req.result = [];
+    for (var i = 1; i <= 3; ++i) {
+        req.result.push({
+            id: i,
+            name: id2str.enrollmentSituation(i)
+        });
+    };
+    next();
+}, response('student_enrollment_situation'));
+
 universityEnrollmentApp.get('/university', (req, res, next) => {
     req.sql.from('aluno_ens_superior')
     .field('DISTINCT aluno_ens_superior.nome_ies', 'nome')
@@ -685,6 +709,8 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
                 .field('curso_ens_superior.ano_censo', 'year')
                 .field('COUNT(localoferta_ens_superior.cod_local_oferta)', 'total')
                 .group('localoferta_ens_superior_matricula.ano_censo')
+                .where('localoferta_ens_superior_matricula.cod_aluno_situacao = 2 OR localoferta_ens_superior_matricula.cod_aluno_situacao = 6 OR localoferta_ens_superior_matricula.matriculado = 1')
+                .where('localoferta_ens_superior_matricula.cod_nivel_academico = 1')
                 .order('localoferta_ens_superior_matricula.ano_censo')
                 .order('localoferta_ens_superior.cod_local_oferta');
         } else {
@@ -696,6 +722,8 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
                 .group('localoferta_ens_superior_matricula.ano_censo')
                 .group('localoferta_ens_superior_matricula.cod_ies')
                 .group('localoferta_ens_superior_matricula.nome_ies')
+                .where('localoferta_ens_superior_matricula.cod_aluno_situacao = 2 OR localoferta_ens_superior_matricula.cod_aluno_situacao = 6 OR localoferta_ens_superior_matricula.matriculado = 1')
+                .where('localoferta_ens_superior_matricula.cod_nivel_academico = 1')
                 .order('localoferta_ens_superior_matricula.ano_censo')
                 .order('localoferta_ens_superior_matricula.cod_local_oferta');
         }
@@ -705,6 +733,8 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
         .field('DISTINCT COUNT(*)', 'total')
         .field("'Brasil'", 'name')
         .field('localoferta_ens_superior_matricula.ano_censo', 'year')
+        .where('localoferta_ens_superior_matricula.cod_aluno_situacao = 2 OR localoferta_ens_superior_matricula.cod_aluno_situacao = 6 OR localoferta_ens_superior_matricula.matriculado = 1')
+        .where('localoferta_ens_superior_matricula.cod_nivel_academico = 1')
         .group('localoferta_ens_superior_matricula.ano_censo')
         .order('localoferta_ens_superior_matricula.ano_censo')
     } else if ("university" in req.dims || "universityLocalOffer" in req.dims) {
@@ -723,6 +753,8 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
         .field('COUNT(*)', 'total')
         .field("'Brasil'", 'name')
         .field('localoferta_ens_superior_matricula.ano_censo', 'year')
+        .where('localoferta_ens_superior_matricula.cod_aluno_situacao = 2 OR localoferta_ens_superior_matricula.cod_aluno_situacao = 6 OR localoferta_ens_superior_matricula.matriculado = 1')
+        .where('localoferta_ens_superior_matricula.cod_nivel_academico = 1')
         .group('localoferta_ens_superior_matricula.ano_censo')
         .order('localoferta_ens_superior_matricula.ano_censo')
     }
@@ -734,7 +766,57 @@ universityEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
             course.percentage = Number((( course.total / total_course ) * 100).toFixed(2))
         }
     }
-    next()
+    next();
 }, response('universityEnrollment'));
 
-module.exports = universityEnrollmentApp;
+universityEnrollmentApp.get('/enter_situation', rqf.parse(), (req, res, next) => {
+    req.sql.from('localoferta_ens_superior_matricula')
+    .field('SUM(CASE WHEN localoferta_ens_superior_matricula.cod_aluno_situacao=2 AND localoferta_ens_superior_matricula.ingressante=1 THEN 1 ELSE 0 END)', 'cursando')
+    .field('SUM(CASE WHEN localoferta_ens_superior_matricula.cod_aluno_situacao=6 AND localoferta_ens_superior_matricula.ingressante=1 THEN 1 ELSE 0 END)', 'concluinte')
+    .field('SUM(CASE WHEN (localoferta_ens_superior_matricula.cod_aluno_situacao=4 OR localoferta_ens_superior_matricula.cod_aluno_situacao=5 OR localoferta_ens_superior_matricula.cod_aluno_situacao=7) AND localoferta_ens_superior_matricula.ingressante=1 THEN 1 ELSE 0 END)', 'evadido')
+    .field('SUM(CASE WHEN localoferta_ens_superior_matricula.cod_aluno_situacao=3 AND localoferta_ens_superior_matricula.ingressante=1 THEN 1 ELSE 0 END)', 'trancado')
+    .field('COUNT(*)', 'total')
+    .field("'Brasil'", 'name')
+    .field('localoferta_ens_superior_matricula.ano_censo', 'year')
+    .where('localoferta_ens_superior_matricula.cod_nivel_academico=1')
+    .where('localoferta_ens_superior_matricula.cod_grau_academico=2 OR localoferta_ens_superior_matricula.cod_grau_academico=4')
+    .group('localoferta_ens_superior_matricula.ano_censo')
+    .order('localoferta_ens_superior_matricula.ano_censo')
+    next()
+}, rqf.build(), (req, res, next) => {console.log(req.sql.toString()); next()}, 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);
+        res.trancado = Number(res.trancado);
+        res.total = res.cursando + res.concluinte + res.evadido + res.trancado
+        res.taxa_evasao = Number( ((res.evadido/res.total) * 100).toFixed(2) )
+    }
+    next();
+}, id2str.transform(), response('enterSituation'));
+
+universityEnrollmentApp.get('/enrollment_situation', rqf.parse(), (req, res, next) => {
+    req.sql.from('localoferta_ens_superior_matricula')
+    .field('SUM(CASE WHEN localoferta_ens_superior_matricula.cod_aluno_situacao=2 AND localoferta_ens_superior_matricula.ingressante=1 THEN 1 ELSE 0 END)', 'ingressante')
+    .field('SUM(CASE WHEN localoferta_ens_superior_matricula.cod_aluno_situacao=2 AND localoferta_ens_superior_matricula.ingressante=0 AND localoferta_ens_superior_matricula.concluinte=0 THEN 1 ELSE 0 END)', 'cursando')
+    .field('SUM(localoferta_ens_superior_matricula.concluinte)', 'concluintes')
+    .field('SUM(CASE WHEN (localoferta_ens_superior_matricula.concluinte=1) OR (localoferta_ens_superior_matricula.cod_aluno_situacao = 2 and localoferta_ens_superior_matricula.ingressante = 0) OR (localoferta_ens_superior_matricula.cod_aluno_situacao = 2 and localoferta_ens_superior_matricula.ingressante = 1) THEN 1 ELSE 0 END)', 'total')
+    .field('localoferta_ens_superior_matricula.ano_censo', 'year')
+    .field("'Brasil'", 'name')
+    .where('localoferta_ens_superior_matricula.cod_nivel_academico=1')
+    .where('localoferta_ens_superior_matricula.cod_grau_academico=2 OR localoferta_ens_superior_matricula.cod_grau_academico=4')
+    .group('localoferta_ens_superior_matricula.ano_censo')
+    .order('localoferta_ens_superior_matricula.ano_censo')
+    next()
+}, rqf.build(), (req, res, next) => {console.log(req.sql.toString()); next()}, query, (req, res, next) => {
+    for (var res of req.result){
+        res.ingressante = Number(res.ingressante);
+        res.cursando = Number(res.cursando);
+        res.concluintes = Number(res.concluintes);
+        res.total = Number(res.total);
+    }
+    next();
+}, id2str.transform(), response('enrollmentSituation'));
+
+
+module.exports = universityEnrollmentApp;
\ No newline at end of file