Merge branch 'develop' into develop-Bright

This commit is contained in:
Bright 2024-10-08 16:35:34 +07:00
commit 3ec5cc7670
2 changed files with 177 additions and 210 deletions

View file

@ -130,18 +130,6 @@ export class CommandController extends Controller {
) {
const [commands, total] = await this.commandRepository
.createQueryBuilder("command")
.andWhere(
new Brackets((qb) => {
qb.where(keyword != null && keyword != "" ? "command.commandNo LIKE :keyword" : "1=1", {
keyword: `%${keyword}%`,
}).orWhere(
keyword != null && keyword != "" ? "command.createdFullName LIKE :keyword" : "1=1",
{
keyword: `%${keyword}%`,
},
);
}),
)
.andWhere(
status != null && status != undefined && status != ""
? "command.status IN (:...status)"
@ -175,6 +163,18 @@ export class CommandController extends Controller {
: `${commandTypeId}`,
},
)
.andWhere(
new Brackets((qb) => {
qb.where(keyword != null && keyword != "" ? "command.commandNo LIKE :keyword" : "1=1", {
keyword: `%${keyword}%`,
}).orWhere(
keyword != null && keyword != "" ? "command.issue LIKE :keyword" : "1=1",
{
keyword: `%${keyword}%`,
},
);
}),
)
.orderBy("command.createdAt", "DESC")
.skip((page - 1) * pageSize)
.take(pageSize)