no message

This commit is contained in:
Kittapath 2024-04-03 17:32:11 +07:00
parent 80f0a154f9
commit 61c44b8f51

View file

@ -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")