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
a1a27edd
Commit
a1a27edd
authored
2 weeks ago
by
es23
Browse files
Options
Downloads
Patches
Plain Diff
fix income range null field
parent
5b39f39b
No related branches found
Branches containing commit
No related tags found
3 merge requests
!489
dev -> hom
,
!487
Development
,
!485
Es23 students receiving aid tax
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/libs/routes_v1/studentsReceivingAidTax.js
+16
-0
16 additions, 0 deletions
src/libs/routes_v1/studentsReceivingAidTax.js
with
16 additions
and
0 deletions
src/libs/routes_v1/studentsReceivingAidTax.js
+
16
−
0
View file @
a1a27edd
...
...
@@ -578,8 +578,21 @@ function matchQueries(queryPartial, queryTotal) {
return
match
;
}
function
whereCondition
(
req
)
{
let
where
=
""
;
const
dims
=
req
.
query
.
dims
;
if
(
dims
&&
dims
.
includes
(
"
income_range
"
)){
where
+=
`pnad_novo.faixa_rendimento_aux_tx is not null`
;
}
return
where
;
}
studentsReceivingAidTaxApp
.
get
(
'
/
'
,
rqf
.
parse
(),
rqf
.
build
(),
(
req
,
res
,
next
)
=>
{
req
.
querySet
=
[];
let
where
=
whereCondition
(
req
);
// Subquery para total_pop_maior_25 com filtros dinâmicos
let
totalEstudantesQueRecebemAuxilio
=
req
.
sql
.
clone
();
...
...
@@ -587,6 +600,7 @@ studentsReceivingAidTaxApp.get('/', rqf.parse(), rqf.build(), (req, res, next) =
.
field
(
"
ano_ref
"
,
"
year
"
)
.
field
(
"
SUM(peso_domicilio_pessoas_com_cal)
"
,
"
total
"
)
.
where
(
"
recebeu_rendimentos_de_programa_bolsa_familia = 1
"
)
.
where
(
`
${
where
}
`
)
.
where
(
"
frequenta_escola = 1
"
)
.
where
(
"
ano_ref >= 2019
"
)
.
group
(
"
ano_ref
"
)
...
...
@@ -598,7 +612,9 @@ studentsReceivingAidTaxApp.get('/', rqf.parse(), rqf.build(), (req, res, next) =
totalEstudantes
.
from
(
"
pnad_novo
"
)
.
field
(
"
ano_ref
"
,
"
year
"
)
.
field
(
"
SUM(peso_domicilio_pessoas_com_cal)
"
,
"
total
"
)
.
where
(
`
${
where
}
`
)
.
where
(
"
frequenta_escola = 1
"
)
.
where
(
"
ano_ref >= 2019
"
)
.
group
(
"
ano_ref
"
)
.
order
(
"
ano_ref
"
);
...
...
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