Skip to content
Snippets Groups Projects
Commit be0be3d5 authored by Fernando Erd's avatar Fernando Erd :ok_hand:
Browse files

Add generic tables

parent ed6f30ab
No related branches found
No related tags found
No related merge requests found
Pipeline #16859 failed
...@@ -104,7 +104,7 @@ rqf.addField({ ...@@ -104,7 +104,7 @@ rqf.addField({
where: false where: false
}).addValue({ }).addValue({
name: 'adm_dependency', name: 'adm_dependency',
table: 'docente', table: '@',
tableField: 'dependencia_adm_id', tableField: 'dependencia_adm_id',
resultField: 'adm_dependency_id', resultField: 'adm_dependency_id',
where: { where: {
...@@ -114,7 +114,7 @@ rqf.addField({ ...@@ -114,7 +114,7 @@ rqf.addField({
} }
}).addValue({ }).addValue({
name: 'adm_dependency_detailed', name: 'adm_dependency_detailed',
table: 'docente', table: '@',
tableField: 'dependencia_adm_priv', tableField: 'dependencia_adm_priv',
resultField: 'adm_dependency_detailed_id', resultField: 'adm_dependency_detailed_id',
where: { where: {
...@@ -135,7 +135,7 @@ rqf.addField({ ...@@ -135,7 +135,7 @@ rqf.addField({
join: { join: {
primary: 'id', primary: 'id',
foreign: 'escola_regiao_id', foreign: 'escola_regiao_id',
foreignTable: 'docente' foreignTable: '@'
} }
}).addValue({ }).addValue({
name: 'state', name: 'state',
...@@ -150,7 +150,7 @@ rqf.addField({ ...@@ -150,7 +150,7 @@ rqf.addField({
join: { join: {
primary: 'id', primary: 'id',
foreign: 'escola_estado_id', foreign: 'escola_estado_id',
foreignTable: 'docente' foreignTable: '@'
} }
}).addValueToField({ }).addValueToField({
name: 'city', name: 'city',
...@@ -165,7 +165,7 @@ rqf.addField({ ...@@ -165,7 +165,7 @@ rqf.addField({
join: { join: {
primary: 'id', primary: 'id',
foreign: 'escola_municipio_id', foreign: 'escola_municipio_id',
foreignTable: 'docente' foreignTable: '@'
} }
}, 'dims').addValueToField({ }, 'dims').addValueToField({
name: 'city', name: 'city',
...@@ -180,7 +180,7 @@ rqf.addField({ ...@@ -180,7 +180,7 @@ rqf.addField({
join: { join: {
primary: 'id', primary: 'id',
foreign: 'escola_municipio_id', foreign: 'escola_municipio_id',
foreignTable: 'docente' foreignTable: '@'
} }
}, 'filter').addValueToField({ }, 'filter').addValueToField({
name: 'school', name: 'school',
...@@ -329,7 +329,7 @@ employeesApp.get('/', rqf.parse(), (req, res, next) => { ...@@ -329,7 +329,7 @@ employeesApp.get('/', rqf.parse(), (req, res, next) => {
.join('turma', null, 'docente.turma_id=turma.id AND docente.ano_censo=turma.ano_censo') .join('turma', null, 'docente.turma_id=turma.id AND docente.ano_censo=turma.ano_censo')
.group('docente.ano_censo') .group('docente.ano_censo')
.order('docente.ano_censo') .order('docente.ano_censo')
.where('(docente.tipo_docente <= 6) AND (turma.tipo_turma_id <= 3)'); .where('(docente.tipo_docente <= 6) AND (turma.tipo_turma_id <= 3) AND (docente.dependencia_adm_id > 1)');
next(); next();
}, rqf.build(), query, id2str.transform(), (req, res, next) => { }, rqf.build(), query, id2str.transform(), (req, res, 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