searh report position

This commit is contained in:
kittapath 2025-03-07 11:15:50 +07:00
parent 504d0ca1b3
commit cf13eb6598
2 changed files with 174 additions and 130 deletions

View file

@ -290,38 +290,36 @@ export class ReportController extends Controller {
})
.andWhere(IsLeavecondition.join(" AND "), parameters)
.andWhere(
posType != null && posType != "" ? "registryOfficer.posTypeName LIKE :posTypeName" : "1=1",
posType != null && posType != "" ? "registryOfficer.posTypeName = :posTypeName" : "1=1",
{
posTypeName: `%${posType}%`,
},
)
.andWhere(
posLevel != null && posLevel != ""
? "registryOfficer.posLevelName LIKE :posLevelName"
: "1=1",
posLevel != null && posLevel != "" ? "registryOfficer.posLevelName = :posLevelName" : "1=1",
{
posLevelName: `%${posLevel}%`,
},
)
.andWhere(
position != null && position != "" ? "registryOfficer.position LIKE :position" : "1=1",
position != null && position != "" ? "registryOfficer.position = :position" : "1=1",
{
position: `%${position}%`,
},
)
.andWhere(
positionExecutive != null && positionExecutive != ""
? "registryOfficer.posExecutiveName LIKE :posExecutiveName"
? "registryOfficer.posExecutiveName = :posExecutiveName"
: "1=1",
{
posExecutiveName: `%${positionExecutive}%`,
},
)
.andWhere(gender != null && gender != "" ? "registryOfficer.gender LIKE :gender" : "1=1", {
.andWhere(gender != null && gender != "" ? "registryOfficer.gender = :gender" : "1=1", {
gender: `%${gender}%`,
})
.andWhere(
status != null && status != "" ? "registryOfficer.relationship LIKE :relationship" : "1=1",
status != null && status != "" ? "registryOfficer.relationship = :relationship" : "1=1",
{
relationship: `%${status}%`,
},
@ -3537,7 +3535,7 @@ export class ReportController extends Controller {
}
}
}
return new HttpSuccess({ template: "report2", reportName: "report2", data: { data } });
}