diff --git a/src/libs/routes_v1/enrollmentAggregate.js b/src/libs/routes_v1/enrollmentAggregate.js index 78cfe4e66e658c347b23ce7e117122eab80811b9..e5b877f04d803218b9987ba25fbd2bc16d4b1df8 100644 --- a/src/libs/routes_v1/enrollmentAggregate.js +++ b/src/libs/routes_v1/enrollmentAggregate.js @@ -291,6 +291,19 @@ rqf.addField({ // Return all cities enrollmentAggregateApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => { + + console.log(req.query); + + if (req.query.dims.includes('gender')) + { + req.sql.from('escola') + .field('SUM(escola.qt_mat_bas_mas)', 'total_mas') + .field('SUM(escola.qt_mat_bas_fem)', 'total_fem') + .field('escola.ano_censo', 'year') + .group('escola.ano_censo') + .order('escola.ano_censo'); + } + req.sql.from('escola') .field('SUM(escola.qt_mat_bas)', 'total') .field('escola.ano_censo', 'year')