From 7f7b67675051f833ff6a82b8fb6fea751b6f0898 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Fri, 26 Apr 2024 17:39:24 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=84=E0=B8=AD=E0=B8=A1=E0=B9=80=E0=B8=A1?= =?UTF-8?q?=E0=B9=89=E0=B8=99=E0=B8=9C=E0=B8=B9=E0=B9=89=E0=B8=9A=E0=B8=B1?= =?UTF-8?q?=E0=B8=87=E0=B8=84=E0=B8=B1=E0=B8=9A=E0=B8=9A=E0=B8=B1=E0=B8=8D?= =?UTF-8?q?=E0=B8=8A=E0=B8=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/KpiPlanController.ts | 9 ++ src/controllers/KpiRoleController.ts | 9 ++ .../KpiUserEvaluationController.ts | 104 +++++++++++++++++- src/entities/kpiUserEvaluation.ts | 66 +++++++++-- src/entities/kpiUserEvaluationReason.ts | 56 ++++++++++ ...update_table_kpiUserEvalution_add_point.ts | 20 ++++ ...pdate_table_kpiUserEvalution_add_point1.ts | 18 +++ ...pdate_table_kpiUserEvalution_add_point2.ts | 18 +++ ...pdate_table_kpiUserEvalution_add_point3.ts | 28 +++++ 9 files changed, 318 insertions(+), 10 deletions(-) create mode 100644 src/entities/kpiUserEvaluationReason.ts create mode 100644 src/migration/1714125247489-update_table_kpiUserEvalution_add_point.ts create mode 100644 src/migration/1714125714200-update_table_kpiUserEvalution_add_point1.ts create mode 100644 src/migration/1714126663201-update_table_kpiUserEvalution_add_point2.ts create mode 100644 src/migration/1714127671110-update_table_kpiUserEvalution_add_point3.ts diff --git a/src/controllers/KpiPlanController.ts b/src/controllers/KpiPlanController.ts index fdefa3f..adb7ad3 100644 --- a/src/controllers/KpiPlanController.ts +++ b/src/controllers/KpiPlanController.ts @@ -22,6 +22,7 @@ import HttpStatusCode from "../interfaces/http-status"; import { KpiPlan, createKpiPlan, updateKpiPlan } from "../entities/kpiPlan"; import CallAPI from "../interfaces/call-api"; import { KpiPeriod } from "../entities/kpiPeriod"; +import { Brackets } from "typeorm"; @Route("api/v1/kpi/plan") @Tags("kpiPlan") @@ -320,6 +321,14 @@ export class kpiPlanController extends Controller { kpiPeriodId: kpiPeriodId, }, ) + .andWhere( + new Brackets((qb) => { + qb.orWhere("kpiPlan.including LIKE :keyword", { keyword: `%${keyword}%` }).orWhere( + "kpiPlan.includingName LIKE :keyword", + { keyword: `%${keyword}%` }, + ); + }), + ) .select([ "kpiPlan.id", "kpiPeriod.year", diff --git a/src/controllers/KpiRoleController.ts b/src/controllers/KpiRoleController.ts index 21d4254..8269e9b 100644 --- a/src/controllers/KpiRoleController.ts +++ b/src/controllers/KpiRoleController.ts @@ -22,6 +22,7 @@ import HttpStatusCode from "../interfaces/http-status"; import { KpiRole, createKpiRole, updateKpiRole } from "../entities/kpiRole"; import CallAPI from "../interfaces/call-api"; import { KpiPeriod } from "../entities/kpiPeriod"; +import { Brackets } from "typeorm"; @Route("api/v1/kpi/role") @Tags("kpiRole") @@ -257,6 +258,14 @@ export class kpiRoleController extends Controller { .andWhere(position != undefined ? "kpiRole.position LIKE :position" : "1=1", { position: `%${position}%`, }) + .andWhere( + new Brackets((qb) => { + qb.orWhere("kpiRole.including LIKE :keyword", { keyword: `%${keyword}%` }).orWhere( + "kpiRole.includingName LIKE :keyword", + { keyword: `%${keyword}%` }, + ); + }), + ) .select([ "kpiRole.id", "kpiPeriod.year", diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index c988b61..db4c298 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -26,9 +26,14 @@ import { createKpiUserEvaluation, updateKpiUserCheckEvaluation, updateKpiUserEvaluation, + updateKpiUserPointEvaluation, } from "../entities/kpiUserEvaluation"; -import { Like, In } from "typeorm"; +import { Like, In, Brackets } from "typeorm"; import CallAPI from "../interfaces/call-api"; +import { + KpiUserEvaluationReason, + updateKpiUserReasonEvaluation, +} from "../entities/kpiUserEvaluationReason"; @Route("api/v1/kpi/user/evaluation") @Tags("kpiUserEvaluation") @@ -41,6 +46,7 @@ import CallAPI from "../interfaces/call-api"; export class KpiUserEvaluationController extends Controller { private kpiPeriodRepository = AppDataSource.getRepository(KpiPeriod); private kpiUserEvalutionRepository = AppDataSource.getRepository(KpiUserEvaluation); + private kpiUserEvaluationReasonRepository = AppDataSource.getRepository(KpiUserEvaluationReason); /** * API @@ -53,13 +59,20 @@ export class KpiUserEvaluationController extends Controller { @Query("page") page: number = 1, @Query("pageSize") pageSize: number = 10, @Query("kpiPeriodId") kpiPeriodId?: string, - // @Query("keyword") keyword?: string, + @Query("keyword") keyword?: string, ) { const [kpiUserEvaluation, total] = await AppDataSource.getRepository(KpiUserEvaluation) .createQueryBuilder("kpiUserEvaluation") .andWhere(kpiPeriodId ? "kpiPeriodId LIKE :kpiPeriodId" : "1=1", { kpiPeriodId: kpiPeriodId, }) + .andWhere( + new Brackets((qb) => { + qb.orWhere("kpiUserEvaluation.prefix LIKE :keyword", { keyword: `%${keyword}%` }) + .orWhere("kpiUserEvaluation.firstName LIKE :keyword", { keyword: `%${keyword}%` }) + .orWhere("kpiUserEvaluation.lastName LIKE :keyword", { keyword: `%${keyword}%` }); + }), + ) .orderBy("kpiUserEvaluation.createdAt", "ASC") .skip((page - 1) * pageSize) .take(pageSize) @@ -153,6 +166,85 @@ export class KpiUserEvaluationController extends Controller { return new HttpSuccess(kpiUserEvaluation.id); } + /** + * API แก้ไขคนประเมิน (USER) + * + * @summary แก้ไขคนประเมิน (USER) + * + * @param {string} id Guid, *Id คนประเมิน (USER) + */ + @Put("point/{id}") + async updateKpiUserPointEvaluation( + @Path() id: string, + @Body() requestBody: updateKpiUserPointEvaluation, + @Request() request: { user: Record }, + ) { + const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({ + where: { id: id }, + }); + if (!kpiUserEvaluation) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้", + ); + } + kpiUserEvaluation.lastUpdateUserId = request.user.sub; + kpiUserEvaluation.lastUpdateFullName = request.user.name; + Object.assign(kpiUserEvaluation, requestBody); + await this.kpiUserEvalutionRepository.save(kpiUserEvaluation); + return new HttpSuccess(kpiUserEvaluation.id); + } + + /** + * API แก้ไขหมายเหตุ (USER) + * + * @summary แก้ไขหมายเหตุ (USER) + * + * @param {string} id Guid, *Id คนประเมิน (USER) + */ + @Put("{type}/{id}") + async updateKpiUserEvaluatorEvaluation( + @Path() id: string, + @Path() type: string, + @Body() requestBody: updateKpiUserReasonEvaluation, + @Request() request: { user: Record }, + ) { + const kpiUserEvaluation = await this.kpiUserEvalutionRepository.findOne({ + where: { id: id }, + }); + if (!kpiUserEvaluation) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลรายการประเมินผลการปฏิบัติราชการระดับบุคคลนี้", + ); + } + + const kpiUserEvaluationReason = Object.assign(new KpiUserEvaluationReason(), requestBody); + kpiUserEvaluationReason.type = type.trim().toUpperCase(); + kpiUserEvaluationReason.kpiUserEvaluationId = id; + kpiUserEvaluationReason.createdUserId = request.user.sub; + kpiUserEvaluationReason.createdFullName = request.user.name; + kpiUserEvaluationReason.lastUpdateUserId = request.user.sub; + kpiUserEvaluationReason.lastUpdateFullName = request.user.name; + await this.kpiUserEvaluationReasonRepository.save(kpiUserEvaluationReason); + return new HttpSuccess(kpiUserEvaluation.id); + } + + /** + * API list หมายเหตุ (USER) + * + * @summary list หมายเหตุ (USER) + * + * @param {string} id Guid, *Id คนประเมิน (USER) + */ + @Get("{type}/{id}") + async listKpiUserCommanderEvaluation(@Path() id: string, @Path() type: string) { + const kpiUserEvaluationReason = await this.kpiUserEvaluationReasonRepository.find({ + where: { kpiUserEvaluationId: id, type: type.trim().toUpperCase() }, + }); + return new HttpSuccess(kpiUserEvaluationReason); + } + /** * API แก้ไขรายการประเมินผลการปฏิบัติราชการระดับบุคคล (USER) * @@ -217,6 +309,10 @@ export class KpiUserEvaluationController extends Controller { "evaluatorId", "commanderId", "commanderHighId", + "plannedPoint", + "rolePoint", + "specialPoint", + "capacityPoint", ], }); if (!kpiUserEvaluation) { @@ -264,6 +360,10 @@ export class KpiUserEvaluationController extends Controller { commanderId: item.commanderId, commanderHighId: item.commanderHighId, createdAt: item.createdAt, + plannedPoint: item.plannedPoint, + rolePoint: item.rolePoint, + specialPoint: item.specialPoint, + capacityPoint: item.capacityPoint, })); return new HttpSuccess({ data: mapData, total }); } diff --git a/src/entities/kpiUserEvaluation.ts b/src/entities/kpiUserEvaluation.ts index d964c34..1e2e6af 100644 --- a/src/entities/kpiUserEvaluation.ts +++ b/src/entities/kpiUserEvaluation.ts @@ -5,6 +5,7 @@ import { KpiUserSpecial } from "./kpiUserSpecial"; import { KpiUserRole } from "./kpiUserRole"; import { KpiUserPlanned } from "./kpiUserPlanned"; import { KpiUserCapacity } from "./kpiUserCapacity"; +import { KpiUserEvaluationReason } from "./kpiUserEvaluationReason"; @Entity("kpiUserEvaluation") export class KpiUserEvaluation extends EntityBase { @Column({ @@ -31,14 +32,6 @@ export class KpiUserEvaluation extends EntityBase { }) lastName: string; - @Column({ - nullable: true, - length: 40, - comment: "คีย์นอก(FK)ของตาราง kpiPeriodId", - default: null, - }) - kpiPeriodId: string; - @Column({ nullable: true, length: 40, @@ -91,6 +84,46 @@ export class KpiUserEvaluation extends EntityBase { }) evaluationResults: string; + @Column({ + type: "double", + nullable: true, + default: null, + comment: "งานตามแผนปฏิบัติราชการประจำปี ร้อยละ", + }) + plannedPoint: number; + + @Column({ + type: "double", + nullable: true, + default: null, + comment: "งานตามหน้าที่ความรับผิดชอบหลัก ร้อยละ", + }) + rolePoint: number; + + @Column({ + type: "double", + nullable: true, + default: null, + comment: "งานที่ได้รับมอบหมายพิเศษ ร้อยละ", + }) + specialPoint: number; + + @Column({ + type: "double", + nullable: true, + default: null, + comment: "สมรรถนะ ร้อยละ", + }) + capacityPoint: number; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiPeriodId", + default: null, + }) + kpiPeriodId: string; + @ManyToOne(() => KpiPeriod, (kpiPeriod) => kpiPeriod.kpiUserEvaluations) @JoinColumn({ name: "kpiPeriodId" }) kpiPeriod: KpiPeriod; @@ -106,6 +139,12 @@ export class KpiUserEvaluation extends EntityBase { @OneToMany(() => KpiUserSpecial, (kpiUserSpecial) => kpiUserSpecial.kpiUserEvaluation) kpiUserSpecials: KpiUserSpecial[]; + + @OneToMany( + () => KpiUserEvaluationReason, + (kpiUserEvaluationReason) => kpiUserEvaluationReason.kpiUserEvaluation, + ) + kpiUserEvaluationReasons: KpiUserEvaluationReason[]; } export class createKpiUserEvaluation { @@ -148,3 +187,14 @@ export class updateKpiUserCheckEvaluation { @Column() commanderHighId: string | null; } + +export class updateKpiUserPointEvaluation { + @Column() + plannedPoint: number | null; + @Column() + rolePoint: number | null; + @Column() + specialPoint: number | null; + @Column() + capacityPoint: number | null; +} diff --git a/src/entities/kpiUserEvaluationReason.ts b/src/entities/kpiUserEvaluationReason.ts new file mode 100644 index 0000000..94e545b --- /dev/null +++ b/src/entities/kpiUserEvaluationReason.ts @@ -0,0 +1,56 @@ +import { Entity, Column, OneToMany, ManyToOne, JoinColumn } from "typeorm"; +import { EntityBase } from "./base/Base"; +import { KpiPeriod } from "./kpiPeriod"; +import { KpiUserSpecial } from "./kpiUserSpecial"; +import { KpiUserRole } from "./kpiUserRole"; +import { KpiUserPlanned } from "./kpiUserPlanned"; +import { KpiUserCapacity } from "./kpiUserCapacity"; +import { KpiUserEvaluation } from "./kpiUserEvaluation"; +@Entity("kpiUserEvaluationReason") +export class KpiUserEvaluationReason extends EntityBase { + @Column({ + nullable: true, + comment: "หมายเหตุ", + length: 255, + default: null, + }) + reason: string; + + @Column({ + nullable: true, + comment: "หัวข้อ", + length: 255, + default: null, + }) + topic: string; + + @Column({ + nullable: true, + comment: "ประเภท", + length: 255, + default: null, + }) + type: string; + + @Column({ + nullable: true, + length: 40, + comment: "คีย์นอก(FK)ของตาราง kpiPeriodId", + default: null, + }) + kpiUserEvaluationId: string; + + @ManyToOne( + () => KpiUserEvaluation, + (kpiUserEvaluation) => kpiUserEvaluation.kpiUserEvaluationReasons, + ) + @JoinColumn({ name: "kpiUserEvaluationId" }) + kpiUserEvaluation: KpiUserEvaluation; +} + +export class updateKpiUserReasonEvaluation { + @Column() + reason: string | null; + @Column() + topic: string | null; +} diff --git a/src/migration/1714125247489-update_table_kpiUserEvalution_add_point.ts b/src/migration/1714125247489-update_table_kpiUserEvalution_add_point.ts new file mode 100644 index 0000000..eba1874 --- /dev/null +++ b/src/migration/1714125247489-update_table_kpiUserEvalution_add_point.ts @@ -0,0 +1,20 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvalutionAddPoint1714125247489 implements MigrationInterface { + name = 'UpdateTableKpiUserEvalutionAddPoint1714125247489' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`plannedPoint\` double NULL COMMENT 'งานตามแผนปฏิบัติราชการประจำปี ร้อยละ'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`rolePoint\` double NULL COMMENT 'งานตามหน้าที่ความรับผิดชอบหลัก ร้อยละ'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`specialPoint\` double NULL COMMENT 'งานที่ได้รับมอบหมายพิเศษ ร้อยละ'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`capacityPoint\` double NULL COMMENT 'สมรรถนะ ร้อยละ'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`capacityPoint\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`specialPoint\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`rolePoint\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`plannedPoint\``); + } + +} diff --git a/src/migration/1714125714200-update_table_kpiUserEvalution_add_point1.ts b/src/migration/1714125714200-update_table_kpiUserEvalution_add_point1.ts new file mode 100644 index 0000000..a4eba0e --- /dev/null +++ b/src/migration/1714125714200-update_table_kpiUserEvalution_add_point1.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvalutionAddPoint11714125714200 implements MigrationInterface { + name = 'UpdateTableKpiUserEvalutionAddPoint11714125714200' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`evaluatorReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้ประเมิน'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้บังคับบัญชาเหนือขึ้นไป'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderHighReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderHighReason\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderReason\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`evaluatorReason\``); + } + +} diff --git a/src/migration/1714126663201-update_table_kpiUserEvalution_add_point2.ts b/src/migration/1714126663201-update_table_kpiUserEvalution_add_point2.ts new file mode 100644 index 0000000..6ffc99d --- /dev/null +++ b/src/migration/1714126663201-update_table_kpiUserEvalution_add_point2.ts @@ -0,0 +1,18 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvalutionAddPoint21714126663201 implements MigrationInterface { + name = 'UpdateTableKpiUserEvalutionAddPoint21714126663201' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`evaluatorTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้ประเมิน'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้บังคับบัญชาเหนือขึ้นไป'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderHighTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง'`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderHighTopic\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderTopic\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`evaluatorTopic\``); + } + +} diff --git a/src/migration/1714127671110-update_table_kpiUserEvalution_add_point3.ts b/src/migration/1714127671110-update_table_kpiUserEvalution_add_point3.ts new file mode 100644 index 0000000..19bc0c2 --- /dev/null +++ b/src/migration/1714127671110-update_table_kpiUserEvalution_add_point3.ts @@ -0,0 +1,28 @@ +import { MigrationInterface, QueryRunner } from "typeorm"; + +export class UpdateTableKpiUserEvalutionAddPoint31714127671110 implements MigrationInterface { + name = 'UpdateTableKpiUserEvalutionAddPoint31714127671110' + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(`CREATE TABLE \`kpiUserEvaluationReason\` (\`id\` varchar(36) NOT NULL, \`createdAt\` datetime(6) NOT NULL COMMENT 'สร้างข้อมูลเมื่อ' DEFAULT CURRENT_TIMESTAMP(6), \`createdUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่สร้างข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`lastUpdatedAt\` datetime(6) NOT NULL COMMENT 'แก้ไขข้อมูลล่าสุดเมื่อ' DEFAULT CURRENT_TIMESTAMP(6) ON UPDATE CURRENT_TIMESTAMP(6), \`lastUpdateUserId\` varchar(40) NOT NULL COMMENT 'User Id ที่แก้ไขข้อมูล' DEFAULT '00000000-0000-0000-0000-000000000000', \`createdFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่สร้างข้อมูล' DEFAULT 'string', \`lastUpdateFullName\` varchar(200) NOT NULL COMMENT 'ชื่อ User ที่แก้ไขข้อมูลล่าสุด' DEFAULT 'string', \`reason\` varchar(255) NULL COMMENT 'หมายเหตุ', \`topic\` varchar(255) NULL COMMENT 'หัวข้อ', \`type\` varchar(255) NULL COMMENT 'ประเภท', \`kpiUserEvaluationId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง kpiPeriodId', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`evaluatorReason\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderReason\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderHighReason\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`evaluatorTopic\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderTopic\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` DROP COLUMN \`commanderHighTopic\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReason\` ADD CONSTRAINT \`FK_99a78bf1acfce1ba7f763296f91\` FOREIGN KEY (\`kpiUserEvaluationId\`) REFERENCES \`kpiUserEvaluation\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluationReason\` DROP FOREIGN KEY \`FK_99a78bf1acfce1ba7f763296f91\``); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderHighTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้บังคับบัญชาเหนือขึ้นไป'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`evaluatorTopic\` varchar(255) NULL COMMENT 'หัวข้อ ของผู้ประเมิน'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderHighReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้บังคับบัญชาเหนือขึ้นไปอีกชั้นหนึ่ง'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`commanderReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้บังคับบัญชาเหนือขึ้นไป'`); + await queryRunner.query(`ALTER TABLE \`kpiUserEvaluation\` ADD \`evaluatorReason\` varchar(255) NULL COMMENT 'หมายเหตุ ของผู้ประเมิน'`); + await queryRunner.query(`DROP TABLE \`kpiUserEvaluationReason\``); + } + +}