no message
This commit is contained in:
parent
80f0a154f9
commit
61c44b8f51
1 changed files with 7 additions and 3 deletions
|
|
@ -405,13 +405,17 @@ export class DevelopmentController extends Controller {
|
|||
async GetDevelopmentLists(
|
||||
@Query("page") page: number = 1,
|
||||
@Query("pageSize") pageSize: number = 10,
|
||||
@Query("year") year: number,
|
||||
@Query("keyword") keyword?: string,
|
||||
@Query("year") year?: number,
|
||||
) {
|
||||
const [development, total] = await AppDataSource.getRepository(Development)
|
||||
.createQueryBuilder("development")
|
||||
.andWhere(year == null ? "development.year LIKE :year" : "1=1", { year: `${year}` })
|
||||
.orWhere("development.projectName LIKE :keyword", { keyword: `${keyword}` })
|
||||
.andWhere(year > 0 ? "development.year LIKE :year" : "1=1", {
|
||||
year: `${year.toString()}`,
|
||||
})
|
||||
.andWhere(keyword != undefined ? "development.projectName LIKE :keyword" : "1=1", {
|
||||
keyword: `%${keyword}%`,
|
||||
})
|
||||
.select(["development.id", "development.projectName", "development.year"])
|
||||
.orderBy("development.year", "DESC")
|
||||
.orderBy("development.createdAt", "DESC")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue