diff --git a/src/libs/routes/auxiliar.js b/src/libs/routes/auxiliar.js index 5a4198d32bb0bfb55d996bd7e6b363ec6dd69436..08a910e5f6b44b53d1d2fca1bc3f47bf065ef015 100644 --- a/src/libs/routes/auxiliar.js +++ b/src/libs/routes/auxiliar.js @@ -370,7 +370,7 @@ auxiliarApp.get('/', rqf.parse(), (req, res, next) => { .where('(docente.tipo_docente = 2) AND \ ((docente.tipo_turma_id >= 0 AND docente.tipo_turma_id <= 3 AND docente.tipo_turma_atendimento_id is NULL) \ OR ((docente.tipo_turma_atendimento_id = 1 OR docente.tipo_turma_atendimento_id = 2) AND docente.tipo_turma_id is NULL)) \ - AND (docente.ano_censo <> 2009 or docente.escola_estado_id <> 42)'); // não devemos trazer SC em 2009. + AND (docente.ano_censo <> 2009 or (docente.escola_estado_id <> 42 AND docente.escola_estado_id <> 43))'); // não devemos trazer SC em 2009. next(); }, rqf.build(), query, addMissing(rqf), id2str.transform(), response('auxiliar')); diff --git a/src/libs/routes/class.js b/src/libs/routes/class.js index 4cf349fa06672f1fbe927ddd4f424a9d4edb0844..88df17a2dc937ab7ac92bd80fc642cc431dc6384 100644 --- a/src/libs/routes/class.js +++ b/src/libs/routes/class.js @@ -275,6 +275,16 @@ rqfCount.addField({ type: 'integer', field: 'localizacao_id' } +}).addValue({ + name: 'diff_location', + table: 'turma', + tableField: 'localizacao_diferenciada_par', + resultField: 'diff_location_id_par', + where: { + relation: '=', + type: 'integer', + field: 'localizacao_diferenciada_par' + } }).addValue({ name: 'rural_location', table: 'turma', diff --git a/src/libs/routes/employees.js b/src/libs/routes/employees.js index 89b5ebd090ebcf0d83c536bd2ee05eded98015e3..20dcb7b26195ad6ccb0d662a96c70b269a05acb1 100644 --- a/src/libs/routes/employees.js +++ b/src/libs/routes/employees.js @@ -253,6 +253,16 @@ rqfSchool.addField({ type: 'integer', field: 'localizacao_id' } +}).addValue({ + name: 'diff_location', + table: '@', + tableField: 'localizacao_diferenciada_par', + resultField: 'diff_location_id_par', + where: { + relation: '=', + type: 'integer', + field: 'localizacao_diferenciada_par' + } }).addValue({ name: 'rural_location', table: '@', diff --git a/src/libs/routes/enrollment.js b/src/libs/routes/enrollment.js index c3a1e68d3d2ab0aae30bd37a120ec489d1d09439..e0da7fbf7f4e51d7a69da0c1a1f0a45b3d0b1cec 100644 --- a/src/libs/routes/enrollment.js +++ b/src/libs/routes/enrollment.js @@ -498,6 +498,16 @@ rqf.addField({ type: 'integer', field: 'localizacao_id' } +}).addValue({ + name: 'diff_location', + table: 'matricula', + tableField: 'localizacao_diferenciada_par', + resultField: 'diff_location_id_par', + where: { + relation: '=', + type: 'integer', + field: 'localizacao_diferenciada_par' + } }).addValue({ name: 'rural_location', table: 'matricula', diff --git a/src/libs/routes/school.js b/src/libs/routes/school.js index e8527400e69d59adab330363ed8da1383b694184..f100b6e6410feb761f609e10cc17414fd0821c7c 100644 --- a/src/libs/routes/school.js +++ b/src/libs/routes/school.js @@ -429,6 +429,16 @@ rqfCount.addField({ type: 'integer', field: 'localizacao_id' } +}).addValue({ + name: 'diff_location', + table: 'escola', + tableField: 'localizacao_diferenciada_par', + resultField: 'diff_location_id_par', + where: { + relation: '=', + type: 'integer', + field: 'localizacao_diferenciada_par' + } }).addValue({ name: 'rural_location', table: 'escola', diff --git a/src/libs/routes/teacher.js b/src/libs/routes/teacher.js index 51e5fea4be860ef25364252286fca143a59e921c..05f312228e255863cfe33728ca649891c7322af4 100644 --- a/src/libs/routes/teacher.js +++ b/src/libs/routes/teacher.js @@ -416,6 +416,16 @@ rqf.addField({ type: 'integer', field: 'localizacao_id' } +}).addValue({ + name: 'diff_location', + table: 'docente', + tableField: 'localizacao_diferenciada_par', + resultField: 'diff_location_id_par', + where: { + relation: '=', + type: 'integer', + field: 'localizacao_diferenciada_par' + } }).addValue({ name: 'rural_location', table: 'docente', @@ -522,7 +532,7 @@ teacherApp.get('/', rqf.parse(), (req, res, next) => { .where('(docente.tipo_docente = 1 OR docente.tipo_docente = 5) AND \ ((docente.tipo_turma_id >= 0 AND docente.tipo_turma_id <= 3 AND docente.tipo_turma_atendimento_id is NULL) \ OR ((docente.tipo_turma_atendimento_id = 1 OR docente.tipo_turma_atendimento_id = 2) AND docente.tipo_turma_id is NULL)) \ - AND (docente.ano_censo <> 2009 or docente.escola_estado_id <> 42)'); // não devemos trazer SC em 2009. + AND (docente.ano_censo <> 2009 or (docente.escola_estado_id <> 42 and docente.escola_estado_id <> 43) )'); // não devemos trazer SC em 2009. // if("education_level_mod" in req.dims) { // req.hadEducationLevelMod = true;