ปรับโครงาร
This commit is contained in:
parent
b8e1c93cb4
commit
4f8b2cec73
10 changed files with 1317 additions and 483 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -313,6 +313,7 @@ export class DevelopmentScholarshipController extends Controller {
|
||||||
: null,
|
: null,
|
||||||
totalPeriod: getDevelopment.totalPeriod ? getDevelopment.totalPeriod : null,
|
totalPeriod: getDevelopment.totalPeriod ? getDevelopment.totalPeriod : null,
|
||||||
status: getDevelopment.status ? getDevelopment.status : null,
|
status: getDevelopment.status ? getDevelopment.status : null,
|
||||||
|
profileId: getDevelopment.profileId ? getDevelopment.profileId : null,
|
||||||
};
|
};
|
||||||
return new HttpSuccess(formattedData);
|
return new HttpSuccess(formattedData);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,22 @@ import { CreatePlannedPeople, PlannedPeople } from "./PlannedPeople";
|
||||||
import { ActualGoal, CreateActualGoal } from "./ActualGoal";
|
import { ActualGoal, CreateActualGoal } from "./ActualGoal";
|
||||||
import { CreatePlannedGoal, PlannedGoal } from "./PlannedGoal";
|
import { CreatePlannedGoal, PlannedGoal } from "./PlannedGoal";
|
||||||
import { DevelopmentHistory } from "./DevelopmentHistory";
|
import { DevelopmentHistory } from "./DevelopmentHistory";
|
||||||
|
import { DevelopmentProjectType } from "./DevelopmentProjectType";
|
||||||
|
import { DevelopmentProjectTechnique } from "./DevelopmentProjectTechnique";
|
||||||
|
import { CreateDevelopmentEvaluation, DevelopmentEvaluation } from "./DevelopmentEvaluation";
|
||||||
|
import { CreateDevelopmentAddress, DevelopmentAddress } from "./DevelopmentAddress";
|
||||||
|
|
||||||
@Entity("development")
|
@Entity("development")
|
||||||
export class Development extends EntityBase {
|
export class Development extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
// กำลังดำเนินการ (ONGOING)
|
||||||
|
// เสร็จสิ้น (FINISH)
|
||||||
|
nullable: true,
|
||||||
|
comment: "สถานะ",
|
||||||
|
default: "ONGOING",
|
||||||
|
})
|
||||||
|
status: string;
|
||||||
|
////////////////////////////////////////tab ข้อมูลเบื้องต้น
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ปีงบประมาณ",
|
comment: "ปีงบประมาณ",
|
||||||
|
|
@ -35,61 +48,118 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
objective: string;
|
objective: string;
|
||||||
|
|
||||||
|
////////////////////////////////////////tab เป้าหมาย
|
||||||
|
@OneToMany(
|
||||||
|
() => ActualPeople,
|
||||||
|
(actualPeople: ActualPeople) => actualPeople.developmentActualPeople,
|
||||||
|
)
|
||||||
|
developmentActualPeoples: ActualPeople[];
|
||||||
|
|
||||||
|
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.developmentActualGoal)
|
||||||
|
developmentActualGoals: ActualGoal[];
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => PlannedPeople,
|
||||||
|
(plannedPeople: PlannedPeople) => plannedPeople.developmentPlannedPeople,
|
||||||
|
)
|
||||||
|
developmentPlannedPeoples: PlannedPeople[];
|
||||||
|
|
||||||
|
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.developmentPlannedGoal)
|
||||||
|
developmentPlannedGoals: PlannedGoal[];
|
||||||
|
|
||||||
|
////////////////////////////////////////tab ลักษณะโครงการ
|
||||||
|
@OneToMany(
|
||||||
|
() => DevelopmentProjectType,
|
||||||
|
(developmentProjectType: DevelopmentProjectType) => developmentProjectType.development,
|
||||||
|
)
|
||||||
|
developmentProjectTypes: DevelopmentProjectType[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
comment: "ไป-กลับ",
|
||||||
comment: "ประเภทตัวชี้วัด",
|
default: false,
|
||||||
default: null,
|
|
||||||
})
|
})
|
||||||
metricType: string;
|
isBackPlanned: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "พักค้าง",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isHoldPlanned: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ตัวชี้วัด",
|
comment: "จำนวน(วัน)(ไป-กลับ)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
indicators: string;
|
projectDayBackPlanned: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "เป้าหมาย",
|
comment: "จำนวน(วัน)(พักค้าง)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
target: string;
|
projectDayHoldPlanned: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "วิธีการคำนวณ/เครื่องมือ",
|
comment: "จำนวน(คืน)(พักค้าง)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
calculation: string;
|
projectNigthHoldPlanned: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "ไป-กลับ",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isBackActual: boolean;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
comment: "พักค้าง",
|
||||||
|
default: false,
|
||||||
|
})
|
||||||
|
isHoldActual: boolean;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ระยะเวลาวัดผล",
|
comment: "จำนวน(วัน)(ไป-กลับ)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
measuRement: string;
|
projectDayBackActual: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ผลการดำเนิน",
|
comment: "จำนวน(วัน)(พักค้าง)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
results: string;
|
projectDayHoldActual: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ปัญหาอุปสรรค",
|
comment: "จำนวน(คืน)(พักค้าง)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
obstacles: string;
|
projectNigthHoldActual: number;
|
||||||
|
|
||||||
|
@OneToMany(
|
||||||
|
() => DevelopmentProjectTechnique,
|
||||||
|
(developmentProjectTechnique: DevelopmentProjectTechnique) =>
|
||||||
|
developmentProjectTechnique.development,
|
||||||
|
)
|
||||||
|
developmentProjectTechniques: DevelopmentProjectTechnique[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ข้อเสนอเเนะ",
|
comment: "จำนวน(รุ่น)",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
suggestions: string;
|
projectModal: number;
|
||||||
|
|
||||||
|
////////////////////////////////////////tab ผลประเมิน
|
||||||
|
@OneToMany(
|
||||||
|
() => DevelopmentEvaluation,
|
||||||
|
(developmentEvaluation: DevelopmentEvaluation) => developmentEvaluation.development,
|
||||||
|
)
|
||||||
|
developmentEvaluations: DevelopmentEvaluation[];
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -129,6 +199,7 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
isOutBudget: boolean;
|
isOutBudget: boolean;
|
||||||
|
|
||||||
|
////////////////////////////////////////tab อื่นๆ
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
|
|
@ -152,12 +223,11 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
totalDate: number;
|
totalDate: number;
|
||||||
|
|
||||||
@Column({
|
@OneToMany(
|
||||||
nullable: true,
|
() => DevelopmentAddress,
|
||||||
comment: "ที่อยู่",
|
(developmentAddress: DevelopmentAddress) => developmentAddress.development,
|
||||||
default: null,
|
)
|
||||||
})
|
developmentAddresss: DevelopmentAddress[];
|
||||||
address: string;
|
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -166,6 +236,16 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
budget: string;
|
budget: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
// เงินบำรุง = MAINTENANCE
|
||||||
|
// เงินกองทุน = FUND
|
||||||
|
// เงินอุดหนุน = SUBSIDY
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเภทย่อย",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
budgetSub: string;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "จํานวนงบประมาณที่ขอรับการจัดสรรฯ",
|
comment: "จํานวนงบประมาณที่ขอรับการจัดสรรฯ",
|
||||||
|
|
@ -210,14 +290,14 @@ export class Development extends EntityBase {
|
||||||
comment: "โอกาสที่จะเกิด",
|
comment: "โอกาสที่จะเกิด",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
chance: string;
|
chance: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
comment: "ผลกระทบจากการเกิด",
|
comment: "ผลกระทบจากการเกิด",
|
||||||
default: null,
|
default: null,
|
||||||
})
|
})
|
||||||
effects: string;
|
effects: number;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
|
|
@ -254,6 +334,17 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
addressAcademic: string;
|
addressAcademic: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "จังหวัด(ข้อมูลวิชาการ)",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
provinceActualId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
|
||||||
|
@JoinColumn({ name: "provinceActualId" })
|
||||||
|
provinceActual: Province;
|
||||||
|
|
||||||
@Column({
|
@Column({
|
||||||
nullable: true,
|
nullable: true,
|
||||||
type: "datetime",
|
type: "datetime",
|
||||||
|
|
@ -270,105 +361,6 @@ export class Development extends EntityBase {
|
||||||
})
|
})
|
||||||
dateStudyEnd: Date;
|
dateStudyEnd: Date;
|
||||||
|
|
||||||
@Column({
|
|
||||||
// STRATEGIC_PROJECT = โครงการตามยุทธศาสตร์
|
|
||||||
// MISSION_PROJECT = โครงการตามภารกิจประจำของหน่วยงาน
|
|
||||||
// NEW_PROJECT = โครงการใหม่
|
|
||||||
// ONGOING_PROJECT = โครงการต่อเนื่อง
|
|
||||||
nullable: true,
|
|
||||||
comment: "ประเภทโครงการ",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectType: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
// GO_BACK = ไป-กลับ
|
|
||||||
// HOLD = พักค้าง
|
|
||||||
// GO_BACK_HOLD = ไป-กลับและพักค้าง
|
|
||||||
nullable: true,
|
|
||||||
comment: "ลักษณะ",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectCharacteristics: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "จำนวน(วัน)",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectDay: number;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "จำนวน(คืน)",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectNigth: number;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
// TRAINING = การอบรม
|
|
||||||
// MEETING = การประชุม
|
|
||||||
// SEMINAR = การสัมมนา
|
|
||||||
// STUDY_TOUR = การศึกษาดูงาน
|
|
||||||
// ACADEMIC_SEMINAR = การสัมมนาทางวิชาการ
|
|
||||||
// WORKSHOP = การสัมมนาเชิงปฏิบัติการ
|
|
||||||
// SPECIAL_LECTURE = การบรรยายพิเศษ
|
|
||||||
// STUDY_TRAINING = การฝึกศึกษา
|
|
||||||
nullable: true,
|
|
||||||
comment: "เทคนิควิธีการที่ใช้ในการพัฒนา",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectTechniques: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "จำนวน(รุ่น)",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
projectModal: number;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
// เงินบำรุง = MAINTENANCE
|
|
||||||
// เงินกองทุน = FUND
|
|
||||||
// เงินอุดหนุน = SUBSIDY
|
|
||||||
nullable: true,
|
|
||||||
comment: "ประเภทย่อย",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
budgetSub: string;
|
|
||||||
|
|
||||||
@Column({
|
|
||||||
nullable: true,
|
|
||||||
comment: "จังหวัด(ข้อมูลวิชาการ)",
|
|
||||||
default: null,
|
|
||||||
})
|
|
||||||
provinceActualId: string;
|
|
||||||
|
|
||||||
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
|
|
||||||
@JoinColumn({ name: "provinceActualId" })
|
|
||||||
provinceActual: Province;
|
|
||||||
|
|
||||||
@ManyToMany(() => Province, (provinces) => provinces.developmentProvinces)
|
|
||||||
provinces: Province[];
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => ActualPeople,
|
|
||||||
(actualPeople: ActualPeople) => actualPeople.developmentActualPeople,
|
|
||||||
)
|
|
||||||
developmentActualPeoples: ActualPeople[];
|
|
||||||
|
|
||||||
@OneToMany(
|
|
||||||
() => PlannedPeople,
|
|
||||||
(plannedPeople: PlannedPeople) => plannedPeople.developmentPlannedPeople,
|
|
||||||
)
|
|
||||||
developmentPlannedPeoples: PlannedPeople[];
|
|
||||||
|
|
||||||
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.developmentActualGoal)
|
|
||||||
developmentActualGoals: ActualGoal[];
|
|
||||||
|
|
||||||
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.developmentPlannedGoal)
|
|
||||||
developmentPlannedGoals: PlannedGoal[];
|
|
||||||
|
|
||||||
@OneToMany(
|
@OneToMany(
|
||||||
() => DevelopmentHistory,
|
() => DevelopmentHistory,
|
||||||
(developmentHistory: DevelopmentHistory) => developmentHistory.development,
|
(developmentHistory: DevelopmentHistory) => developmentHistory.development,
|
||||||
|
|
@ -380,105 +372,9 @@ export class CreateDevelopment {
|
||||||
year: number;
|
year: number;
|
||||||
@Column()
|
@Column()
|
||||||
projectName: string;
|
projectName: string;
|
||||||
@Column()
|
|
||||||
reason: string | null;
|
|
||||||
@Column()
|
|
||||||
objective: string | null;
|
|
||||||
@Column()
|
|
||||||
metricType: string | null;
|
|
||||||
@Column()
|
|
||||||
indicators: string | null;
|
|
||||||
@Column()
|
|
||||||
target: string | null;
|
|
||||||
@Column()
|
|
||||||
calculation: string | null;
|
|
||||||
@Column()
|
|
||||||
measuRement: string | null;
|
|
||||||
@Column()
|
|
||||||
results: string | null;
|
|
||||||
@Column()
|
|
||||||
obstacles: string | null;
|
|
||||||
@Column()
|
|
||||||
suggestions: string | null;
|
|
||||||
@Column()
|
|
||||||
project: string | null;
|
|
||||||
@Column()
|
|
||||||
isPassAllocate: boolean;
|
|
||||||
@Column()
|
|
||||||
isPassNoAllocate: boolean;
|
|
||||||
@Column()
|
|
||||||
isNoPass: boolean;
|
|
||||||
@Column()
|
|
||||||
isBudget: boolean;
|
|
||||||
@Column()
|
|
||||||
isOutBudget: boolean;
|
|
||||||
@Column()
|
|
||||||
dateStart: Date | null;
|
|
||||||
@Column()
|
|
||||||
dateEnd: Date | null;
|
|
||||||
@Column()
|
|
||||||
totalDate: number | null;
|
|
||||||
@Column()
|
|
||||||
address: string | null;
|
|
||||||
@Column()
|
|
||||||
provinceIds: string[];
|
|
||||||
@Column()
|
|
||||||
budget: string | null;
|
|
||||||
@Column()
|
|
||||||
accept: Double | null;
|
|
||||||
@Column()
|
|
||||||
receive: Double | null;
|
|
||||||
@Column()
|
|
||||||
approved: Double | null;
|
|
||||||
@Column()
|
|
||||||
budgetPay: Double | null;
|
|
||||||
@Column()
|
|
||||||
issues: string | null;
|
|
||||||
@Column()
|
|
||||||
chance: string | null;
|
|
||||||
@Column()
|
|
||||||
effects: string | null;
|
|
||||||
@Column()
|
|
||||||
riskLevel: string | null;
|
|
||||||
@Column()
|
|
||||||
riskManagement: string | null;
|
|
||||||
@Column()
|
|
||||||
expect: string | null;
|
|
||||||
@Column()
|
|
||||||
topicAcademic: string | null;
|
|
||||||
@Column()
|
|
||||||
addressAcademic: string | null;
|
|
||||||
@Column()
|
|
||||||
provinceActualId: string | null;
|
|
||||||
@Column()
|
|
||||||
dateStudyStart?: Date | null;
|
|
||||||
@Column()
|
|
||||||
dateStudyEnd?: Date | null;
|
|
||||||
@Column()
|
|
||||||
projectType: string | null;
|
|
||||||
@Column()
|
|
||||||
projectCharacteristics: string | null;
|
|
||||||
@Column()
|
|
||||||
projectDay: number | null;
|
|
||||||
@Column()
|
|
||||||
projectNigth: number | null;
|
|
||||||
@Column()
|
|
||||||
projectTechniques: string | null;
|
|
||||||
@Column()
|
|
||||||
projectModal: number | null;
|
|
||||||
@Column()
|
|
||||||
budgetSub: string | null;
|
|
||||||
@Column()
|
|
||||||
actualPeoples: CreateActualPeople[];
|
|
||||||
@Column()
|
|
||||||
plannedPeoples: CreatePlannedPeople[];
|
|
||||||
@Column()
|
|
||||||
actualGoals: CreateActualGoal[];
|
|
||||||
@Column()
|
|
||||||
plannedGoals: CreatePlannedGoal[];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export class UpdateDevelopment {
|
export class UpdateDevelopment1 {
|
||||||
@Column()
|
@Column()
|
||||||
year: number;
|
year: number;
|
||||||
@Column()
|
@Column()
|
||||||
|
|
@ -487,22 +383,50 @@ export class UpdateDevelopment {
|
||||||
reason: string | null;
|
reason: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
objective: string | null;
|
objective: string | null;
|
||||||
|
}
|
||||||
|
export class UpdateDevelopment2_1 {
|
||||||
@Column()
|
@Column()
|
||||||
metricType: string | null;
|
actualGoals: CreateActualGoal[];
|
||||||
@Column()
|
@Column()
|
||||||
indicators: string | null;
|
plannedGoals: CreatePlannedGoal[];
|
||||||
|
}
|
||||||
|
export class UpdateDevelopment2_2 {
|
||||||
@Column()
|
@Column()
|
||||||
target: string | null;
|
actualPeoples: CreateActualPeople[];
|
||||||
@Column()
|
@Column()
|
||||||
calculation: string | null;
|
plannedPeoples: CreatePlannedPeople[];
|
||||||
|
}
|
||||||
|
export class UpdateDevelopment3 {
|
||||||
@Column()
|
@Column()
|
||||||
measuRement: string | null;
|
developmentProjectTypes?: string[];
|
||||||
@Column()
|
@Column()
|
||||||
results: string | null;
|
isBackPlanned?: boolean | null;
|
||||||
@Column()
|
@Column()
|
||||||
obstacles: string | null;
|
isHoldPlanned?: boolean | null;
|
||||||
@Column()
|
@Column()
|
||||||
suggestions: string | null;
|
projectDayBackPlanned?: number | null;
|
||||||
|
@Column()
|
||||||
|
projectDayHoldPlanned?: number | null;
|
||||||
|
@Column()
|
||||||
|
projectNigthHoldPlanned?: number | null;
|
||||||
|
@Column()
|
||||||
|
isBackActual?: boolean | null;
|
||||||
|
@Column()
|
||||||
|
isHoldActual?: boolean | null;
|
||||||
|
@Column()
|
||||||
|
projectDayBackActual?: number | null;
|
||||||
|
@Column()
|
||||||
|
projectDayHoldActual?: number | null;
|
||||||
|
@Column()
|
||||||
|
projectNigthHoldActual?: number | null;
|
||||||
|
@Column()
|
||||||
|
developmentProjectTechniques?: string[];
|
||||||
|
@Column()
|
||||||
|
projectModal?: number | null;
|
||||||
|
}
|
||||||
|
export class UpdateDevelopment4 {
|
||||||
|
@Column()
|
||||||
|
developmentEvaluations: CreateDevelopmentEvaluation[];
|
||||||
@Column()
|
@Column()
|
||||||
project: string | null;
|
project: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
|
|
@ -515,6 +439,8 @@ export class UpdateDevelopment {
|
||||||
isBudget: boolean;
|
isBudget: boolean;
|
||||||
@Column()
|
@Column()
|
||||||
isOutBudget: boolean;
|
isOutBudget: boolean;
|
||||||
|
}
|
||||||
|
export class UpdateDevelopment5 {
|
||||||
@Column()
|
@Column()
|
||||||
dateStart: Date | null;
|
dateStart: Date | null;
|
||||||
@Column()
|
@Column()
|
||||||
|
|
@ -522,12 +448,12 @@ export class UpdateDevelopment {
|
||||||
@Column()
|
@Column()
|
||||||
totalDate: number | null;
|
totalDate: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
address: string | null;
|
developmentAddresss: CreateDevelopmentAddress[];
|
||||||
@Column()
|
|
||||||
provinceIds: string[];
|
|
||||||
@Column()
|
@Column()
|
||||||
budget: string | null;
|
budget: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
|
budgetSub: string | null;
|
||||||
|
@Column()
|
||||||
accept: Double | null;
|
accept: Double | null;
|
||||||
@Column()
|
@Column()
|
||||||
receive: Double | null;
|
receive: Double | null;
|
||||||
|
|
@ -538,9 +464,9 @@ export class UpdateDevelopment {
|
||||||
@Column()
|
@Column()
|
||||||
issues: string | null;
|
issues: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
chance: string | null;
|
chance: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
effects: string | null;
|
effects: number | null;
|
||||||
@Column()
|
@Column()
|
||||||
riskLevel: string | null;
|
riskLevel: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
|
|
@ -554,29 +480,7 @@ export class UpdateDevelopment {
|
||||||
@Column()
|
@Column()
|
||||||
provinceActualId: string | null;
|
provinceActualId: string | null;
|
||||||
@Column()
|
@Column()
|
||||||
dateStudyStart?: Date | null;
|
dateStudyStart: Date | null;
|
||||||
@Column()
|
@Column()
|
||||||
dateStudyEnd?: Date | null;
|
dateStudyEnd: Date | null;
|
||||||
@Column()
|
|
||||||
projectType?: string | null;
|
|
||||||
@Column()
|
|
||||||
projectCharacteristics?: string | null;
|
|
||||||
@Column()
|
|
||||||
projectDay?: number | null;
|
|
||||||
@Column()
|
|
||||||
projectNigth?: number | null;
|
|
||||||
@Column()
|
|
||||||
projectTechniques?: string | null;
|
|
||||||
@Column()
|
|
||||||
projectModal?: number | null;
|
|
||||||
@Column()
|
|
||||||
budgetSub: string | null;
|
|
||||||
@Column()
|
|
||||||
actualPeoples: CreateActualPeople[];
|
|
||||||
@Column()
|
|
||||||
plannedPeoples: CreatePlannedPeople[];
|
|
||||||
@Column()
|
|
||||||
actualGoals: CreateActualGoal[];
|
|
||||||
@Column()
|
|
||||||
plannedGoals: CreatePlannedGoal[];
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
42
src/entities/DevelopmentAddress.ts
Normal file
42
src/entities/DevelopmentAddress.ts
Normal file
|
|
@ -0,0 +1,42 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Development } from "./Development";
|
||||||
|
import { Province } from "./Province";
|
||||||
|
|
||||||
|
@Entity("developmentAddress")
|
||||||
|
export class DevelopmentAddress extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ที่อยู่",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
address: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
provinceId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Province, (province: Province) => province.developmentAddresss)
|
||||||
|
@JoinColumn({ name: "provinceId" })
|
||||||
|
province: Province;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
developmentId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Development, (development: Development) => development.developmentAddresss)
|
||||||
|
@JoinColumn({ name: "developmentId" })
|
||||||
|
development: Development;
|
||||||
|
}
|
||||||
|
export class CreateDevelopmentAddress {
|
||||||
|
@Column()
|
||||||
|
address: string | null;
|
||||||
|
@Column()
|
||||||
|
provinceId: string;
|
||||||
|
}
|
||||||
90
src/entities/DevelopmentEvaluation.ts
Normal file
90
src/entities/DevelopmentEvaluation.ts
Normal file
|
|
@ -0,0 +1,90 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Development } from "./Development";
|
||||||
|
|
||||||
|
@Entity("developmentEvaluation")
|
||||||
|
export class DevelopmentEvaluation extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ตัวชี้วัด",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
indicators: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "เป้าหมาย",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
target: number;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเภทตัวชี้วัด",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
metricType: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "วิธีการคำนวณ/เครื่องมือ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
calculation: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ระยะเวลาวัดผล",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
measuRement: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ผลการดำเนิน",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
results: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ปัญหาอุปสรรค",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
obstacles: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "ข้อเสนอเเนะ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
suggestions: string;
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
developmentId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Development, (development: Development) => development.developmentEvaluations)
|
||||||
|
@JoinColumn({ name: "developmentId" })
|
||||||
|
development: Development;
|
||||||
|
}
|
||||||
|
export class CreateDevelopmentEvaluation {
|
||||||
|
@Column()
|
||||||
|
indicators: string | null;
|
||||||
|
@Column()
|
||||||
|
target: number | null;
|
||||||
|
@Column()
|
||||||
|
metricType: string | null;
|
||||||
|
@Column()
|
||||||
|
calculation: string | null;
|
||||||
|
@Column()
|
||||||
|
measuRement: string | null;
|
||||||
|
@Column()
|
||||||
|
results: string | null;
|
||||||
|
@Column()
|
||||||
|
obstacles: string | null;
|
||||||
|
@Column()
|
||||||
|
suggestions: string | null;
|
||||||
|
}
|
||||||
39
src/entities/DevelopmentProjectTechnique.ts
Normal file
39
src/entities/DevelopmentProjectTechnique.ts
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Development } from "./Development";
|
||||||
|
|
||||||
|
@Entity("developmentProjectTechnique")
|
||||||
|
export class DevelopmentProjectTechnique extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
// TRAINING = การอบรม
|
||||||
|
// MEETING = การประชุม
|
||||||
|
// SEMINAR = การสัมมนา
|
||||||
|
// STUDY_TOUR = การศึกษาดูงาน
|
||||||
|
// ACADEMIC_SEMINAR = การสัมมนาทางวิชาการ
|
||||||
|
// WORKSHOP = การสัมมนาเชิงปฏิบัติการ
|
||||||
|
// SPECIAL_LECTURE = การบรรยายพิเศษ
|
||||||
|
// STUDY_TRAINING = การฝึกศึกษา
|
||||||
|
nullable: true,
|
||||||
|
comment: "เทคนิควิธีการที่ใช้ในการพัฒนา",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
developmentId: string;
|
||||||
|
|
||||||
|
@ManyToOne(
|
||||||
|
() => Development,
|
||||||
|
(development: Development) => development.developmentProjectTechniques,
|
||||||
|
)
|
||||||
|
@JoinColumn({ name: "developmentId" })
|
||||||
|
development: Development;
|
||||||
|
}
|
||||||
|
export class CreateDevelopmentProjectTechnique {
|
||||||
|
@Column()
|
||||||
|
name: number;
|
||||||
|
}
|
||||||
32
src/entities/DevelopmentProjectType.ts
Normal file
32
src/entities/DevelopmentProjectType.ts
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||||
|
import { EntityBase } from "./base/Base";
|
||||||
|
import { Development } from "./Development";
|
||||||
|
|
||||||
|
@Entity("developmentProjectType")
|
||||||
|
export class DevelopmentProjectType extends EntityBase {
|
||||||
|
@Column({
|
||||||
|
// STRATEGIC_PROJECT = โครงการตามยุทธศาสตร์
|
||||||
|
// MISSION_PROJECT = โครงการตามภารกิจประจำของหน่วยงาน
|
||||||
|
// NEW_PROJECT = โครงการใหม่
|
||||||
|
// ONGOING_PROJECT = โครงการต่อเนื่อง
|
||||||
|
nullable: true,
|
||||||
|
comment: "ประเภทโครงการ",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
name: string;
|
||||||
|
|
||||||
|
@Column({
|
||||||
|
nullable: true,
|
||||||
|
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||||
|
default: null,
|
||||||
|
})
|
||||||
|
developmentId: string;
|
||||||
|
|
||||||
|
@ManyToOne(() => Development, (development: Development) => development.developmentProjectTypes)
|
||||||
|
@JoinColumn({ name: "developmentId" })
|
||||||
|
development: Development;
|
||||||
|
}
|
||||||
|
export class CreateDevelopmentProjectType {
|
||||||
|
@Column()
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
|
import { Entity, Column, OneToMany, ManyToMany, JoinTable } from "typeorm";
|
||||||
import { EntityBase } from "./base/Base";
|
import { EntityBase } from "./base/Base";
|
||||||
import { Development } from "./Development";
|
import { Development } from "./Development";
|
||||||
|
import { DevelopmentAddress } from "./DevelopmentAddress";
|
||||||
|
|
||||||
@Entity("province")
|
@Entity("province")
|
||||||
export class Province extends EntityBase {
|
export class Province extends EntityBase {
|
||||||
|
|
@ -12,9 +13,11 @@ export class Province extends EntityBase {
|
||||||
})
|
})
|
||||||
name: string;
|
name: string;
|
||||||
|
|
||||||
@ManyToMany(() => Development, (development) => development.provinces)
|
@OneToMany(
|
||||||
@JoinTable()
|
() => DevelopmentAddress,
|
||||||
developmentProvinces: Development[];
|
(developmentAddress: DevelopmentAddress) => developmentAddress.province,
|
||||||
|
)
|
||||||
|
developmentAddresss: DevelopmentAddress[];
|
||||||
|
|
||||||
@OneToMany(() => Development, (development: Development) => development.provinceActual)
|
@OneToMany(() => Development, (development: Development) => development.provinceActual)
|
||||||
developmentActuals: Development[];
|
developmentActuals: Development[];
|
||||||
|
|
|
||||||
92
src/migration/1712778363784-update_table_dev_refresh1.ts
Normal file
92
src/migration/1712778363784-update_table_dev_refresh1.ts
Normal file
|
|
@ -0,0 +1,92 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableDevRefresh11712778363784 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableDevRefresh11712778363784'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`CREATE TABLE \`developmentAddress\` (\`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', \`address\` varchar(255) NULL COMMENT 'ที่อยู่', \`provinceId\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม', \`developmentId\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`CREATE TABLE \`developmentProjectType\` (\`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', \`name\` varchar(255) NULL COMMENT 'ประเภทโครงการ', \`developmentId\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`CREATE TABLE \`developmentProjectTechnique\` (\`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', \`name\` varchar(255) NULL COMMENT 'เทคนิควิธีการที่ใช้ในการพัฒนา', \`developmentId\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`CREATE TABLE \`developmentEvaluation\` (\`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', \`indicators\` varchar(255) NULL COMMENT 'ตัวชี้วัด', \`target\` int NULL COMMENT 'เป้าหมาย', \`metricType\` varchar(255) NULL COMMENT 'ประเภทตัวชี้วัด', \`calculation\` varchar(255) NULL COMMENT 'วิธีการคำนวณ/เครื่องมือ', \`measuRement\` varchar(255) NULL COMMENT 'ระยะเวลาวัดผล', \`results\` varchar(255) NULL COMMENT 'ผลการดำเนิน', \`obstacles\` varchar(255) NULL COMMENT 'ปัญหาอุปสรรค', \`suggestions\` varchar(255) NULL COMMENT 'ข้อเสนอเเนะ', \`developmentId\` varchar(255) NULL COMMENT 'โครงการ/หลักสูตรการฝึกอบรม', PRIMARY KEY (\`id\`)) ENGINE=InnoDB`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`metricType\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`indicators\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`target\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`calculation\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`measuRement\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`results\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`obstacles\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`suggestions\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`address\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`dateStudyStart\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`dateStudyEnd\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectType\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectCharacteristics\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectDay\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectNigth\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectTechniques\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`status\` varchar(255) NULL COMMENT 'สถานะ' DEFAULT 'ONGOING'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`isBackPlanned\` tinyint NOT NULL COMMENT 'ไป-กลับ' DEFAULT 0`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`isHoldPlanned\` tinyint NOT NULL COMMENT 'พักค้าง' DEFAULT 0`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectDayBackPlanned\` int NULL COMMENT 'จำนวน(วัน)(ไป-กลับ)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectDayHoldPlanned\` int NULL COMMENT 'จำนวน(วัน)(พักค้าง)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectNigthHoldPlanned\` int NULL COMMENT 'จำนวน(คืน)(พักค้าง)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`isBackActual\` tinyint NOT NULL COMMENT 'ไป-กลับ' DEFAULT 0`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`isHoldActual\` tinyint NOT NULL COMMENT 'พักค้าง' DEFAULT 0`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectDayBackActual\` int NULL COMMENT 'จำนวน(วัน)(ไป-กลับ)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectDayHoldActual\` int NULL COMMENT 'จำนวน(วัน)(พักค้าง)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectNigthHoldActual\` int NULL COMMENT 'จำนวน(คืน)(พักค้าง)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`chance\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`chance\` int NULL COMMENT 'โอกาสที่จะเกิด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`effects\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`effects\` int NULL COMMENT 'ผลกระทบจากการเกิด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentAddress\` ADD CONSTRAINT \`FK_e2721b3f440256b56ce83a04fb2\` FOREIGN KEY (\`provinceId\`) REFERENCES \`province\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentAddress\` ADD CONSTRAINT \`FK_de5eb0e55892aa0cf019afb284d\` FOREIGN KEY (\`developmentId\`) REFERENCES \`development\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentProjectType\` ADD CONSTRAINT \`FK_e9c5a726024b87bb10f23570a98\` FOREIGN KEY (\`developmentId\`) REFERENCES \`development\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentProjectTechnique\` ADD CONSTRAINT \`FK_902408e69fa1cf0ed815859e089\` FOREIGN KEY (\`developmentId\`) REFERENCES \`development\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentEvaluation\` ADD CONSTRAINT \`FK_1714596cf3e3e8311a766800289\` FOREIGN KEY (\`developmentId\`) REFERENCES \`development\`(\`id\`) ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentEvaluation\` DROP FOREIGN KEY \`FK_1714596cf3e3e8311a766800289\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentProjectTechnique\` DROP FOREIGN KEY \`FK_902408e69fa1cf0ed815859e089\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentProjectType\` DROP FOREIGN KEY \`FK_e9c5a726024b87bb10f23570a98\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentAddress\` DROP FOREIGN KEY \`FK_de5eb0e55892aa0cf019afb284d\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`developmentAddress\` DROP FOREIGN KEY \`FK_e2721b3f440256b56ce83a04fb2\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`effects\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`effects\` varchar(255) NULL COMMENT 'ผลกระทบจากการเกิด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`chance\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`chance\` varchar(255) NULL COMMENT 'โอกาสที่จะเกิด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectNigthHoldActual\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectDayHoldActual\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectDayBackActual\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`isHoldActual\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`isBackActual\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectNigthHoldPlanned\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectDayHoldPlanned\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`projectDayBackPlanned\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`isHoldPlanned\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`isBackPlanned\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`status\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectTechniques\` varchar(255) NULL COMMENT 'เทคนิควิธีการที่ใช้ในการพัฒนา'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectNigth\` int NULL COMMENT 'จำนวน(คืน)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectDay\` int NULL COMMENT 'จำนวน(วัน)'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectCharacteristics\` varchar(255) NULL COMMENT 'ลักษณะ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`projectType\` varchar(255) NULL COMMENT 'ประเภทโครงการ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`dateStudyEnd\` datetime NULL COMMENT 'วันสิ้นสุดการศึกษาดูงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`dateStudyStart\` datetime NULL COMMENT 'วันเริ่มต้นการศึกษาดูงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`address\` varchar(255) NULL COMMENT 'ที่อยู่'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`suggestions\` varchar(255) NULL COMMENT 'ข้อเสนอเเนะ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`obstacles\` varchar(255) NULL COMMENT 'ปัญหาอุปสรรค'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`results\` varchar(255) NULL COMMENT 'ผลการดำเนิน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`measuRement\` varchar(255) NULL COMMENT 'ระยะเวลาวัดผล'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`calculation\` varchar(255) NULL COMMENT 'วิธีการคำนวณ/เครื่องมือ'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`target\` varchar(255) NULL COMMENT 'เป้าหมาย'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`indicators\` varchar(255) NULL COMMENT 'ตัวชี้วัด'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`metricType\` varchar(255) NULL COMMENT 'ประเภทตัวชี้วัด'`);
|
||||||
|
await queryRunner.query(`DROP TABLE \`developmentEvaluation\``);
|
||||||
|
await queryRunner.query(`DROP TABLE \`developmentProjectTechnique\``);
|
||||||
|
await queryRunner.query(`DROP TABLE \`developmentProjectType\``);
|
||||||
|
await queryRunner.query(`DROP TABLE \`developmentAddress\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
16
src/migration/1712779710145-update_table_dev_refresh2.ts
Normal file
16
src/migration/1712779710145-update_table_dev_refresh2.ts
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||||
|
|
||||||
|
export class UpdateTableDevRefresh21712779710145 implements MigrationInterface {
|
||||||
|
name = 'UpdateTableDevRefresh21712779710145'
|
||||||
|
|
||||||
|
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`dateStudyStart\` datetime NULL COMMENT 'วันเริ่มต้นการศึกษาดูงาน'`);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` ADD \`dateStudyEnd\` datetime NULL COMMENT 'วันสิ้นสุดการศึกษาดูงาน'`);
|
||||||
|
}
|
||||||
|
|
||||||
|
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`dateStudyEnd\``);
|
||||||
|
await queryRunner.query(`ALTER TABLE \`development\` DROP COLUMN \`dateStudyStart\``);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue