Skip to content
Snippets Groups Projects
Commit a208643a authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Merge remote-tracking branch 'origin/v1.11.16'

parents 341175de 4a3a7f04
No related branches found
No related tags found
1 merge request!28Development
......@@ -4,6 +4,10 @@ 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..11.16 - 2019-10-30
## Changed
- University Teacher updated
## 1.11.15 - 2019-10-16
## Changed
- Fix addMissing for classCount route
......
......@@ -46,8 +46,7 @@ let rqf = new ReqQueryFields();
teacherEnrollmentApp.get('/years', (req, res, next) => {
req.sql.from('docente_ens_superior')
.field('DISTINCT docente_ens_superior.ano_censo', 'year')
.where('docente_ens_superior.ano_censo = 2017');
.field('DISTINCT docente_ens_superior.ano_censo', 'year');
next();
}, query, response('years'));
......@@ -303,13 +302,13 @@ rqf.addField({
}).addValue({
name: 'upper_adm_dependency',
table: 'docente_ens_superior',
tableField: 'cod_categoria_administrativa',
tableField: 'par_categoria_administrativa',
resultField: 'upper_adm_dependency_id',
where: {
relation: '=',
type: 'integer',
table: 'docente_ens_superior',
field: 'cod_categoria_administrativa'
field: 'par_categoria_administrativa'
}
}).addValue({
name: 'academic_organization',
......@@ -345,12 +344,12 @@ rqf.addField({
}).addValue({
name:'teacher_situation',
table: 'docente_ens_superior',
tableField: 'cod_situacao_docente',
tableField: 'par_situacao_docente',
resultField: 'teacher_situation_id',
where: {
relation: '=',
type: 'integer',
field: 'cod_situacao_docente'
field: 'par_situacao_docente'
}
}).addValue({
name:'work_regime',
......@@ -455,22 +454,35 @@ rqf.addField({
}).addValue({
name:'deficiency',
table: 'docente_ens_superior',
tableField: 'docente_deficiencia',
tableField: 'par_docente_deficiencia',
resultField: 'deficiency_id',
where: {
relation: '=',
type: 'integer',
field: 'docente_deficiencia'
field: 'par_docente_deficiencia'
}
});
teacherEnrollmentApp.get('/', rqf.parse(), (req, res, next) => {
if ("university" in req.dims) {
req.sql.field('COUNT(*)', 'total')
.field("'Brasil'", 'name')
.field('docente_ens_superior.ano_censo', 'year')
.from('docente_ens_superior')
.group('docente_ens_superior.cod_ies')
.group('docente_ens_superior.ano_censo')
.order('docente_ens_superior.cod_ies')
.order('docente_ens_superior.ano_censo')
}
else {
req.sql.field('COUNT(*)', 'total')
.field("'Brasil'", 'name')
.field('docente_ens_superior.ano_censo', 'year')
.from('docente_ens_superior')
.group('docente_ens_superior.ano_censo')
.order('docente_ens_superior.ano_censo')
}
next();
}, rqf.build(), query, addMissing(rqf), id2str.transform(false), response('teacherEnrollment'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment