diff --git a/src/libs/routes/school.js b/src/libs/routes/school.js index 830697742406491451539276261c468cc4024f04..3f4dd7141f6ce4c374969f37aaa5ee5335ee3498 100644 --- a/src/libs/routes/school.js +++ b/src/libs/routes/school.js @@ -60,6 +60,18 @@ schoolApp.get('/location', cache('15 day'), (req, res, next) => { next(); }, response('location')); +schoolApp.get('/rural_location', cache('15 day'), (req, res, next) => { + req.result = [ + {id: 1, name: "Urbana"}, + {id: 2, name: "Rural"}, + {id: 3, name: "Rural - Ãrea de assentamento"}, + {id: 4, name: "Rural - Terra indÃgena"}, + {id: 5, name: "Rural - Ãrea remanescente de quilombos"}, + {id: 6, name: "Rural - Unidade de uso sustentável"} + ]; + next(); +}, response('rural_location')); + schoolApp.get('/adm_dependency', (req, res, next) => { req.result = []; for(let i = 1; i <= 4; ++i) { @@ -359,6 +371,16 @@ rqfCount.addField({ type: 'integer', field: 'cod_localizacao' } +}).addValue({ + name: 'rural_location', + table: 'escola', + tableField: 'localidade_area_rural', + resultField: 'rural_location_id', + where: { + relation: '=', + type: 'integer', + field: 'localidade_area_rural' + } }).addValue({ name: 'adm_dependency', table: 'escola', @@ -402,52 +424,52 @@ rqfCount.addField({ }).addValue({ name: 'education_day_care_child', table: 'escola', - tableField: 'reg_infantil_creche', + tableField: 'reg_infantil_creche_t1', resultField: 'education_day_care_child_id', where: { relation: '=', type: 'boolean', - field: 'reg_infantil_creche' + field: 'reg_infantil_creche_t1' } }).addValue({ name: 'education_preschool_child', table: 'escola', - tableField: 'reg_infantil_preescola', + tableField: 'reg_infantil_preescola_t1', resultField: 'education_preschool_child_id', where: { relation: '=', type: 'boolean', - field: 'reg_infantil_preescola' + field: 'reg_infantil_preescola_t1' } }).addValue({ name: 'education_begin_elementary_school', table: 'escola', - tableField: 'reg_fund_ai', + tableField: 'reg_fund_ai_t1', resultField: 'education_begin_elementary_school_id', where: { relation: '=', type: 'boolean', - field: 'reg_fund_ai' + field: 'reg_fund_ai_t1' } }).addValue({ name: 'education_end_elementary_school', table: 'escola', - tableField: 'reg_fund_af', + tableField: 'reg_fund_af_t1', resultField: 'education_end_elementary_school_id', where: { relation: '=', type: 'boolean', - field: 'reg_fund_af' + field: 'reg_fund_af_t1' } }).addValue({ name: 'education_middle_school', table: 'escola', - tableField: 'reg_medio_medio', + tableField: 'reg_medio_medio_t1', resultField: 'education_middle_school_id', where: { relation: '=', type: 'boolean', - field: 'reg_medio_medio' + field: 'reg_medio_medio_t1' } }).addValue({ name: 'education_professional',