Skip to content
Snippets Groups Projects
Commit a03abd40 authored by lgtg20's avatar lgtg20
Browse files

Merge branch 'development' into 'homologa'

Development

See merge request !469
parents 72b5b98c 67d1a0e9
No related branches found
No related tags found
1 merge request!469Development
...@@ -21,13 +21,22 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>. ...@@ -21,13 +21,22 @@ along with simcaq-node. If not, see <https://www.gnu.org/licenses/>.
module.exports = function regionCode(id) { module.exports = function regionCode(id) {
switch (id) { switch (id) {
case 1: case 1:
return 'Rede pública (anual)' return "Ano";
case 2: case 2:
return 'Rede pública (mensal)'; return "Entidade";
case 3: case 3:
return 'Rede pública e conveniada (anual)'; return 'Despesas';
case 4: case 4:
return 'Rede pública e conveniada (mensal)'; return 'Matrículas Públicas';
case 5:
return 'Matrículas Públicas Mais Conveniada';
case 6:
return 'Despesas Aluno Ano Pública'
case 7:
return 'Despesas Aluno Mês Pública';
case 8:
return 'Despesas Aluno Ano Pública Mais Conveniada';
case 9:
return 'Despesas Aluno Mês Pública Mais Conveniada';
} }
}; };
...@@ -344,6 +344,9 @@ adjustedLiquidFrequency.get('/', rqf.parse(), (req, res, next) => { ...@@ -344,6 +344,9 @@ adjustedLiquidFrequency.get('/', rqf.parse(), (req, res, next) => {
${dimensions.income_range ? "AND total_pop.income_range_id = pnad_novo.faixa_rendimento_aux" : ""} ${dimensions.income_range ? "AND total_pop.income_range_id = pnad_novo.faixa_rendimento_aux" : ""}
${dimensions.cap_code ? "AND total_pop.cap_code_id = pnad_novo.cod_cap" : ""} ${dimensions.cap_code ? "AND total_pop.cap_code_id = pnad_novo.cod_cap" : ""}
${dimensions.metro_code ? "AND pnad_novo.cod_rm_ride <> 99 AND total_pop.metro_code_id = pnad_novo.cod_rm_ride" : ""} ${dimensions.metro_code ? "AND pnad_novo.cod_rm_ride <> 99 AND total_pop.metro_code_id = pnad_novo.cod_rm_ride" : ""}
${dimensions.region ? "AND total_pop.region_id = pnad_novo.cod_regiao" : ""}
${dimensions.state ? "AND total_pop.state_id = pnad_novo.cod_uf" : ""}
` `
// Subquery: total_apoio_freq // Subquery: total_apoio_freq
...@@ -393,6 +396,12 @@ adjustedLiquidFrequency.get('/', rqf.parse(), (req, res, next) => { ...@@ -393,6 +396,12 @@ adjustedLiquidFrequency.get('/', rqf.parse(), (req, res, next) => {
if (dimensions.metro_code) if (dimensions.metro_code)
mainQuery.field("total_apoio_freq.metro_code_id") mainQuery.field("total_apoio_freq.metro_code_id")
if (dimensions.region)
mainQuery.field("total_apoio_freq.region_id")
if (dimensions.state)
mainQuery.field("total_apoio_freq.state_id")
req.sql = mainQuery; req.sql = mainQuery;
next(); next();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment