บันทึกข้อมูลราชการ
This commit is contained in:
parent
250897ac91
commit
474630a7ba
4 changed files with 159 additions and 220 deletions
|
|
@ -25,6 +25,7 @@ import {
|
||||||
} from "../entities/ProfileGovernment";
|
} from "../entities/ProfileGovernment";
|
||||||
import { Position } from "../entities/Position";
|
import { Position } from "../entities/Position";
|
||||||
import { PosMaster } from "../entities/PosMaster";
|
import { PosMaster } from "../entities/PosMaster";
|
||||||
|
import { calculateAge, calculateRetireDate } from "../interfaces/utils";
|
||||||
|
|
||||||
@Route("api/v1/org/profile/government")
|
@Route("api/v1/org/profile/government")
|
||||||
@Tags("ProfileGovernment")
|
@Tags("ProfileGovernment")
|
||||||
|
|
@ -40,7 +41,6 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
public async getGovHistory(@Path() profileId: string) {
|
public async getGovHistory(@Path() profileId: string) {
|
||||||
const record = await this.profileRepo.findOne({
|
const record = await this.profileRepo.findOne({
|
||||||
where: { id: profileId },
|
where: { id: profileId },
|
||||||
order: { createdAt: "DESC" },
|
|
||||||
relations: {
|
relations: {
|
||||||
posType: true,
|
posType: true,
|
||||||
posLevel: true,
|
posLevel: true,
|
||||||
|
|
@ -116,6 +116,12 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
: position.posExecutive.posExecutiveName, //ตำแหน่งทางการบริหาร
|
: position.posExecutive.posExecutiveName, //ตำแหน่งทางการบริหาร
|
||||||
positionArea: position == null ? null : position.positionArea, //ด้าน/สาขา
|
positionArea: position == null ? null : position.positionArea, //ด้าน/สาขา
|
||||||
positionExecutiveField: position == null ? null : position.positionExecutiveField, //ด้านทางการบริหาร
|
positionExecutiveField: position == null ? null : position.positionExecutiveField, //ด้านทางการบริหาร
|
||||||
|
dateLeave: record.birthDate == null ? null : calculateRetireDate(record.birthDate),
|
||||||
|
govAge: record.dateStart == null ? null : calculateAge(record.dateStart),
|
||||||
|
dateAppoint: record.dateAppoint,
|
||||||
|
dateStart: record.dateStart,
|
||||||
|
govAgeAbsent: record.govAgeAbsent,
|
||||||
|
govAgePlus: record.govAgePlus,
|
||||||
};
|
};
|
||||||
|
|
||||||
return new HttpSuccess(data);
|
return new HttpSuccess(data);
|
||||||
|
|
@ -134,33 +140,33 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
return new HttpSuccess(record);
|
return new HttpSuccess(record);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Post()
|
// @Post()
|
||||||
public async newGov(@Request() req: RequestWithUser, @Body() body: CreateProfileGovernment) {
|
// public async newGov(@Request() req: RequestWithUser, @Body() body: CreateProfileGovernment) {
|
||||||
if (!body.profileId) {
|
// if (!body.profileId) {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
|
// throw new HttpError(HttpStatus.BAD_REQUEST, "กรุณากรอก profileId");
|
||||||
}
|
// }
|
||||||
|
|
||||||
const profile = await this.profileRepo.findOneBy({ id: body.profileId });
|
// const profile = await this.profileRepo.findOneBy({ id: body.profileId });
|
||||||
|
|
||||||
if (!profile) {
|
// if (!profile) {
|
||||||
throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
// throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว");
|
||||||
}
|
// }
|
||||||
|
|
||||||
const data = new ProfileGovernment();
|
// const data = new ProfileGovernment();
|
||||||
|
|
||||||
const meta = {
|
// const meta = {
|
||||||
createdUserId: req.user.sub,
|
// createdUserId: req.user.sub,
|
||||||
createdFullName: req.user.name,
|
// createdFullName: req.user.name,
|
||||||
lastUpdateUserId: req.user.sub,
|
// lastUpdateUserId: req.user.sub,
|
||||||
lastUpdateFullName: req.user.name,
|
// lastUpdateFullName: req.user.name,
|
||||||
};
|
// };
|
||||||
|
|
||||||
Object.assign(data, { ...body, ...meta });
|
// Object.assign(data, { ...body, ...meta });
|
||||||
|
|
||||||
await this.govRepo.save(data);
|
// await this.govRepo.save(data);
|
||||||
|
|
||||||
return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
}
|
// }
|
||||||
|
|
||||||
@Patch("{profileId}")
|
@Patch("{profileId}")
|
||||||
public async editGov(
|
public async editGov(
|
||||||
|
|
@ -168,35 +174,34 @@ export class ProfileGovernmentHistoryController extends Controller {
|
||||||
@Body() body: UpdateProfileGovernment,
|
@Body() body: UpdateProfileGovernment,
|
||||||
@Path() profileId: string,
|
@Path() profileId: string,
|
||||||
) {
|
) {
|
||||||
const record = (
|
const record = await this.profileRepo.findOne({
|
||||||
await this.govRepo.find({
|
where: { id: profileId },
|
||||||
take: 1,
|
});
|
||||||
order: { lastUpdatedAt: "DESC" },
|
|
||||||
where: { profileId },
|
|
||||||
})
|
|
||||||
)[0];
|
|
||||||
|
|
||||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
|
|
||||||
const historyData = new ProfileGovernment();
|
const historyData = new ProfileGovernment();
|
||||||
|
|
||||||
Object.assign(historyData, { ...record, ...body, id: undefined });
|
Object.assign(historyData, { ...record, ...body, id: undefined });
|
||||||
|
Object.assign(record, body);
|
||||||
|
record.lastUpdateFullName = req.user.name;
|
||||||
|
record.lastUpdateFullName = req.user.name;
|
||||||
historyData.lastUpdateFullName = req.user.name;
|
historyData.lastUpdateFullName = req.user.name;
|
||||||
historyData.lastUpdateFullName = req.user.name;
|
historyData.lastUpdateFullName = req.user.name;
|
||||||
|
|
||||||
await this.govRepo.save(historyData);
|
await Promise.all([this.profileRepo.save(record)]);
|
||||||
|
|
||||||
return new HttpSuccess();
|
return new HttpSuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Delete("{profileId}")
|
// @Delete("{profileId}")
|
||||||
public async deleteGov(@Path() profileId: string) {
|
// public async deleteGov(@Path() profileId: string) {
|
||||||
const result = await this.govRepo.delete({ profileId: profileId });
|
// const result = await this.govRepo.delete({ profileId: profileId });
|
||||||
|
|
||||||
if (result.affected && result.affected <= 0) {
|
// if (result.affected && result.affected <= 0) {
|
||||||
throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
// throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูล");
|
||||||
}
|
// }
|
||||||
|
|
||||||
return new HttpSuccess();
|
// return new HttpSuccess();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -147,6 +147,36 @@ export class Profile extends EntityBase {
|
||||||
})
|
})
|
||||||
dateRetire: Date;
|
dateRetire: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่บรรจุ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateAppoint: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่เริ่มปฏิบัติราชการ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
dateStart: Date;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ขาดราชการ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
govAgeAbsent: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "อายุราชการเกื้อกูล",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
govAgePlus: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
|
|
|
||||||
|
|
@ -17,216 +17,42 @@ export class ProfileGovernment extends EntityBase {
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
length: 40,
|
type: "datetime",
|
||||||
|
comment: "วันที่บรรจุ",
|
||||||
default: null,
|
default: null,
|
||||||
comment: "เลขที่ตำแหน่ง",
|
|
||||||
})
|
|
||||||
posNoId: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
default: null,
|
|
||||||
comment: "สังกัด",
|
|
||||||
})
|
|
||||||
ocId: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
length: 40,
|
|
||||||
default: null,
|
|
||||||
comment: "คีย์นอก(FK)ของตาราง Position",
|
|
||||||
})
|
|
||||||
positionId: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "วันที่สั่งบรรจุ",
|
|
||||||
})
|
})
|
||||||
dateAppoint: Date;
|
dateAppoint: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
type: "datetime",
|
||||||
|
comment: "วันที่เริ่มปฏิบัติราชการ",
|
||||||
default: null,
|
default: null,
|
||||||
comment: "เริ่มปฎิบัติราชการ",
|
|
||||||
})
|
})
|
||||||
dateStart: Date;
|
dateStart: Date;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
default: null,
|
|
||||||
comment: "วันเกษียณอายุ",
|
|
||||||
})
|
|
||||||
retireDate: Date;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "อายุราชการ",
|
|
||||||
})
|
|
||||||
govAge: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ขาดราชการ",
|
comment: "ขาดราชการ",
|
||||||
|
default: null,
|
||||||
})
|
})
|
||||||
govAgeAbsent: string;
|
govAgeAbsent: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
default: null,
|
|
||||||
comment: "อายุราชการเกื้อกูล",
|
comment: "อายุราชการเกื้อกูล",
|
||||||
})
|
|
||||||
govAgePlus: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "สังกัด",
|
|
||||||
})
|
|
||||||
oc: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "เลขที่ตำแหน่ง",
|
|
||||||
})
|
|
||||||
posNo: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ตำแหน่ง",
|
|
||||||
})
|
|
||||||
position: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ระดับตำแหน่ง",
|
|
||||||
})
|
|
||||||
positionLevel: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "สายงาน",
|
|
||||||
})
|
|
||||||
positionLine: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ประเภทตำแหน่ง",
|
|
||||||
})
|
|
||||||
positionType: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ตำแหน่งทางการบริหาร",
|
|
||||||
})
|
|
||||||
positionExecutive: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "เหตุผลกรณีไม่ตรงวัน",
|
|
||||||
})
|
|
||||||
reasonSameDate: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "กลุ่มงาน",
|
|
||||||
})
|
|
||||||
positionEmployeeGroup: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ระดับชั้นงาน",
|
|
||||||
})
|
|
||||||
positionEmployeeLevel: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ตำแหน่ง",
|
|
||||||
})
|
|
||||||
positionEmployeePosition: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
comment: "ด้านของตำแหน่ง",
|
|
||||||
})
|
|
||||||
positionEmployeePositionSide: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
positionPathSide: string;
|
govAgePlus: number;
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
positionExecutiveSide: string;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CreateProfileGovernment = {
|
export type CreateProfileGovernment = {
|
||||||
profileId: string;
|
profileId: string;
|
||||||
positionId: string | null;
|
dateAppoint?: Date | null;
|
||||||
posNoId: string | null;
|
dateStart?: Date | null;
|
||||||
ocId: string | null;
|
|
||||||
dateAppoint: Date | null;
|
|
||||||
dateStart: Date | null;
|
|
||||||
retireDate: Date | null;
|
|
||||||
govAge: string | null;
|
|
||||||
govAgeAbsent: string | null;
|
|
||||||
govAgePlus: string | null;
|
|
||||||
oc: string | null;
|
|
||||||
posNo: string | null;
|
|
||||||
postition: string | null;
|
|
||||||
positionLevel: string | null;
|
|
||||||
positionLine: string | null;
|
|
||||||
positionType: string | null;
|
|
||||||
positionExecutive: string | null;
|
|
||||||
reasonSameDate: string | null;
|
|
||||||
positionEmployeeGroup: string | null;
|
|
||||||
positionEmployeeLevel: string | null;
|
|
||||||
positionEmployeePosition: string | null;
|
|
||||||
positionEmployeePositionSide: string | null;
|
|
||||||
positionPathSide: string | null;
|
|
||||||
positionExecutiveSide: string | null;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export type UpdateProfileGovernment = {
|
export type UpdateProfileGovernment = {
|
||||||
positionId?: string | null;
|
|
||||||
posNoId?: string | null;
|
|
||||||
ocId?: string | null;
|
|
||||||
dateAppoint?: Date | null;
|
dateAppoint?: Date | null;
|
||||||
dateStart?: Date | null;
|
dateStart?: Date | null;
|
||||||
retireDate?: Date | null;
|
|
||||||
govAge?: string | null;
|
|
||||||
govAgeAbsent?: string | null;
|
|
||||||
govAgePlus?: string | null;
|
|
||||||
oc?: string | null;
|
|
||||||
posNo?: string | null;
|
|
||||||
postition?: string | null;
|
|
||||||
positionLevel?: string | null;
|
|
||||||
positionLine?: string | null;
|
|
||||||
positionType?: string | null;
|
|
||||||
positionExecutive?: string | null;
|
|
||||||
reasonSameDate?: string | null;
|
|
||||||
positionEmployeeGroup?: string | null;
|
|
||||||
positionEmployeeLevel?: string | null;
|
|
||||||
positionEmployeePosition?: string | null;
|
|
||||||
positionEmployeePositionSide?: string | null;
|
|
||||||
positionPathSide?: string | null;
|
|
||||||
positionExecutiveSide?: string | null;
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,78 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableProfilegovAddDateAppoint1711513058675 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableProfilegovAddDateAppoint1711513058675'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`govAge\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`oc\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`ocId\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`position\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionEmployeeGroup\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionEmployeeLevel\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionEmployeePosition\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionEmployeePositionSide\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionExecutive\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionExecutiveSide\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionId\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionLevel\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionLine\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionPathSide\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`positionType\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`posNo\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`posNoId\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`reasonSameDate\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`retireDate\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` CHANGE \`dateAppoint\` \`dateAppoint\` datetime NULL COMMENT 'วันที่บรรจุ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` CHANGE \`dateStart\` \`dateStart\` datetime NULL COMMENT 'วันที่เริ่มปฏิบัติราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`govAgeAbsent\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`govAgeAbsent\` int NULL COMMENT 'ขาดราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`govAgePlus\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`govAgePlus\` int NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`govAgePlus\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`govAgePlus\` varchar(255) NULL COMMENT 'อายุราชการเกื้อกูล'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` DROP COLUMN \`govAgeAbsent\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`govAgeAbsent\` varchar(255) NULL COMMENT 'ขาดราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` CHANGE \`dateStart\` \`dateStart\` datetime NULL COMMENT 'เริ่มปฎิบัติราชการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` CHANGE \`dateAppoint\` \`dateAppoint\` datetime NULL COMMENT 'วันที่สั่งบรรจุ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`govAgePlus\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`govAgeAbsent\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dateStart\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileHistory\` DROP COLUMN \`dateAppoint\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`govAgePlus\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`govAgeAbsent\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dateStart\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profile\` DROP COLUMN \`dateAppoint\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`retireDate\` datetime NULL COMMENT 'วันเกษียณอายุ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`reasonSameDate\` varchar(255) NULL COMMENT 'เหตุผลกรณีไม่ตรงวัน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`posNoId\` varchar(40) NULL COMMENT 'เลขที่ตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`posNo\` varchar(255) NULL COMMENT 'เลขที่ตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionType\` varchar(255) NULL COMMENT 'ประเภทตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionPathSide\` varchar(255) NULL`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionLine\` varchar(255) NULL COMMENT 'สายงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionLevel\` varchar(255) NULL COMMENT 'ระดับตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionId\` varchar(40) NULL COMMENT 'คีย์นอก(FK)ของตาราง Position'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionExecutiveSide\` varchar(255) NULL`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionExecutive\` varchar(255) NULL COMMENT 'ตำแหน่งทางการบริหาร'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionEmployeePositionSide\` varchar(255) NULL COMMENT 'ด้านของตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionEmployeePosition\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionEmployeeLevel\` varchar(255) NULL COMMENT 'ระดับชั้นงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`positionEmployeeGroup\` varchar(255) NULL COMMENT 'กลุ่มงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`position\` varchar(255) NULL COMMENT 'ตำแหน่ง'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`ocId\` varchar(40) NULL COMMENT 'สังกัด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`oc\` varchar(255) NULL COMMENT 'สังกัด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`profileGovernment\` ADD \`govAge\` varchar(255) NULL COMMENT 'อายุราชการ'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue