Skip to content
Snippets Groups Projects
Commit e6768ac2 authored by Henrique Varella Ehrenfried's avatar Henrique Varella Ehrenfried :speech_balloon:
Browse files

Merge branch 'indigenas_territorial' into 'development'

Indigenas territorial

See merge request !44
parents 8cbee83d 30e29e18
Branches
No related tags found
2 merge requests!48Development,!44Indigenas territorial
Pipeline #24025 failed
...@@ -46,7 +46,7 @@ rqf.addField({ ...@@ -46,7 +46,7 @@ rqf.addField({
where: false where: false
}).addValue({ }).addValue({
name: 'year', name: 'year',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'ano', tableField: 'ano',
resultField: 'ano_divulgacao', resultField: 'ano_divulgacao',
where: { where: {
...@@ -56,7 +56,7 @@ rqf.addField({ ...@@ -56,7 +56,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'local_name', name: 'local_name',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'nome_terra', tableField: 'nome_terra',
resultField: 'nome_terra_indigena', resultField: 'nome_terra_indigena',
where: { where: {
...@@ -66,7 +66,7 @@ rqf.addField({ ...@@ -66,7 +66,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'ethnic_name', name: 'ethnic_name',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'nome_etnia', tableField: 'nome_etnia',
resultField: 'etnia_indigena', resultField: 'etnia_indigena',
where: { where: {
...@@ -76,7 +76,7 @@ rqf.addField({ ...@@ -76,7 +76,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'uf', name: 'uf',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'sigla_uf', tableField: 'sigla_uf',
resultField: 'unidade_federativa', resultField: 'unidade_federativa',
where: { where: {
...@@ -86,7 +86,7 @@ rqf.addField({ ...@@ -86,7 +86,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'area', name: 'area',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'tamanho_superficie', tableField: 'tamanho_superficie',
resultField: 'superficie(ha)', resultField: 'superficie(ha)',
where: { where: {
...@@ -96,7 +96,7 @@ rqf.addField({ ...@@ -96,7 +96,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'process_stage', name: 'process_stage',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'fase_procedimento', tableField: 'fase_procedimento',
resultField: 'fase_do_procedimento', resultField: 'fase_do_procedimento',
where: { where: {
...@@ -106,7 +106,7 @@ rqf.addField({ ...@@ -106,7 +106,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'modality', name: 'modality',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'tipo_modalidade', tableField: 'tipo_modalidade',
resultField: 'tipo_modalidade', resultField: 'tipo_modalidade',
where: { where: {
...@@ -116,7 +116,7 @@ rqf.addField({ ...@@ -116,7 +116,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'county', name: 'county',
table: 'terras_indigenas', table: 'indigenas_territorial_ag',
tableField: 'nome_municipio', tableField: 'nome_municipio',
resultField: 'nome_municipio', resultField: 'nome_municipio',
where: { where: {
...@@ -124,11 +124,21 @@ rqf.addField({ ...@@ -124,11 +124,21 @@ rqf.addField({
type: 'string', type: 'string',
field: 'nome_municipio' field: 'nome_municipio'
} }
}).addValue({
name: 'region',
table: 'indigenas_territorial_ag',
tableField: 'regiao',
resultField: 'nome_regiao',
where: {
relation: '=',
type: 'string',
field: 'nome_regiao'
}
}); });
indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) { indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
console.log(req.sql.toString()); console.log(req.sql.toString());
req.sql.field('COUNT(*) AS Total').from('terras_indigenas'); req.sql.field('COUNT(*) AS Total').from('indigenas_territorial_ag');
next(); next();
}, query, response('terras_ind')); }, query, response('terras_ind'));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment