check query

This commit is contained in:
AdisakKanthawilang 2024-02-20 15:21:26 +07:00
parent ac36b37612
commit f4305c895e

View file

@ -36,7 +36,7 @@ import { Position } from "../entities/Position";
import { Profile } from "../entities/Profile";
@Route("api/v1/org/pos")
@Tags("Position")
// @Security("bearerAuth")
@Security("bearerAuth")
@Response(
HttpStatusCode.INTERNAL_SERVER_ERROR,
"เกิดข้อผิดพลาด ไม่สามารถแสดงรายการได้ กรุณาลองใหม่ในภายหลัง",
@ -992,7 +992,13 @@ export class PositionController extends Controller {
.leftJoinAndSelect("posMaster.current_holder", "current_holder")
.leftJoinAndSelect("posMaster.next_holder", "next_holder")
.where(conditions)
.orWhere(searchShortName)
.orWhere(
new Brackets((qb) => {
qb.where(searchShortName)
.andWhere(checkChildConditions)
.andWhere(typeCondition)
}),
)
.orWhere(
new Brackets((qb) => {
qb.where(
@ -1004,7 +1010,7 @@ export class PositionController extends Controller {
},
)
.andWhere(checkChildConditions)
.andWhere(typeCondition);
.andWhere(typeCondition)
}),
)
.orderBy("posMaster.posMasterOrder", "ASC")