|
|
|
@ -633,6 +633,15 @@ async function generateLookupCondition(
|
|
|
|
|
|
|
|
|
|
qb.select(`${alias}.${childColumn.column_name}`); |
|
|
|
|
|
|
|
|
|
if (filter.comparison_op === 'blank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereNotIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else if (filter.comparison_op === 'notblank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
await nestedConditionJoin( |
|
|
|
|
{ |
|
|
|
|
...filter, |
|
|
|
@ -646,6 +655,7 @@ async function generateLookupCondition(
|
|
|
|
|
alias, |
|
|
|
|
aliasCount |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
if (filter.comparison_op in negatedMapping) |
|
|
|
@ -656,6 +666,15 @@ async function generateLookupCondition(
|
|
|
|
|
qb = knex(`${parentModel.table_name} as ${alias}`); |
|
|
|
|
qb.select(`${alias}.${parentColumn.column_name}`); |
|
|
|
|
|
|
|
|
|
if (filter.comparison_op === 'blank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereNotIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else if (filter.comparison_op === 'notblank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
await nestedConditionJoin( |
|
|
|
|
{ |
|
|
|
|
...filter, |
|
|
|
@ -669,6 +688,7 @@ async function generateLookupCondition(
|
|
|
|
|
alias, |
|
|
|
|
aliasCount |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
if (filter.comparison_op in negatedMapping) |
|
|
|
@ -690,6 +710,15 @@ async function generateLookupCondition(
|
|
|
|
|
`${childAlias}.${parentColumn.column_name}` |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
if (filter.comparison_op === 'blank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereNotIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else if (filter.comparison_op === 'notblank') { |
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
qbP.whereIn(childColumn.column_name, qb); |
|
|
|
|
}; |
|
|
|
|
} else { |
|
|
|
|
await nestedConditionJoin( |
|
|
|
|
{ |
|
|
|
|
...filter, |
|
|
|
@ -703,6 +732,7 @@ async function generateLookupCondition(
|
|
|
|
|
childAlias, |
|
|
|
|
aliasCount |
|
|
|
|
); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return (qbP: Knex.QueryBuilder) => { |
|
|
|
|
if (filter.comparison_op in negatedMapping) |
|
|
|
|