Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
SMPPIR-Node
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
SMPPIR
SMPPIR-Node
Merge requests
!40
Rotas indigenas
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Rotas indigenas
rotas_indigenas
into
development
Overview
0
Commits
4
Pipelines
0
Changes
4
Merged
ns17
requested to merge
rotas_indigenas
into
development
4 years ago
Overview
0
Commits
4
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Compare
development
development (base)
and
latest version
latest version
1fba58f6
4 commits,
4 years ago
4 files
+
297
−
1
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
src/libs/routes/SMPPIR/indigenas_enrollment.js
0 → 100644
+
145
−
0
Options
'
use strict
'
;
/*
Copyright (C) 2019 Centro de Computacao Cientifica e Software Livre
Departamento de Informatica - Universidade Federal do Parana - C3SL/UFPR
This file is part of SMPPIR-Node.
SMPPIR-Node is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
SMPPIR-Node is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with SMPPIR-Node. If not, see <https://www.gnu.org/licenses/>.
*/
var
express
=
require
(
'
express
'
);
var
indigenasSchoolsApp
=
express
.
Router
();
var
libs
=
process
.
cwd
()
+
'
/libs
'
;
var
squel
=
require
(
'
squel
'
);
var
query
=
require
(
libs
+
'
/middlewares/query
'
).
query
;
var
response
=
require
(
libs
+
'
/middlewares/response
'
);
var
ReqQueryFields
=
require
(
libs
+
'
/middlewares/reqQueryFields
'
);
var
rqf
=
new
ReqQueryFields
();
rqf
.
addField
({
name
:
'
filter
'
,
field
:
false
,
where
:
true
}).
addField
({
name
:
'
dims
'
,
field
:
true
,
where
:
false
}).
addValue
({
name
:
'
year
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
ano_censo
'
,
resultField
:
'
ano_censo
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
ano_censo
'
}
}).
addValue
({
name
:
'
localizacao_diferenciada
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
localizacao_diferenciada_id
'
,
resultField
:
'
cod_localizacao_diferenciada
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
integer
'
,
field
:
'
localizacao_diferenciada_id
'
}
}).
addValue
({
name
:
'
agua
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
agua_rede_publica
'
,
resultField
:
'
abastecimento_agua_rede_publica
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
agua_rede_publica
'
}
}).
addValue
({
name
:
'
energia
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
energia_rede_publica
'
,
resultField
:
'
abastecimento_energia_rede_publica
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
energia_rede_publica
'
}
}).
addValue
({
name
:
'
esgoto
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
esgoto_rede_publica
'
,
resultField
:
'
esgotamento_snaitario_rede_publica
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
esgoto_rede_publica
'
}
}).
addValue
({
name
:
'
lixo
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
lixo_coleta_periodica
'
,
resultField
:
'
coleta_lixo_periodica
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
lixo_coleta_periodica
'
}
}).
addValue
({
name
:
'
uf
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
sigla
'
,
resultField
:
'
sigla_uf
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
sigla
'
}
}).
addValue
({
name
:
'
id
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
id
'
,
resultField
:
'
escola_id
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
id
'
}
}).
addValue
({
name
:
'
etapa_ensino
'
,
table
:
'
indigenas_schools_ag
'
,
tableField
:
'
etapa_ensino
'
,
resultField
:
'
etapa_ensino
'
,
where
:
{
relation
:
'
=
'
,
type
:
'
string
'
,
field
:
'
etapa_ensino
'
}
});
indigenasSchoolsApp
.
get
(
'
/
'
,
rqf
.
parse
(),
rqf
.
build
(),
function
(
req
,
res
,
next
)
{
console
.
log
(
req
.
sql
.
toString
());
req
.
sql
.
field
(
'
SUM(total) AS Total
'
).
from
(
'
terras_indigenas
'
);
next
();
},
query
,
response
(
'
indigenas_mat
'
));
module
.
exports
=
indigenasSchoolsApp
;
\ No newline at end of file
Loading