fix: simplify query conditions in item managers by removing unnecessary status checks

pull/162/head
shancheas 2025-06-26 11:26:55 +07:00
parent 7bb539db0c
commit e25ad6500f
2 changed files with 2 additions and 3 deletions

View File

@ -52,13 +52,12 @@ export class CreateItemManager extends BaseCreateManager<ItemEntity> {
? [ ? [
{ {
column: 'name', 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', column: 'name',
query: `(status = '${STATUS.ACTIVE}')`,
}, },
]; ];
} }

View File

@ -62,7 +62,7 @@ export class UpdateItemManager extends BaseUpdateManager<ItemEntity> {
return [ return [
{ {
column: 'name', 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}'))`,
}, },
]; ];
} }