Skip to content
Snippets Groups Projects
Commit 40e673b8 authored by jvfpw18's avatar jvfpw18
Browse files

Update dailyChargeAmount filters

parent c06c2b1c
No related branches found
No related tags found
1 merge request!257V1.14.0
Pipeline #23218 failed
...@@ -373,7 +373,7 @@ dailyChargeAmountApp.get('/', rqf.parse(), (req, res, next) => { ...@@ -373,7 +373,7 @@ dailyChargeAmountApp.get('/', rqf.parse(), (req, res, next) => {
.group('turma.etapa_resumida') .group('turma.etapa_resumida')
.order('turma.ano_censo') .order('turma.ano_censo')
.order('turma.etapa_resumida') .order('turma.etapa_resumida')
.where('turma.tipo_turma_id <= 3 and turma.dependencia_adm_id <= 3') .where('((turma.tipo_turma_id <= 3 AND turma.tipo_atendimento_id is NULL) OR (turma.tipo_atendimento_id <= 2 AND turma.tipo_turma_id is NULL)) and turma.dependencia_adm_id <= 3')
} else { } else {
res.status(400); res.status(400);
next({ next({
...@@ -428,13 +428,13 @@ dailyChargeAmountApp.get('/average', rqf.parse(), rqf.build(), (req, res, next) ...@@ -428,13 +428,13 @@ dailyChargeAmountApp.get('/average', rqf.parse(), rqf.build(), (req, res, next)
.field('duracao_turma') .field('duracao_turma')
.field('etapas_mod_ensino_segmento_id') .field('etapas_mod_ensino_segmento_id')
.field('ROW_NUMBER() OVER(PARTITION BY etapas_mod_ensino_segmento_id ORDER BY duracao_turma)', 'rowno') .field('ROW_NUMBER() OVER(PARTITION BY etapas_mod_ensino_segmento_id ORDER BY duracao_turma)', 'rowno')
.where('tipo_turma_id <= 3') .where('((turma.tipo_turma_id <= 3 AND turma.tipo_atendimento_id is NULL) OR (turma.tipo_atendimento_id <= 2 AND turma.tipo_turma_id is NULL))')
let tableG = baseQ.clone(); let tableG = baseQ.clone();
tableG.from('turma') tableG.from('turma')
.field('1+COUNT(*)', 'counter') .field('1+COUNT(*)', 'counter')
.field('etapas_mod_ensino_segmento_id') .field('etapas_mod_ensino_segmento_id')
.where('tipo_turma_id <= 3') .where('((turma.tipo_turma_id <= 3 AND turma.tipo_atendimento_id is NULL) OR (turma.tipo_atendimento_id <= 2 AND turma.tipo_turma_id is NULL))')
.group('etapas_mod_ensino_segmento_id') .group('etapas_mod_ensino_segmento_id')
let joinRG = squel.select(); let joinRG = squel.select();
...@@ -458,7 +458,8 @@ dailyChargeAmountApp.get('/average', rqf.parse(), rqf.build(), (req, res, next) ...@@ -458,7 +458,8 @@ dailyChargeAmountApp.get('/average', rqf.parse(), rqf.build(), (req, res, next)
.group('turma.etapas_mod_ensino_segmento_id') .group('turma.etapas_mod_ensino_segmento_id')
.order('turma.ano_censo') .order('turma.ano_censo')
.order('turma.etapas_mod_ensino_segmento_id') .order('turma.etapas_mod_ensino_segmento_id')
.where('turma.tipo_turma_id <= 3 and m.etapas_mod_ensino_segmento_id = turma.etapas_mod_ensino_segmento_id') .where('((turma.tipo_turma_id <= 3 AND turma.tipo_atendimento_id is NULL) OR (turma.tipo_atendimento_id <= 2 AND turma.tipo_turma_id is NULL)) \
and m.etapas_mod_ensino_segmento_id = turma.etapas_mod_ensino_segmento_id')
} else { } else {
res.status(400); res.status(400);
next({ next({
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment