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
ea3ce29e
Commit
ea3ce29e
authored
2 years ago
by
jpko19
Browse files
Options
Downloads
Patches
Plain Diff
Update pee_por_categoria
parent
b2d70daf
No related branches found
No related tags found
3 merge requests
!329
Update enrollment - new filters
,
!324
Dev
,
!309
Merge new updates into master
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libs/routes/enrollment.js
+28
-6
28 additions, 6 deletions
src/libs/routes/enrollment.js
with
28 additions
and
6 deletions
src/libs/routes/enrollment.js
+
28
−
6
View file @
ea3ce29e
...
@@ -770,12 +770,34 @@ rqf.addField({
...
@@ -770,12 +770,34 @@ rqf.addField({
});
});
enrollmentApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
enrollmentApp
.
get
(
'
/
'
,
rqf
.
parse
(),
(
req
,
res
,
next
)
=>
{
req
.
sql
.
field
(
'
COUNT(*)
'
,
'
total
'
)
if
(
'
pee_por_categotria
'
in
req
.
field
){
.
field
(
'
matricula.ano_censo
'
,
'
year
'
)
req
.
sql
.
field
(
'
SUM(SUM(CASE WHEN cegueira = true THEN 1 ELSE 0)
'
,
'
total_cegueira
'
)
.
from
(
'
matricula
'
)
.
field
(
'
SUM(CASE WHEN baixa_visao = true THEN 1 ELSE 0)
'
,
'
total_baixa_visao
'
)
.
group
(
'
matricula.ano_censo
'
)
.
field
(
'
SUM(CASE WHEN surdez = true THEN 1 ELSE 0)
'
,
'
total_surdez
'
)
.
order
(
'
matricula.ano_censo
'
)
.
field
(
'
SUM(CASE WHEN deficiencia_auditiva = true THEN 1 ELSE 0)
'
,
'
total_deficiencia_auditiva
'
)
.
where
(
'
((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))
'
);
.
field
(
'
SUM(CASE WHEN surdo_cegueira = true THEN 1 ELSE 0)
'
,
'
total_surdo_cegueira
'
)
.
field
(
'
SUM(CASE WHEN deficiencia_fisica = true THEN 1 ELSE 0)
'
,
'
total_deficiencia_fisica
'
)
.
field
(
'
SUM(CASE WHEN deficiencia_intelectual = true THEN 1 ELSE 0)
'
,
'
total_deficiencia_intelectual
'
)
.
field
(
'
SUM(CASE WHEN deficiencia_multiplas = true THEN 1 ELSE 0)
'
,
'
total_deficiencia_multiplas
'
)
.
field
(
'
SUM(CASE WHEN autismo = true THEN 1 ELSE 0)
'
,
'
total_autismo
'
)
.
field
(
'
SUM(CASE WHEN sindrome_asperger = true THEN 1 ELSE 0)
'
,
'
total_sindrome_asperger
'
)
.
field
(
'
SUM(CASE WHEN sindrome_rett = true THEN 1 ELSE 0)
'
,
'
total_sindrome_rett
'
)
.
field
(
'
SUM(CASE WHEN transtorno_desintegrativo_da_infancia = true THEN 1 ELSE 0)
'
,
'
total_transtorno_desintegrativo_da_infancia
'
)
.
field
(
'
SUM(CASE WHEN superdotado = true THEN 1 ELSE 0)
'
,
'
total_superdotado
'
)
.
field
(
'
matricula.ano_censo
'
,
'
year
'
)
.
from
(
'
matricula
'
)
.
group
(
'
matricula.ano_censo
'
)
.
order
(
'
matricula.ano_censo
'
)
.
where
(
'
((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))
'
);
}
else
{
req
.
sql
.
field
(
'
COUNT(*)
'
,
'
total
'
)
.
field
(
'
matricula.ano_censo
'
,
'
year
'
)
.
from
(
'
matricula
'
)
.
group
(
'
matricula.ano_censo
'
)
.
order
(
'
matricula.ano_censo
'
)
.
where
(
'
((matricula.tipo<=3 OR matricula.tipo IS NULL) AND (matricula.tipo_atendimento_turma IS NULL OR matricula.tipo_atendimento_turma <= 2))
'
);
}
next
();
next
();
},
rqf
.
build
(),
query
,
id2str
.
transform
(
false
),
response
(
'
enrollment
'
));
},
rqf
.
build
(),
query
,
id2str
.
transform
(
false
),
response
(
'
enrollment
'
));
...
...
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