ทะเบียนประวัติค้นหาขั้นสูง #1406

This commit is contained in:
Bright 2025-08-28 13:32:26 +07:00
parent 8d010cd389
commit 8079693f19

View file

@ -32,7 +32,8 @@ import { viewRegistryOfficer } from "../entities/view/viewRegistryOfficer";
import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee"; import { viewRegistryEmployee } from "../entities/view/viewRegistryEmployee";
import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster"; import { EmployeeTempPosMaster } from "../entities/EmployeeTempPosMaster";
// import { sendWebSocket } from "../services/webSocket"; // import { sendWebSocket } from "../services/webSocket";
import { Registry } from "../entities/Registry";
import { RegistryEmployee } from "../entities/RegistryEmployee";
@Route("api/v1/org/report") @Route("api/v1/org/report")
@Tags("Report") @Tags("Report")
@Security("bearerAuth") @Security("bearerAuth")
@ -153,8 +154,9 @@ export class ReportController extends Controller {
} else if (tenureType != "" && tenureType == "posExecutive") { } else if (tenureType != "" && tenureType == "posExecutive") {
tenureTypeCondition = "registryOfficer.posExecutiveYears BETWEEN :tenureMin AND :tenureMax"; tenureTypeCondition = "registryOfficer.posExecutiveYears BETWEEN :tenureMin AND :tenureMax";
} }
// ดึงผ่าน Table แทน View
const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer) // const [lists, total] = await AppDataSource.getRepository(viewRegistryOfficer)
const [lists, total] = await AppDataSource.getRepository(Registry)
.createQueryBuilder("registryOfficer") .createQueryBuilder("registryOfficer")
.where(nodeCondition, { .where(nodeCondition, {
nodeId: nodeId, nodeId: nodeId,
@ -493,8 +495,9 @@ export class ReportController extends Controller {
retireLawCondition = retireLawCondition =
"DATE(registryEmployee.dateRetireLaw) >= :startDateRetireLaw AND DATE(registryEmployee.dateRetireLaw) <= :endDateRetireLaw"; "DATE(registryEmployee.dateRetireLaw) >= :startDateRetireLaw AND DATE(registryEmployee.dateRetireLaw) <= :endDateRetireLaw";
} }
// ดึงผ่าน Table แทน View
const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee) // const [lists, total] = await AppDataSource.getRepository(viewRegistryEmployee)
const [lists, total] = await AppDataSource.getRepository(RegistryEmployee)
.createQueryBuilder("registryEmployee") .createQueryBuilder("registryEmployee")
.where(nodeCondition, { .where(nodeCondition, {
nodeId: nodeId, nodeId: nodeId,