#857 (9)
This commit is contained in:
parent
d00e64d7df
commit
fe9eca9b33
1 changed files with 16 additions and 3 deletions
|
|
@ -59,6 +59,7 @@ import { RequestWithUser } from "../middlewares/user";
|
|||
import { DevelopmentRisk, UpdateDevelopmentRisk } from "../entities/DevelopmentRisk";
|
||||
import { DevelopmentOther, UpdateDevelopmentOther } from "../entities/DevelopmentOther";
|
||||
import permission from "../interfaces/permission";
|
||||
import { Brackets } from "typeorm";
|
||||
|
||||
@Route("api/v1/development/main")
|
||||
@Tags("Development")
|
||||
|
|
@ -1941,9 +1942,21 @@ export class DevelopmentController extends Controller {
|
|||
.andWhere(status != undefined ? "development.status LIKE :status" : "1=1", {
|
||||
status: `%${status}%`,
|
||||
})
|
||||
.andWhere(keyword != undefined ? "development.projectName LIKE :keyword" : "1=1", {
|
||||
keyword: `%${keyword}%`,
|
||||
})
|
||||
.andWhere(
|
||||
keyword != undefined
|
||||
? new Brackets ((qb) => {
|
||||
qb.where("development.projectName LIKE :keyword")
|
||||
.orWhere("development.root LIKE :keyword")
|
||||
.orWhere("development.child1 LIKE :keyword")
|
||||
.orWhere("development.child2 LIKE :keyword")
|
||||
.orWhere("development.child3 LIKE :keyword")
|
||||
.orWhere("development.child4 LIKE :keyword");
|
||||
})
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${keyword}%`,
|
||||
},
|
||||
)
|
||||
.select([
|
||||
"development.id",
|
||||
"development.projectName",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue