fix: simplify query conditions in item managers by removing unnecessary status checks
parent
7bb539db0c
commit
e25ad6500f
|
@ -52,13 +52,12 @@ export class CreateItemManager extends BaseCreateManager<ItemEntity> {
|
|||
? [
|
||||
{
|
||||
column: 'name',
|
||||
query: `(status = '${STATUS.ACTIVE}' AND (${this.tableName}.time_group_id Is Null OR ${this.tableName}.time_group_id = '${timeGroupId}'))`,
|
||||
query: `((${this.tableName}.time_group_id Is Null OR ${this.tableName}.time_group_id = '${timeGroupId}'))`,
|
||||
},
|
||||
]
|
||||
: [
|
||||
{
|
||||
column: 'name',
|
||||
query: `(status = '${STATUS.ACTIVE}')`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ export class UpdateItemManager extends BaseUpdateManager<ItemEntity> {
|
|||
return [
|
||||
{
|
||||
column: 'name',
|
||||
query: `(status = '${STATUS.ACTIVE}' AND (${this.tableName}.time_group_id Is Null OR ${this.tableName}.time_group_id = '${timeGroupId}'))`,
|
||||
query: `((${this.tableName}.time_group_id Is Null OR ${this.tableName}.time_group_id = '${timeGroupId}'))`,
|
||||
},
|
||||
];
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue