filter รักษาการ
This commit is contained in:
parent
d9a92eda9d
commit
3ae17c23e2
3 changed files with 52 additions and 80 deletions
|
|
@ -4554,7 +4554,7 @@ export class PositionController extends Controller {
|
|||
) {
|
||||
await new permission().PermissionGet(request, "SYS_ACTING");
|
||||
const posMasterMain = await this.posMasterRepository.findOne({
|
||||
where: { id: body.posmasterId },
|
||||
where: { id: body.posmasterId, posMasterActs: { statusReport: "DONE" } },
|
||||
relations: ["posMasterActs"],
|
||||
});
|
||||
if (posMasterMain == null) {
|
||||
|
|
@ -5050,19 +5050,21 @@ export class PositionController extends Controller {
|
|||
: `CASE WHEN posMaster.orgChild1 is null THEN ${searchShortName0} WHEN posMaster.orgChild2 is null THEN ${searchShortName1} WHEN posMaster.orgChild3 is null THEN ${searchShortName2} WHEN posMaster.orgChild4 is null THEN ${searchShortName3} ELSE ${searchShortName4} END LIKE '%${body.keyword}%'`
|
||||
: "1=1",
|
||||
)
|
||||
.andWhere(checkChildConditions)
|
||||
.andWhere(typeCondition)
|
||||
.andWhere(revisionCondition)
|
||||
.andWhere({ current_holderId: IsNull() });
|
||||
.andWhere(checkChildConditions)
|
||||
.andWhere(typeCondition)
|
||||
.andWhere(revisionCondition)
|
||||
.andWhere({ current_holderId: IsNull() });
|
||||
}),
|
||||
)
|
||||
.orWhere(
|
||||
new Brackets((qb) => {
|
||||
qb.andWhere(`posMaster.conditionReason LIKE '%${body.keyword}%' AND posMaster.conditionReason IS NOT NULL`)
|
||||
.andWhere(checkChildConditions)
|
||||
.andWhere(typeCondition)
|
||||
.andWhere(revisionCondition)
|
||||
.andWhere({ current_holderId: IsNull() });
|
||||
qb.andWhere(
|
||||
`posMaster.conditionReason LIKE '%${body.keyword}%' AND posMaster.conditionReason IS NOT NULL`,
|
||||
)
|
||||
.andWhere(checkChildConditions)
|
||||
.andWhere(typeCondition)
|
||||
.andWhere(revisionCondition)
|
||||
.andWhere({ current_holderId: IsNull() });
|
||||
}),
|
||||
)
|
||||
.orderBy("orgRoot.orgRootOrder", "ASC")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue