Skip to content
Snippets Groups Projects
Commit 3e04cddc authored by Fernando Erd's avatar Fernando Erd
Browse files

Fix conflicts

parents 5221bcaa e1ba546f
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## 1.1.0
## 1.1.0 - 2018-05-02
### Added
- Out of school population indicator
- Liquid enrollment ratio indicator
......
......@@ -303,15 +303,15 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => {
function ConvertMatricula(result) {
if (result == 1) {
return 'matricula.faixa_etaria_31_03 = 1'
return '(matricula.faixa_etaria_31_03 = 1 AND matricula.etapas_mod_ensino_segmento_id = 1)'
} else if (result == 2) {
return 'matricula.faixa_etaria_31_03 = 2'
return '(matricula.faixa_etaria_31_03 = 2 AND matricula.etapas_mod_ensino_segmento_id = 2)'
} else if (result == 4) {
return 'matricula.faixa_etaria_31_03 = 3'
return '(matricula.faixa_etaria_31_03 = 3 AND matricula.etapas_mod_ensino_segmento_id = 4)'
} else if (result == 5) {
return 'matricula.faixa_etaria_31_03 = 4'
return '(matricula.faixa_etaria_31_03 = 4 AND matricula.etapas_mod_ensino_segmento_id = 5)'
} else if (result == 6) {
return 'matricula.faixa_etaria_31_03 = 5'
return '(matricula.faixa_etaria_31_03 = 5 AND matricula.etapas_mod_ensino_segmento_id = 6)'
}
}
if ("education_level_basic" in req.filter) {
......@@ -319,9 +319,13 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => {
var string_query_enrollment = '';
for(let i = 0; i < req.filter.education_level_basic.length - 1; i++) {
string_query_enrollment = string_query_enrollment + ConvertMatricula(req.filter.education_level_basic[i]) + ' OR ';
}
string_query_enrollment = string_query_enrollment + ConvertMatricula(req.filter.education_level_basic[req.filter.education_level_basic.length - 1]);
req.sql.where(string_query_enrollment);
}
string_query_enrollment = string_query_enrollment + ConvertMatricula(req.filter.education_level_basic[req.filter.education_level_basic.length - 1]);
delete req.filter.education_level_basic;
req.sql.where(string_query_enrollment);
req.sql.field('matricula.faixa_etaria_31_03', 'age_range')
req.sql.group('matricula.faixa_etaria_31_03', 'age_range');
}
} else if ( "education_level_basic" in req.dims ) {
req.sql.field('matricula.faixa_etaria_31_03', 'age_range')
......@@ -369,6 +373,8 @@ liquidEnrollmentRatioApp.get('/', rqf.parse(),(req, res, next) => {
string_query = string_query + convertPnad(req.filter.education_level_basic[req.filter.education_level_basic.length - 1]);
req.sql.where(string_query);
}
req.sql.field('pnad.faixa_etaria_31_03', 'age_range')
req.sql.group('pnad.faixa_etaria_31_03', 'age_range');
} else if ( "education_level_basic" in req.dims ) {
req.sql.field('pnad.faixa_etaria_31_03','age_range')
req.sql.where('pnad.faixa_etaria_31_03 = 1 OR pnad.faixa_etaria_31_03 = 2 OR pnad.faixa_etaria_31_03 = 3 OR pnad.faixa_etaria_31_03 = 4 OR pnad.faixa_etaria_31_03 = 5')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment