diff --git a/src/libs/routes_v2/simcaqEnrollmentDiagnosis.js b/src/libs/routes_v2/simcaqEnrollmentDiagnosis.js index bd23cf2538f67893aa5faed62a00903655cec796..7c13d9b48c3d6396d5e4ae1962431966102c6b53 100644 --- a/src/libs/routes_v2/simcaqEnrollmentDiagnosis.js +++ b/src/libs/routes_v2/simcaqEnrollmentDiagnosis.js @@ -83,7 +83,7 @@ rqf.addField({ field: 'escola_id' } }).addValue({ - name: 'stage', + name: 'education_level_short_id', table: 'simcaq_diagnostico_de_matricula', tableField: 'etapa', where: { @@ -113,7 +113,7 @@ rqf.addField({ simcaqEnrollmentDiagnosisApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { req.sql.from('simcaq_diagnostico_de_matricula') - .field('simcaq_diagnostico_de_matricula.etapa', 'stage') + .field('simcaq_diagnostico_de_matricula.etapa', 'education_level_short_id') .field('SUM(simcaq_diagnostico_de_matricula.total)', 'total') .field('SUM(simcaq_diagnostico_de_matricula.matriculas_federal)', 'federal_enrollments') .field('SUM(simcaq_diagnostico_de_matricula.matriculas_estadual)', 'state_enrollments') @@ -124,6 +124,8 @@ simcaqEnrollmentDiagnosisApp.get('/', rqf.parse(), rqf.build(), (req, res, next) .field('SUM(simcaq_diagnostico_de_matricula.matriculas_priv_nao_conv_com_fin)', 'private_not_affiliated_for_profit_enrollments') .field('SUM(simcaq_diagnostico_de_matricula.matriculas_urbana)', 'urban_enrollments') .field('SUM(simcaq_diagnostico_de_matricula.matriculas_rural)', 'rural_enrollments') + .field('ano_censo', 'year') + .group('ano_censo') .group('simcaq_diagnostico_de_matricula.etapa'); next(); }, query, response('enrollmentDiagnosis')); diff --git a/src/libs/routes_v2/simcaqFirstReport.js b/src/libs/routes_v2/simcaqFirstReport.js index b6bde1645d2da66359295b0d36cc7488f7e37a2c..b3bca02bc4215d34b267d11a3743d18db33dd878 100644 --- a/src/libs/routes_v2/simcaqFirstReport.js +++ b/src/libs/routes_v2/simcaqFirstReport.js @@ -101,7 +101,7 @@ rqf.addField({ field: 'localizacao_id' } }).addValue({ - name: 'stage', + name: 'education_level_short_id', table: 'simcaq_relatorio_1', tableField: 'etapa', where: { @@ -122,11 +122,13 @@ rqf.addField({ simcaqFirstReportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { req.sql.from('simcaq_relatorio_1') - .field('simcaq_relatorio_1.etapa', 'stage') + .field('simcaq_relatorio_1.etapa', 'education_level_short_id') .field('simcaq_relatorio_1.turno', 'shift') .field('simcaq_relatorio_1.localizacao_id', 'location') .field('SUM(simcaq_relatorio_1.num_matriculas)', 'num_enrollments') .field('SUM(simcaq_relatorio_1.num_escolas)', 'num_schools') + .field('ano_censo', 'year') + .group('ano_censo') .group('simcaq_relatorio_1.etapa') .group('simcaq_relatorio_1.turno') .group('simcaq_relatorio_1.localizacao_id'); diff --git a/src/libs/routes_v2/simcaqSecondReport.js b/src/libs/routes_v2/simcaqSecondReport.js index fdd583d6e82792a64f9c89031cde005308ac0d74..1aa89412ebd689c34e24a07e70d4decbce4e25c5 100644 --- a/src/libs/routes_v2/simcaqSecondReport.js +++ b/src/libs/routes_v2/simcaqSecondReport.js @@ -102,6 +102,8 @@ simcaqSecondReportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { .field('sum(num_escolas_rural)' ,'num_schools_rural') .field('sum(num_escolas_urbana)' ,'num_schools_urban') .field('dependencia_adm_priv', 'private_adm_dependency') + .field('ano_censo', 'year') + .group('ano_censo') .group('dependencia_adm_priv'); next(); }, query, response('simcaqSecondReport'));