This commit is contained in:
Bright 2025-06-05 15:47:42 +07:00
parent 89db77098e
commit d3e31eaf14

View file

@ -2682,7 +2682,7 @@ export class ProfileEmployeeController extends Controller {
} else if (node === 4 && nodeId) { } else if (node === 4 && nodeId) {
orgChild4 = await this.child4Repository.findOne({ where: { id: nodeId } }); orgChild4 = await this.child4Repository.findOne({ where: { id: nodeId } });
if (orgChild4) { if (orgChild4) {
nodeCondition = "profileSalary.orgChild4Id = :nodeId"; nodeCondition = "profileSalary.orgChild4 = :orgChild4";
} }
} }
nodeCondition = nodeCondition + nodeAll; nodeCondition = nodeCondition + nodeAll;
@ -2690,31 +2690,31 @@ export class ProfileEmployeeController extends Controller {
if (_data.root) { if (_data.root) {
orgRootPms = await this.orgRootRepository.findOne({ where: { id: _data.root } }); orgRootPms = await this.orgRootRepository.findOne({ where: { id: _data.root } });
if (orgRootPms) { if (orgRootPms) {
pmsCondition = "profileSalary.orgRoot = :orgRoot"; pmsCondition = "profileSalary.orgRoot = :orgRootPms";
} }
if (isAll == false) nodeAll = " AND profileSalary.orgChild1 IS NULL"; if (isAll == false) nodeAll = " AND profileSalary.orgChild1 IS NULL";
} else if (_data.child1) { } else if (_data.child1) {
orgChild1Pms = await this.child1Repository.findOne({ where: { id: _data.child1 } }); orgChild1Pms = await this.child1Repository.findOne({ where: { id: _data.child1 } });
if (orgChild1Pms) { if (orgChild1Pms) {
pmsCondition = "profileSalary.orgChild1 = :orgChild1"; pmsCondition = "profileSalary.orgChild1 = :orgChild1Pms";
} }
if (isAll == false) nodeAll = " AND profileSalary.orgChild2 IS NULL"; if (isAll == false) nodeAll = " AND profileSalary.orgChild2 IS NULL";
} else if (_data.child2) { } else if (_data.child2) {
orgChild2Pms = await this.child2Repository.findOne({ where: { id: _data.child2 } }); orgChild2Pms = await this.child2Repository.findOne({ where: { id: _data.child2 } });
if (orgChild2Pms) { if (orgChild2Pms) {
pmsCondition = "profileSalary.orgChild2 = :orgChild2"; pmsCondition = "profileSalary.orgChild2 = :orgChild2Pms";
} }
if (isAll == false) nodeAll = " AND profileSalary.orgChild3 IS NULL"; if (isAll == false) nodeAll = " AND profileSalary.orgChild3 IS NULL";
} else if (_data.child3) { } else if (_data.child3) {
orgChild3Pms = await this.child3Repository.findOne({ where: { id: _data.child3 } }); orgChild3Pms = await this.child3Repository.findOne({ where: { id: _data.child3 } });
if (orgChild3Pms) { if (orgChild3Pms) {
pmsCondition = "profileSalary.orgChild3 = :orgChild3"; pmsCondition = "profileSalary.orgChild3 = :orgChild3Pms";
} }
if (isAll == false) nodeAll = " AND profileSalary.orgChild4 IS NULL"; if (isAll == false) nodeAll = " AND profileSalary.orgChild4 IS NULL";
} else if (_data.child4) { } else if (_data.child4) {
orgChild4Pms = await this.child4Repository.findOne({ where: { id: _data.child4 } }); orgChild4Pms = await this.child4Repository.findOne({ where: { id: _data.child4 } });
if (orgChild4Pms) { if (orgChild4Pms) {
pmsCondition = "profileSalary.orgChild4 = :orgChild4"; pmsCondition = "profileSalary.orgChild4 = :orgChild4Pms";
} }
} }
pmsCondition = pmsCondition + nodeAll; pmsCondition = pmsCondition + nodeAll;