Skip to content
Snippets Groups Projects
Commit 0325e661 authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Merge branch 'school_number_count' into 'development'

fix range_year

See merge request !48
parents 1b0df3df d479e4ca
No related branches found
No related tags found
2 merge requests!116Release v1.0.0,!48fix range_year
Pipeline #
...@@ -18,6 +18,13 @@ let rqf = new ReqQueryFields(); ...@@ -18,6 +18,13 @@ let rqf = new ReqQueryFields();
let rqfCount = new ReqQueryFields(); let rqfCount = new ReqQueryFields();
// Return location // Return location
schoolApp.get('/year_range', (req, res, next) => {
req.sql.from('escola')
.field('MIN(escola.ano_censo)', 'start_year')
.field('MAX(escola.ano_censo)', 'end_year');
next();
}, query, response('range'));
schoolApp.get('/location', (req, res, next) => { schoolApp.get('/location', (req, res, next) => {
req.result = [ req.result = [
{id: 1, name: 'Urbana'}, {id: 1, name: 'Urbana'},
...@@ -767,6 +774,26 @@ rqfCount.addField({ ...@@ -767,6 +774,26 @@ rqfCount.addField({
condition: 'or', condition: 'or',
field: 'biblioteca_sala_leitura' field: 'biblioteca_sala_leitura'
} }
}).addValue({
name: 'min_year',
table: 'escola',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '>=',
type: 'integer',
field: 'ano_censo'
}
}).addValue({
name: 'max_year',
table: 'escola',
tableField: 'ano_censo',
resultField: 'year',
where: {
relation: '<=',
type: 'integer',
field: 'ano_censo'
}
}); });
// .addValue({ //Using multiple_where // .addValue({ //Using multiple_where
......
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