#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 { DevelopmentRisk, UpdateDevelopmentRisk } from "../entities/DevelopmentRisk";
|
||||||
import { DevelopmentOther, UpdateDevelopmentOther } from "../entities/DevelopmentOther";
|
import { DevelopmentOther, UpdateDevelopmentOther } from "../entities/DevelopmentOther";
|
||||||
import permission from "../interfaces/permission";
|
import permission from "../interfaces/permission";
|
||||||
|
import { Brackets } from "typeorm";
|
||||||
|
|
||||||
@Route("api/v1/development/main")
|
@Route("api/v1/development/main")
|
||||||
@Tags("Development")
|
@Tags("Development")
|
||||||
|
|
@ -1941,9 +1942,21 @@ export class DevelopmentController extends Controller {
|
||||||
.andWhere(status != undefined ? "development.status LIKE :status" : "1=1", {
|
.andWhere(status != undefined ? "development.status LIKE :status" : "1=1", {
|
||||||
status: `%${status}%`,
|
status: `%${status}%`,
|
||||||
})
|
})
|
||||||
.andWhere(keyword != undefined ? "development.projectName LIKE :keyword" : "1=1", {
|
.andWhere(
|
||||||
keyword: `%${keyword}%`,
|
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([
|
.select([
|
||||||
"development.id",
|
"development.id",
|
||||||
"development.projectName",
|
"development.projectName",
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue