|
@@ -927,8 +927,8 @@ export class DisabledPersonService extends GenericCrudService<DisabledPerson> {
|
|
|
.innerJoin('op.order', 'order')
|
|
.innerJoin('op.order', 'order')
|
|
|
.leftJoin('order.company', 'company');
|
|
.leftJoin('order.company', 'company');
|
|
|
|
|
|
|
|
- // 并集查询逻辑:姓名 OR 身份证号 OR 平台 OR 公司名称
|
|
|
|
|
- const hasUnionFilter = name || idCardParam || platformId || companyName;
|
|
|
|
|
|
|
+ // 并集查询逻辑:姓名 OR 身份证号 OR 平台
|
|
|
|
|
+ const hasUnionFilter = name || idCardParam || platformId;
|
|
|
|
|
|
|
|
if (hasUnionFilter) {
|
|
if (hasUnionFilter) {
|
|
|
const unionConditions: string[] = [];
|
|
const unionConditions: string[] = [];
|
|
@@ -946,16 +946,17 @@ export class DisabledPersonService extends GenericCrudService<DisabledPerson> {
|
|
|
unionConditions.push('order.platformId = :platformId');
|
|
unionConditions.push('order.platformId = :platformId');
|
|
|
parameters.platformId = platformId;
|
|
parameters.platformId = platformId;
|
|
|
}
|
|
}
|
|
|
- if (companyName) {
|
|
|
|
|
- unionConditions.push('company.companyName LIKE :companyName');
|
|
|
|
|
- parameters.companyName = `%${companyName}%`;
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
if (unionConditions.length > 0) {
|
|
if (unionConditions.length > 0) {
|
|
|
queryBuilder.andWhere(`(${unionConditions.join(' OR ')})`, parameters);
|
|
queryBuilder.andWhere(`(${unionConditions.join(' OR ')})`, parameters);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 公司名称筛选:使用 AND 逻辑(独立筛选条件)
|
|
|
|
|
+ if (companyName) {
|
|
|
|
|
+ queryBuilder.andWhere('company.companyName LIKE :companyName', { companyName: `%${companyName}%` });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 其他筛选条件继续使用 AND 逻辑
|
|
// 其他筛选条件继续使用 AND 逻辑
|
|
|
if (gender) {
|
|
if (gender) {
|
|
|
queryBuilder.andWhere('person.gender = :gender', { gender });
|
|
queryBuilder.andWhere('person.gender = :gender', { gender });
|