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..6a1c2c330316d461443966bc447385aebdbf545a 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('/courseStudents', courseStudents);
+
 module.exports = api;
diff --git a/src/libs/routes/courseStudents.js b/src/libs/routes/courseStudents.js
new file mode 100644
index 0000000000000000000000000000000000000000..82ca6ca771d8bf5d5dbe12cb99600e76b131cab7
--- /dev/null
+++ b/src/libs/routes/courseStudents.js
@@ -0,0 +1,192 @@
+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();
+
+rqf.addField({
+    name: 'filter',
+    field: false,
+    where: true
+}).addField({
+    name: 'dims',
+    field: true,
+    where: false
+}).addValueToField({
+    name: 'state',
+    table: 'localoferta_ens_superior2',
+    tableField: 'cod_uf',
+    resultField: 'state_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'cod_uf',
+	    table: 'localoferta_ens_superior2'
+    }
+}, 'filter').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',
+        foreignTable: 'localoferta_ens_superior2'
+    }
+}).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',
+        foreignTable: 'localoferta_ens_superior2'
+    }
+}).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',
+        foreignTable: 'localoferta_ens_superior2'
+    }
+}).addValue({
+    name: 'min_year',
+    table: 'localoferta_ens_superior2',
+    tableField: 'ano_censo',
+    resultField: 'year',
+    where: {
+        relation: '>=',
+        type: 'integer',
+        table: 'localoferta_ens_superior2',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name: 'max_year',
+    table: 'localoferta_ens_superior2',
+    tableField: 'ano_censo',
+    resultField: 'year',
+    where: {
+        relation: '<=',
+        type: 'integer',
+        table: 'localoferta_ens_superior2',
+        field: 'ano_censo'
+    }
+}).addValue({
+    name:'course',
+    table: 'curso_ens_superior',
+    tableField: 'nome_curso',
+    resultField: 'course_name',
+    where: {
+        relation: '=',
+        type: 'string',
+        field: 'nome_curso'
+    }
+}).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'
+    }
+}).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'
+    }
+}).addValue({
+    name:'academic_organization',
+    table: 'curso_ens_superior',
+    tableField: 'cod_organizacao_academica',
+    resultField: 'academic_organization_id',
+    where: {
+        relation: '=',
+        type: 'integer',
+        field: 'cod_organizacao_academica'
+    }
+}).addValueToField({
+    name: 'campi',
+    table: 'localoferta_ens_superior',
+    tableField: ['cod_local_oferta', 'nome'],
+    resultField: ['campi_id', 'campi_name'],
+    where: {
+	    relation: '=',
+	    type: 'integer',
+	    field: 'cod_local_oferta',
+	    table: 'localoferta_ens_superior'
+    }
+}, 'filter')
+
+courseStudentsApp.get('/', rqf.parse(), (req, res, next) => {
+    var b = squel.select().from(
+            squel.select().from('localoferta_ens_superior')
+            .field("localoferta_ens_superior.cod_curso", "cod_curso")
+            .field("localoferta_ens_superior.ano_censo", "ano_censo")
+            .field("ies_ens_superior.cod_municipio_ies", "cod_municipio")
+            .field("ies_ens_superior.cod_uf_ies", "cod_uf")
+            .join("ies_ens_superior on ies_ens_superior.cod_ies = localoferta_ens_superior.cod_ies AND ies_ens_superior.ano_censo=localoferta_ens_superior.ano_censo")
+            .group("localoferta_ens_superior.cod_curso" )    
+            .group("localoferta_ens_superior.ano_censo" )
+            .group("ies_ens_superior.cod_uf_ies")
+            .group("ies_ens_superior.cod_municipio_ies")
+        , "localoferta_ens_superior2")
+        .field("localoferta_ens_superior2.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")
+        .join("curso_ens_superior ON (localoferta_ens_superior2.cod_curso = curso_ens_superior.cod_curso) AND (localoferta_ens_superior2.ano_censo = curso_ens_superior.ano_censo)")
+        .where("curso_ens_superior.cod_nivel_academico = 1")
+        .where("(curso_ens_superior.tipo_atributo_ingresso <> 1 OR curso_ens_superior.tipo_atributo_ingresso is NULL)")
+        .where("(curso_ens_superior.cod_grau_academico = 2 OR curso_ens_superior.cod_grau_academico = 4) ")   
+        .group("localoferta_ens_superior2.ano_censo")
+        .order("localoferta_ens_superior2.ano_censo")
+
+    req.sql = b;
+    next();
+}, rqf.build(), (req, res, next) => {
+    console.log(req.sql.toString()); 
+    next();
+}, query, id2str.transform(), response('course_students'))
+
+module.exports = courseStudentsApp;