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

Add new filter

parent 14fa10c0
No related branches found
No related tags found
1 merge request!134Transport Indicator
Pipeline #
......@@ -211,6 +211,26 @@ rqf.addField({
type: 'integer',
field: 'etapas_mod_ensino_segmento_id'
}
}).addValue({
name: 'service_type',
table: 'matricula',
tableField: 'tipo',
resultField: 'service_type_id',
where: {
relation: '=',
type: 'integer',
field: 'tipo'
}
}).addValue({
name: 'service_type',
table: 'matricula',
tableField: 'tipo',
resultField: 'service_type_id',
where: {
relation: '=',
type: 'integer',
field: 'tipo'
}
}).addValue({
name: 'min_year',
table: 'matricula',
......@@ -300,6 +320,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.allTransports = req.querySet.push(allTransports) - 1;
// Vans e Kombi
console.log("------------------------------------------------------")
let goVansAndKombi = allTransports.clone();
goVansAndKombi.field('matricula.transporte_vans_kombi','use_transport_id')
goVansAndKombi.where('matricula.transporte_vans_kombi = 1 OR matricula.transporte_vans_kombi = 0');
......@@ -307,6 +328,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goVansAndKombi = req.querySet.push(goVansAndKombi) - 1;
// Micro
console.log("------------------------------------------------------")
let goMicroBus = allTransports.clone();
goMicroBus.field('matricula.transporte_micro_onibus', 'use_transport_id')
goMicroBus.where('matricula.transporte_micro_onibus = 1 OR matricula.transporte_micro_onibus = 0');
......@@ -315,6 +337,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
// Ônibus
console.log("------------------------------------------------------")
let goBus = allTransports.clone();
goBus.field("matricula.transporte_onibus", 'use_transport_id')
goBus.where('matricula.transporte_onibus = 1 OR matricula.transporte_onibus = 0');
......@@ -322,6 +345,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goBus = req.querySet.push(goBus) - 1;
// Bicicleta
console.log("------------------------------------------------------")
let goBikes = allTransports.clone();
goBikes.field('matricula.transporte_bicicleta', 'use_transport_id')
goBikes.where('matricula.transporte_bicicleta = 1 OR matricula.transporte_bicicleta = 0');
......@@ -329,6 +353,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goBikes = req.querySet.push(goBikes) - 1;
// Tração Animal
console.log("------------------------------------------------------")
let goAnimalTraction = allTransports.clone();
goAnimalTraction.field('matricula.transporte_animal', 'use_transport_id')
goAnimalTraction.where('matricula.transporte_animal = 1 OR matricula.transporte_animal = 0');
......@@ -336,6 +361,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goAnimalTraction = req.querySet.push(goAnimalTraction) - 1;
// Outro Veículo
console.log("------------------------------------------------------")
let goOtherVehicle = allTransports.clone();
goOtherVehicle.field('matricula.transporte_outro', 'use_transport_id')
goOtherVehicle.where('matricula.transporte_outro = 1 OR matricula.transporte_outro = 0');
......@@ -343,6 +369,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goOtherVehicle = req.querySet.push(goOtherVehicle) - 1;
// Aquaviário/ Embarcação (capacidade até 5 alunos)
console.log("------------------------------------------------------")
let goWaterway_5_Students = allTransports.clone();
goWaterway_5_Students.field('matricula.transporte_embar_0_5','use_transport_id')
goWaterway_5_Students.where('matricula.transporte_embar_0_5 = 1 OR matricula.transporte_embar_0_5 = 0');
......@@ -350,6 +377,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goWaterway_5_Students = req.querySet.push(goWaterway_5_Students) - 1;
// Aquaviário/ Embarcação (capacidade de 5 até 15 alunos)
console.log("------------------------------------------------------")
let goWaterway_15_Students = allTransports.clone();
goWaterway_15_Students.field('matricula.transporte_embar_5_15', 'use_transport_id')
goWaterway_15_Students.where('matricula.transporte_embar_5_15 = 1 OR matricula.transporte_embar_5_15 = 0');
......@@ -357,6 +385,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goWaterway_15_Students = req.querySet.push(goWaterway_15_Students) - 1;
// Aquaviário/ Embarcação (capacidade de 15 até 35 alunos)r
console.log("------------------------------------------------------")
let goWaterway_35_Students = allTransports.clone();
goWaterway_35_Students.field('matricula.transporte_embar_15_35', 'use_transport_id')
goWaterway_35_Students.where('matricula.transporte_embar_15_35 = 1 OR matricula.transporte_embar_15_35 = 0');
......@@ -364,6 +393,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goWaterway_35_Students = req.querySet.push(goWaterway_35_Students) - 1;
// Aquaviário/ Embarcação (capacidade mais 35 alunos)
console.log("------------------------------------------------------")
let goWaterwayMoreThan_35 = allTransports.clone();
goWaterwayMoreThan_35.field('matricula.transporte_embar_35', 'use_transport_id')
goWaterwayMoreThan_35.where('matricula.transporte_embar_35 = 1 OR matricula.transporte_embar_35 = 0');
......@@ -371,6 +401,7 @@ transportApp.get('/', rqf.parse(), rqf.build(), (req, res, next) => {
req.queryIndex.goWaterwayMoreThan_35 = req.querySet.push(goWaterwayMoreThan_35) - 1;
// Trêm / Metrô
console.log("------------------------------------------------------")
let goSubwayAndTrain = allTransports.clone();
goSubwayAndTrain.field('matricula.transporte_trem_metro', 'use_transport_id')
goSubwayAndTrain.where('matricula.transporte_trem_metro = 1 OR matricula.transporte_trem_metro = 0');
......
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