filter ประวัติหน่วยงาน

This commit is contained in:
Kittapath 2024-04-18 14:28:26 +07:00
parent 9b0b51ea36
commit e8094726f0
2 changed files with 12 additions and 4 deletions

View file

@ -238,7 +238,12 @@ export class DevelopmentEmployeeHistoryController extends Controller {
: "1=1",
{ year: body.year },
)
.andWhere(body.root != null ? "developmentHistory.root = :root" : "1=1", { root: body.root })
.andWhere(
body.root != null && body.root != undefined ? "developmentHistory.rootId = :root" : "1=1",
{
root: body.root,
},
)
.andWhere("developmentHistory.type = :type", { type: type })
.andWhere(
new Brackets((qb) => {

View file

@ -230,9 +230,12 @@ export class DevelopmentOfficerHistoryController extends Controller {
: "1=1",
{ year: body.year },
)
.andWhere(body.root != null && body.root != undefined ? "development.root = :root" : "1=1", {
root: body.root,
})
.andWhere(
body.root != null && body.root != undefined ? "development.rootId = :root" : "1=1",
{
root: body.root,
},
)
.andWhere(body.root != null ? "developmentHistory.root = :root" : "1=1", { root: body.root })
.andWhere("developmentHistory.type = :type", { type: type })
.andWhere(