From 8079693f19aa12051e0eef1dbc482eeea1d95fd0 Mon Sep 17 00:00:00 2001 From: Bright Date: Thu, 28 Aug 2025 13:32:26 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=97=E0=B8=B0=E0=B9=80=E0=B8=9A=E0=B8=B5?= =?UTF-8?q?=E0=B8=A2=E0=B8=99=E0=B8=9B=E0=B8=A3=E0=B8=B0=E0=B8=A7=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=B4=E0=B8=84=E0=B9=89=E0=B8=99=E0=B8=AB=E0=B8=B2?= =?UTF-8?q?=E0=B8=82=E0=B8=B1=E0=B9=89=E0=B8=99=E0=B8=AA=E0=B8=B9=E0=B8=87?= =?UTF-8?q?=20#1406?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/ReportController.ts | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index cedd3105..d3f947f7 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -32,7 +32,8 @@ import { viewRegistryOfficer } from "../entities/view/viewRegistryOfficer"; import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee"; import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster"; // import { sendWebSocket } from "../services/webSocket"; - +import { Registry } from "../entities/Registry"; +import { RegistryEmployee } from "../entities/RegistryEmployee"; @Route("api/v1/org/report") @Tags("Report") @Security("bearerAuth") @@ -153,8 +154,9 @@ export class ReportController extends Controller { } else if (tenureType != "" && tenureType == "posExecutive") { tenureTypeCondition = "registryOfficer.posExecutiveYears BETWEEN :tenureMin AND :tenureMax"; } - - const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer) + // ดึงผ่าน Table แทน View + // const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer) + const [lists, total] = await AppDataSource.getRepository(Registry) .createQueryBuilder("registryOfficer") .where(nodeCondition, { nodeId: nodeId, @@ -493,8 +495,9 @@ export class ReportController extends Controller { retireLawCondition = "DATE(registryEmployee.dateRetireLaw) >= :startDateRetireLaw AND DATE(registryEmployee.dateRetireLaw) <= :endDateRetireLaw"; } - - const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee) + // ดึงผ่าน Table แทน View + // const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee) + const [lists, total] = await AppDataSource.getRepository(RegistryEmployee) .createQueryBuilder("registryEmployee") .where(nodeCondition, { nodeId: nodeId,