Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
simcaq-node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simcaq
simcaq-node
Commits
2f94eac6
Commit
2f94eac6
authored
2 months ago
by
es23
Browse files
Options
Downloads
Patches
Plain Diff
fix filters
parent
e2b79a95
Branches
Branches containing commit
No related tags found
1 merge request
!492
Indicador Número de Matrículas do Ensino Superior (novo)
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libs/routes_v1/superiorEnrollmentAggregate.js
+43
-42
43 additions, 42 deletions
src/libs/routes_v1/superiorEnrollmentAggregate.js
with
43 additions
and
42 deletions
src/libs/routes_v1/superiorEnrollmentAggregate.js
+
43
−
42
View file @
2f94eac6
...
...
@@ -59,38 +59,33 @@ superiorEnrollmentAggregateApp.get('/years', (req, res, next) => {
next
();
},
query
,
response
(
'
years
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/qtd_graduates
'
,
(
req
,
res
,
next
)
=>
{
req
.
sql
.
from
(
'
curso_superior_agregado
'
)
.
field
(
'
DISTINCT SUM(curso_superior_agregado.qtd_concluintes)
'
,
'
qtd_graduates
'
)
.
where
(
'
curso_superior_agregado.ano_censo >= 2020
'
)
next
();
},
query
,
response
(
'
qtd_graduates
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/ies_name
'
,
(
req
,
res
,
next
)
=>
{
req
.
sql
.
from
(
'
curso_superior_agregado
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_ies
'
,
'
ies_cod
'
)
.
field
(
'
curso_superior_agregado.nome_ies
'
,
'
ies_name
'
)
.
from
(
'
ies_ens_superior
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_ies
'
,
'
id
'
)
.
field
(
'
ies_ens_superior.nome_ies
'
,
'
name
'
)
.
where
(
'
ies_ens_superior.cod_ies = curso_superior_agregado.cod_ies
'
)
.
where
(
'
curso_superior_agregado.ano_censo >= 2020
'
)
next
();
},
query
,
response
(
'
ies_name
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/
uf_agg
'
,
(
req
,
res
,
next
)
=>
{
superiorEnrollmentAggregateApp
.
get
(
'
/
state
'
,
(
req
,
res
,
next
)
=>
{
req
.
sql
.
from
(
'
curso_superior_agregado
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_uf
'
,
'
uf_co
d
'
)
.
field
(
'
curso_superior_agregado.nome_uf
'
,
'
uf_
name
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_uf
'
,
'
i
d
'
)
.
field
(
'
curso_superior_agregado.nome_uf
'
,
'
name
'
)
.
where
(
'
curso_superior_agregado.ano_censo >= 2020
'
)
.
where
(
'
curso_superior_agregado.nome_uf IS NOT NULL
'
)
next
();
},
query
,
response
(
'
uf_agg
'
));
},
query
,
response
(
'
state
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/city
_agg
'
,
(
req
,
res
,
next
)
=>
{
superiorEnrollmentAggregateApp
.
get
(
'
/city
'
,
(
req
,
res
,
next
)
=>
{
req
.
sql
.
from
(
'
curso_superior_agregado
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_mun
'
,
'
city_co
d
'
)
.
field
(
'
curso_superior_agregado.nome_mun
'
,
'
city_
name
'
)
.
field
(
'
DISTINCT curso_superior_agregado.cod_mun
'
,
'
i
d
'
)
.
field
(
'
curso_superior_agregado.nome_mun
'
,
'
name
'
)
.
where
(
'
curso_superior_agregado.ano_censo >= 2020
'
)
.
order
(
'
curso_superior_agregado.cod_mun
'
)
next
();
},
query
,
response
(
'
city
_agg
'
));
},
query
,
response
(
'
city
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/tp_categ_adm
'
,
(
req
,
res
,
next
)
=>
{
req
.
result
=
[]
...
...
@@ -101,7 +96,7 @@ superiorEnrollmentAggregateApp.get('/tp_categ_adm', (req, res, next) => {
});
}
next
();
},
response
(
'
adm_dependency
'
));
},
response
(
'
tp_categ_adm
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/cine_global
'
,
(
req
,
res
,
next
)
=>
{
req
.
result
=
[];
...
...
@@ -122,7 +117,7 @@ superiorEnrollmentAggregateApp.get('/cine_specific', (req, res, next) => {
id
:
i
,
name
:
id2str
.
cineSpecific
(
i
)
};
if
(
obj
.
name
!==
id
1
str
.
cineSpecific
(
defaultCase
)){
if
(
obj
.
name
!==
id
2
str
.
cineSpecific
(
defaultCase
)){
req
.
result
.
push
(
obj
);
}
};
...
...
@@ -193,7 +188,7 @@ superiorEnrollmentAggregateApp.get('/academic_organization', (req, res, next) =>
next
();
},
response
(
'
academic_organization
'
));
superiorEnrollmentAggregateApp
.
get
(
'
/region
_agg
'
,
(
req
,
res
,
next
)
=>
{
superiorEnrollmentAggregateApp
.
get
(
'
/region
'
,
(
req
,
res
,
next
)
=>
{
req
.
result
=
[];
for
(
let
i
=
1
;
i
<=
5
;
++
i
)
{
req
.
result
.
push
({
...
...
@@ -202,7 +197,7 @@ superiorEnrollmentAggregateApp.get('/region_agg', (req, res, next) => {
})
}
next
();
},
response
(
'
region
_agg
'
));
},
response
(
'
region
'
));
rqf
.
addField
({
name
:
'
filter
'
,
...
...
@@ -236,7 +231,7 @@ rqf.addField({
name
:
'
tp_categ_adm
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
tp_categ_adm
'
,
resultField
:
'
tp_categ_adm
'
,
resultField
:
'
tp_categ_adm
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -246,27 +241,27 @@ rqf.addField({
name
:
'
cine_global
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
[
'
nome_cine_area_geral
'
,
'
cod_cine_area_geral
'
],
resultField
:
[
'
name_
cine_global
'
,
'
cod_
cine_global
'
],
resultField
:
[
'
cine_global
_name
'
,
'
cine_global
_id
'
],
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
cod_cine_area_geral
'
,
},
}).
addValue
({
name
:
'
cine_sp
'
,
name
:
'
cine_sp
ecific
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
[
'
nome_cine_area_esp
'
,
'
cod_cine_area_esp
'
],
resultField
:
[
'
name_
cine_sp
'
,
'
cod_
cine_sp
'
],
resultField
:
[
'
cine_sp
_name
'
,
'
cine_sp
_id
'
],
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
cod_cine_area_esp
'
}
}).
addValue
({
name
:
'
cine_de
a
tiled
'
,
name
:
'
cine_det
a
iled
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
[
'
nome_cine_area_detalhada
'
,
'
cod_cine_area_detalhada
'
],
resultField
:
[
'
name_
cine_detailed
'
,
'
cod_
cine_detailed
'
],
resultField
:
[
'
cine_detailed
_name
'
,
'
cine_detailed
_id
'
],
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -276,7 +271,7 @@ rqf.addField({
name
:
'
graduates
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
qtd_concluintes
'
,
resultField
:
'
graduates
'
,
resultField
:
'
graduates
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -286,7 +281,7 @@ rqf.addField({
name
:
'
disabled_students
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
qtd_aluno_deficiente
'
,
resultField
:
'
disabled_students
'
,
resultField
:
'
disabled_students
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -296,7 +291,7 @@ rqf.addField({
name
:
'
academic_level
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
tp_grau_acad
'
,
resultField
:
'
academic_level
'
,
resultField
:
'
academic_level
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -306,7 +301,7 @@ rqf.addField({
name
:
'
ies_name
'
,
table
:
'
ies_ens_superior
'
,
tableField
:
'
nome_ies
'
,
resultField
:
'
ies_
name
'
,
resultField
:
'
ies_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -321,7 +316,7 @@ rqf.addField({
name
:
'
modality
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
tp_modal_ens
'
,
resultField
:
'
modality
'
,
resultField
:
'
modality
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -331,37 +326,37 @@ rqf.addField({
name
:
'
academic_organization
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
tp_org_acad
'
,
resultField
:
'
academic_organization
'
,
resultField
:
'
academic_organization
_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
tp_org_acad
'
}
}).
addValue
({
name
:
'
region
_agg
'
,
name
:
'
region
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
nome_reg
'
,
resultField
:
'
reg_
name
'
,
resultField
:
'
reg_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
cod_reg
'
}
}).
addValue
({
name
:
'
uf_agg
'
,
name
:
'
state
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
nome_uf
'
,
resultField
:
'
uf_
name
'
,
resultField
:
'
uf_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
cod_uf
'
}
}).
addValue
({
name
:
'
city
_agg
'
,
name
:
'
city
'
,
table
:
'
curso_superior_agregado
'
,
tableField
:
'
nome_mun
'
,
resultField
:
'
city_
name
'
,
resultField
:
'
city_
id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
...
...
@@ -375,7 +370,7 @@ superiorEnrollmentAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, nex
req
.
sql
.
field
(
'
curso_superior_agregado.ano_censo
'
,
'
year
'
);
if
(
req
.
query
.
dims
&&
req
.
query
.
dims
.
includes
(
"
ethnic_group
"
)){
req
.
sql
.
field
.
field
(
'
sum(qtd_mat_branca)
'
,
'
total_branca
'
)
req
.
sql
.
field
(
'
sum(qtd_mat_branca)
'
,
'
total_branca
'
)
.
field
(
'
sum(qtd_mat_preta)
'
,
'
total_preta
'
)
.
field
(
'
sum(qtd_mat_parda)
'
,
'
total_parda
'
)
.
field
(
'
sum(qtd_mat_amarela)
'
,
'
total_amarela
'
)
...
...
@@ -405,8 +400,14 @@ superiorEnrollmentAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, nex
req
.
sql
.
field
(
'
sum(qtd_mat_diurno)
'
,
'
total_diurno
'
)
.
field
(
'
sum(qtd_mat_noturno)
'
,
'
total_noturno
'
);
}
else
if
(
req
.
query
.
dims
&&
req
.
query
.
dims
.
includes
(
"
qtd_graduates_agg
"
)){
req
.
sql
.
field
(
'
SUM(curso_superior_agregado.qtd_concluintes)
'
,
'
total
'
);
}
else
if
(
req
.
query
.
dims
&&
req
.
query
.
dims
.
includes
(
"
disabled_students_agg
"
)){
req
.
sql
.
field
(
'
SUM(curso_superior_agregado.qtd_aluno_deficiente)
'
,
'
total
'
)
}
else
{
req
.
sql
.
field
(
'
SUM(qtd_matriculas)
'
,
'
enrollment
'
);
req
.
sql
.
field
(
'
SUM(qtd_matriculas)
'
,
'
total
'
);
}
req
.
sql
.
from
(
'
curso_superior_agregado
'
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment