Skip to content

Commit

Permalink
Merge remote-tracking branch 'SinergiaDA/SDA#56'
Browse files Browse the repository at this point in the history
  • Loading branch information
jortilles committed Feb 9, 2024
2 parents 7c4aa2f + e78a152 commit 382d469
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,6 @@ export class MySqlBuilderService extends QueryBuilderService {
*/
public getFilterColname(column: any){
let colname:String ;
console.log('la columna es ')
console.log(column);
if( column.computed_column == 'no' || ! column.hasOwnProperty('computed_column') ){
colname = `\`${column.table_id}\`.\`${column.column_name}\`` ;
}else{
Expand Down
18 changes: 15 additions & 3 deletions eda/eda_api/lib/services/query-builder/query-builder.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -876,11 +876,23 @@ export abstract class QueryBuilderService {

equalfilters.map.forEach((value, key) => {
let filterSTR = '\nand ('
value.forEach(f => {
filterSTR += this.filterToString(f) + '\n or ';

//poso els nulls al principi
let n = value.filter( f=> f.filter_type == 'not_null');
let values = [...n, ...value.filter( f=> f.filter_type != 'not_null')];

values.forEach(f => {
if(f.filter_type == 'not_null'){
//Fins que no es pugi determinar el tipus de conjunció. Els filtres sobre una mateixa columna es un or perque vull dos grups. EXCEPTE QUAN ES UN NULL
filterSTR += this.filterToString(f ) + '\n and ';
}else{
filterSTR += this.filterToString(f ) + '\n or ';
}


});

filterSTR = filterSTR.slice(0, -3);
filterSTR = filterSTR.slice(0, -4);
filterSTR += ') ';
filtersString += filterSTR;
});
Expand Down

0 comments on commit 382d469

Please sign in to comment.