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

Merge branch 'rotas_indigenas' into 'development'

Rotas indigenas

See merge request !41
parents 37c92750 8d193f15
No related branches found
No related tags found
2 merge requests!48Development,!41Rotas indigenas
Pipeline #23866 failed
...@@ -22,7 +22,7 @@ along with SMPPIR-Node. If not, see <https://www.gnu.org/licenses/>. ...@@ -22,7 +22,7 @@ along with SMPPIR-Node. If not, see <https://www.gnu.org/licenses/>.
var express = require('express'); var express = require('express');
var indigenasSchoolsApp = express.Router(); var indigenasEnrollmentApp = express.Router();
var libs = process.cwd() + '/libs'; var libs = process.cwd() + '/libs';
...@@ -136,10 +136,10 @@ rqf.addField({ ...@@ -136,10 +136,10 @@ rqf.addField({
} }
}); });
indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) { indigenasEnrollmentApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
console.log(req.sql.toString()); console.log(req.sql.toString());
req.sql.field('SUM(total) AS Total').from('terras_indigenas'); req.sql.field('SUM(total) AS Total').from('indigenas_schools_ag');
next(); next();
}, query, response('indigenas_mat')); }, query, response('indigenas_mat'));
module.exports = indigenasSchoolsApp; module.exports = indigenasEnrollmentApp;
\ No newline at end of file \ No newline at end of file
...@@ -138,7 +138,7 @@ rqf.addField({ ...@@ -138,7 +138,7 @@ rqf.addField({
indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) { indigenasSchoolsApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
console.log(req.sql.toString()); console.log(req.sql.toString());
req.sql.field('COUNT(distinct id) AS Total').from('terras_indigenas'); req.sql.field('COUNT(distinct id) AS Total').from('indigenas_schools_ag');
next(); next();
}, query, response('indigenas_esc')); }, query, response('indigenas_esc'));
......
...@@ -114,6 +114,16 @@ rqf.addField({ ...@@ -114,6 +114,16 @@ rqf.addField({
type: 'string', type: 'string',
field: 'tipo_modalidade' field: 'tipo_modalidade'
} }
}).addValue({
name: 'county',
table: 'terras_indigenas',
tableField: 'nome_municipio',
resultField: 'nome_municipio',
where: {
relation: '=',
type: 'string',
field: 'nome_municipio'
}
}); });
indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) { indigenasTerritorialApp.get('/', rqf.parse(), rqf.build(), function (req, res, next) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment