api ชื่อโครงการ/กิจกรรม/หลักสูตร
This commit is contained in:
parent
9da7f47cf6
commit
c2af2a3b08
20 changed files with 1819 additions and 57 deletions
95
src/entities/ActualGoal.ts
Normal file
95
src/entities/ActualGoal.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
import { PosLevel } from "./PosLevel";
|
||||
import { PosType } from "./PosType";
|
||||
|
||||
@Entity("actualGoal")
|
||||
export class ActualGoal extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "กลุ่มเป้าหมาย",
|
||||
default: null,
|
||||
})
|
||||
groupTarget: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "กลุ่มเป้าหมายย่อย",
|
||||
default: null,
|
||||
})
|
||||
groupTargetSub: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
position: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posTypeActualId: string;
|
||||
|
||||
@ManyToOne(() => PosType, (posType: PosType) => posType.actualGoals)
|
||||
@JoinColumn({ name: "posTypeActualId" })
|
||||
posTypeActual: PosType;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posLevelActualId: string;
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel: PosLevel) => posLevel.actualGoals)
|
||||
@JoinColumn({ name: "posLevelActualId" })
|
||||
posLevelActual: PosLevel;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)",
|
||||
default: null,
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จำนวน(คน)",
|
||||
default: null,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id โครงการ",
|
||||
default: null,
|
||||
})
|
||||
developmentActualGoalId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentActualGoals)
|
||||
@JoinColumn({ name: "developmentActualGoalId" })
|
||||
developmentActualGoal: Development;
|
||||
}
|
||||
|
||||
export class CreateActualGoal {
|
||||
@Column()
|
||||
groupTarget: string | null;
|
||||
@Column()
|
||||
groupTargetSub: string | null;
|
||||
@Column()
|
||||
position: string | null;
|
||||
@Column()
|
||||
posTypeActualId: string | null;
|
||||
@Column()
|
||||
posLevelActualId: string | null;
|
||||
@Column()
|
||||
type: string | null;
|
||||
@Column()
|
||||
amount: number | null;
|
||||
}
|
||||
|
||||
export type UpdateActualGoal = Partial<CreateActualGoal>;
|
||||
40
src/entities/ActualPeople.ts
Normal file
40
src/entities/ActualPeople.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
|
||||
@Entity("actualPeople")
|
||||
export class ActualPeople extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผู้เกี่ยวข้อง",
|
||||
default: null,
|
||||
})
|
||||
groupTarget: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จำนวน(คน)",
|
||||
default: null,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id โครงการ",
|
||||
default: null,
|
||||
})
|
||||
developmentActualPeopleId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentActualPeoples)
|
||||
@JoinColumn({ name: "developmentActualPeopleId" })
|
||||
developmentActualPeople: Development;
|
||||
}
|
||||
|
||||
export class CreateActualPeople {
|
||||
@Column()
|
||||
groupTarget: string | null;
|
||||
@Column()
|
||||
amount: number | null;
|
||||
}
|
||||
|
||||
export type UpdateActualPeople = Partial<CreateActualPeople>;
|
||||
|
|
@ -1,34 +1,471 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
||||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany, Double } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Province } from "./Province";
|
||||
import { ActualPeople, CreateActualPeople } from "./ActualPeople";
|
||||
import { CreatePlannedPeople, PlannedPeople } from "./PlannedPeople";
|
||||
import { ActualGoal, CreateActualGoal } from "./ActualGoal";
|
||||
import { CreatePlannedGoal, PlannedGoal } from "./PlannedGoal";
|
||||
import { DevelopmentHistory } from "./DevelopmentHistory";
|
||||
|
||||
@Entity("development")
|
||||
export class Development extends EntityBase {
|
||||
@Column({
|
||||
comment: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
length: 255,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ปีงบประมาณ",
|
||||
})
|
||||
year: number;
|
||||
|
||||
}
|
||||
@Column({
|
||||
comment: "ชื่อโครงการ/กิจกรรม/หลักสูตร",
|
||||
length: 255,
|
||||
})
|
||||
projectName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "หลักการและเหตุผล",
|
||||
default: null,
|
||||
})
|
||||
reason: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "วัตถุประสงค์",
|
||||
default: null,
|
||||
})
|
||||
objective: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทตัวชี้วัด",
|
||||
default: null,
|
||||
})
|
||||
metricType: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตัวชี้วัด",
|
||||
default: null,
|
||||
})
|
||||
indicators: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เป้าหมาย",
|
||||
default: null,
|
||||
})
|
||||
target: 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,
|
||||
})
|
||||
project: string;
|
||||
|
||||
@Column({
|
||||
comment: "ผ่านการพิจาณา ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ",
|
||||
default: false,
|
||||
})
|
||||
isPassAllocate: boolean;
|
||||
|
||||
@Column({
|
||||
comment:
|
||||
"ผ่านการพิจารณา ไม่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ แต่ได้รับการจัดสรรเงินนอกงบประมาณ",
|
||||
default: false,
|
||||
})
|
||||
isPassNoAllocate: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "ไม่ผ่านการพิจารณา แต่ได้รับการจัดสรรเงินนอกงบประมาณ",
|
||||
default: false,
|
||||
})
|
||||
isNoPass: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "แต่ได้รับการจัดสรรงบประมาณตามข้อบัญญัติ",
|
||||
default: false,
|
||||
})
|
||||
isBudget: boolean;
|
||||
|
||||
@Column({
|
||||
comment: "แต่ได้รับการจัดสรรเงินนอกงบประมาณ",
|
||||
default: false,
|
||||
})
|
||||
isOutBudget: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่เริ่มต้น",
|
||||
default: null,
|
||||
})
|
||||
dateStart: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "datetime",
|
||||
comment: "วันที่สิ้นสุด",
|
||||
default: null,
|
||||
})
|
||||
dateEnd: Date;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "รวมระยะเวลา (วัน)",
|
||||
default: null,
|
||||
})
|
||||
totalDate: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ที่อยู่",
|
||||
default: null,
|
||||
})
|
||||
address: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จังหวัด",
|
||||
default: null,
|
||||
})
|
||||
provinceId: string;
|
||||
|
||||
@ManyToOne(() => Province, (province: Province) => province.developments)
|
||||
@JoinColumn({ name: "provinceId" })
|
||||
province: Province;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทงบประมาณ",
|
||||
default: null,
|
||||
})
|
||||
budget: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จํานวนงบประมาณที่ขอรับการจัดสรรฯ",
|
||||
default: 0,
|
||||
type: "double",
|
||||
})
|
||||
accept: Double;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จํานวนงบประมาณที่ได้รับการจัดสรรฯ",
|
||||
default: 0,
|
||||
type: "double",
|
||||
})
|
||||
receive: Double;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จํานวนงบประมาณที่ได้รับอนุมัติ",
|
||||
default: 0,
|
||||
type: "double",
|
||||
})
|
||||
approved: Double;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จํานวนงบประมาณที่จ่ายจริง",
|
||||
default: 0,
|
||||
type: "double",
|
||||
})
|
||||
budgetPay: Double;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเด็นความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
issues: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "โอกาสที่จะเกิด",
|
||||
default: null,
|
||||
})
|
||||
chance: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผลกระทบจากการเกิด",
|
||||
default: null,
|
||||
})
|
||||
effects: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
riskLevel: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เเนวทางการบริหารความเสี่ยง",
|
||||
default: null,
|
||||
})
|
||||
riskManagement: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประโยชน์ที่คาดว่าจะได้รับ",
|
||||
default: null,
|
||||
})
|
||||
expect: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "หัวข้อ/ประเด็นการฝึกอบรม ศึกษาดูงาน",
|
||||
default: null,
|
||||
})
|
||||
topicAcademic: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "สถานที่ฝึกอบรม ศึกษาดูงาน",
|
||||
default: null,
|
||||
})
|
||||
addressAcademic: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จังหวัด(ข้อมูลวิชาการ)",
|
||||
default: null,
|
||||
})
|
||||
provinceActualId: string;
|
||||
|
||||
@ManyToOne(() => Province, (province: Province) => province.developmentActuals)
|
||||
@JoinColumn({ name: "provinceActualId" })
|
||||
provinceActual: 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(
|
||||
() => DevelopmentHistory,
|
||||
(developmentHistory: DevelopmentHistory) => developmentHistory.development,
|
||||
)
|
||||
developmentHistorys: DevelopmentHistory[];
|
||||
}
|
||||
export class CreateDevelopment {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
year: number;
|
||||
@Column()
|
||||
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()
|
||||
provinceId: string | null;
|
||||
@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()
|
||||
actualPeoples: CreateActualPeople[];
|
||||
@Column()
|
||||
plannedPeoples: CreatePlannedPeople[];
|
||||
@Column()
|
||||
actualGoals: CreateActualGoal[];
|
||||
@Column()
|
||||
plannedGoals: CreatePlannedGoal[];
|
||||
}
|
||||
|
||||
export class UpdateDevelopment {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
year: number;
|
||||
@Column()
|
||||
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()
|
||||
provinceId: string | null;
|
||||
@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()
|
||||
actualPeoples: CreateActualPeople[];
|
||||
@Column()
|
||||
plannedPeoples: CreatePlannedPeople[];
|
||||
@Column()
|
||||
actualGoals: CreateActualGoal[];
|
||||
@Column()
|
||||
plannedGoals: CreatePlannedGoal[];
|
||||
}
|
||||
|
|
|
|||
154
src/entities/DevelopmentHistory.ts
Normal file
154
src/entities/DevelopmentHistory.ts
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { PosLevel } from "./PosLevel";
|
||||
import { PosType } from "./PosType";
|
||||
import { Development } from "./Development";
|
||||
|
||||
@Entity("developmentHistory")
|
||||
export class DevelopmentHistory extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ยศ",
|
||||
length: 40,
|
||||
default: null,
|
||||
})
|
||||
rank: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำนำหน้าชื่อ",
|
||||
length: 40,
|
||||
default: null,
|
||||
})
|
||||
prefix: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อ",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
firstName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "นามสกุล",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
lastName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลขประจำตัวประชาชน",
|
||||
default: null,
|
||||
length: 13,
|
||||
})
|
||||
citizenId: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่ง",
|
||||
default: null,
|
||||
length: 255,
|
||||
})
|
||||
position: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "ไอดีระดับตำแหน่ง",
|
||||
})
|
||||
posLevelId: string | null;
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel) => posLevel.developmentHistorys)
|
||||
@JoinColumn({ name: "posLevelId" })
|
||||
posLevel: PosLevel;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 40,
|
||||
comment: "ไอดีประเภทตำแหน่ง",
|
||||
})
|
||||
posTypeId: string | null;
|
||||
|
||||
@ManyToOne(() => PosType, (posType) => posType.developmentHistorys)
|
||||
@JoinColumn({ name: "posTypeId" })
|
||||
posType: PosType;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "โครงการ/หลักสูตรการฝึกอบรม",
|
||||
default: null,
|
||||
})
|
||||
developmentId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentHistorys)
|
||||
@JoinColumn({ name: "developmentId" })
|
||||
development: Development;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "เลขที่คำสั่ง/เลขที่หนังสืออนุมัติ",
|
||||
default: null,
|
||||
length: 255,
|
||||
})
|
||||
order: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "คำสั่งลงวันที่/หนังสืออนุมัติลงวันที่",
|
||||
default: null,
|
||||
length: 255,
|
||||
})
|
||||
dateOrder: string;
|
||||
}
|
||||
export class CreateDevelopmentHistory {
|
||||
@Column()
|
||||
rank: string | null;
|
||||
@Column()
|
||||
prefix: string | null;
|
||||
@Column()
|
||||
firstName: string | null;
|
||||
@Column()
|
||||
lastName: string | null;
|
||||
@Column()
|
||||
citizenId: string;
|
||||
@Column()
|
||||
position: string | null;
|
||||
@Column()
|
||||
posLevelId: string | null;
|
||||
@Column()
|
||||
posTypeId: string | null;
|
||||
@Column()
|
||||
developmentId: string;
|
||||
@Column()
|
||||
order: string | null;
|
||||
@Column()
|
||||
dateOrder: string | null;
|
||||
}
|
||||
|
||||
export class UpdateDevelopmentHistory {
|
||||
@Column()
|
||||
rank: string | null;
|
||||
@Column()
|
||||
prefix: string | null;
|
||||
@Column()
|
||||
firstName: string | null;
|
||||
@Column()
|
||||
lastName: string | null;
|
||||
@Column()
|
||||
citizenId: string;
|
||||
@Column()
|
||||
position: string | null;
|
||||
@Column()
|
||||
posLevelId: string | null;
|
||||
@Column()
|
||||
posTypeId: string | null;
|
||||
@Column()
|
||||
developmentId: string;
|
||||
@Column()
|
||||
order: string | null;
|
||||
@Column()
|
||||
dateOrder: string | null;
|
||||
}
|
||||
61
src/entities/EmployeePosLevel.ts
Normal file
61
src/entities/EmployeePosLevel.ts
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EmployeePosType } from "./EmployeePosType";
|
||||
|
||||
enum EmployeePosLevelAuthoritys {
|
||||
HEAD = "HEAD",
|
||||
DEPUTY = "DEPUTY",
|
||||
GOVERNOR = "GOVERNOR",
|
||||
}
|
||||
@Entity("employeePosLevel")
|
||||
export class EmployeePosLevel extends EntityBase {
|
||||
@Column({
|
||||
comment: "ชื่อระดับชั้นงาน",
|
||||
type: "int",
|
||||
})
|
||||
posLevelName: number;
|
||||
|
||||
@Column({
|
||||
comment: "ระดับของระดับชั้นงาน",
|
||||
type: "int",
|
||||
})
|
||||
posLevelRank: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment:
|
||||
"ผู้มีอำนาจสั่งบรรจุของระดับนี้ head = หัวหน้าหน่วยงาน , deputy = ปลัด , governor = ผู้ว่าฯ",
|
||||
type: "enum",
|
||||
enum: EmployeePosLevelAuthoritys,
|
||||
default: null,
|
||||
})
|
||||
posLevelAuthority: EmployeePosLevelAuthoritys;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "คีย์นอก(FK)ของตาราง employeePosType",
|
||||
})
|
||||
posTypeId: string;
|
||||
|
||||
@ManyToOne(() => EmployeePosType, (posType: EmployeePosType) => posType.posLevels)
|
||||
@JoinColumn({ name: "posTypeId" })
|
||||
posType: EmployeePosType;
|
||||
}
|
||||
|
||||
export class CreateEmployeePosLevel {
|
||||
@Column()
|
||||
posLevelName: number;
|
||||
|
||||
@Column()
|
||||
posLevelRank: number;
|
||||
|
||||
@Column()
|
||||
posLevelAuthority: string;
|
||||
|
||||
@Column("uuid")
|
||||
posTypeId: string;
|
||||
}
|
||||
|
||||
export type UpdateEmployeePosLevel = Partial<CreateEmployeePosLevel> & {
|
||||
posLevelAuthority: EmployeePosLevelAuthoritys;
|
||||
};
|
||||
43
src/entities/EmployeePosType.ts
Normal file
43
src/entities/EmployeePosType.ts
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
import { Entity, Column, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { EmployeePosLevel } from "./EmployeePosLevel";
|
||||
|
||||
@Entity("employeePosType")
|
||||
export class EmployeePosType extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อกลุ่มงาน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posTypeName: string;
|
||||
|
||||
@Column({
|
||||
comment: "ระดับของกลุ่มงาน",
|
||||
})
|
||||
posTypeRank: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อย่อกลุ่มงาน",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posTypeShortName: string;
|
||||
|
||||
@OneToMany(() => EmployeePosLevel, (posLevel: EmployeePosLevel) => posLevel.posType)
|
||||
posLevels: EmployeePosLevel[];
|
||||
}
|
||||
|
||||
export class CreateEmployeePosType {
|
||||
@Column()
|
||||
posTypeName: string;
|
||||
|
||||
@Column()
|
||||
posTypeRank: number;
|
||||
|
||||
@Column()
|
||||
posTypeShortName: string;
|
||||
}
|
||||
|
||||
export type UpdateEmployeePosType = Partial<CreateEmployeePosType>;
|
||||
95
src/entities/PlannedGoal.ts
Normal file
95
src/entities/PlannedGoal.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
import { PosType } from "./PosType";
|
||||
import { PosLevel } from "./PosLevel";
|
||||
|
||||
@Entity("plannedGoal")
|
||||
export class PlannedGoal extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "กลุ่มเป้าหมาย",
|
||||
default: null,
|
||||
})
|
||||
groupTarget: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "กลุ่มเป้าหมายย่อย",
|
||||
default: null,
|
||||
})
|
||||
groupTargetSub: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
position: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภทตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posTypePlannedId: string;
|
||||
|
||||
@ManyToOne(() => PosType, (posType: PosType) => posType.plannedGoals)
|
||||
@JoinColumn({ name: "posTypePlannedId" })
|
||||
posTypePlanned: PosType;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posLevelPlannedId: string;
|
||||
|
||||
@ManyToOne(() => PosLevel, (posLevel: PosLevel) => posLevel.plannedGoals)
|
||||
@JoinColumn({ name: "posLevelPlannedId" })
|
||||
posLevelPlanned: PosLevel;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ประเภท(กลุ่มอาชีพ คุณสมบัติ)",
|
||||
default: null,
|
||||
})
|
||||
type: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จำนวน(คน)",
|
||||
default: null,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id โครงการ",
|
||||
default: null,
|
||||
})
|
||||
developmentPlannedGoalId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentPlannedGoals)
|
||||
@JoinColumn({ name: "developmentPlannedGoalId" })
|
||||
developmentPlannedGoal: Development;
|
||||
}
|
||||
|
||||
export class CreatePlannedGoal {
|
||||
@Column()
|
||||
groupTarget: string | null;
|
||||
@Column()
|
||||
groupTargetSub: string | null;
|
||||
@Column()
|
||||
position: string | null;
|
||||
@Column()
|
||||
posTypePlannedId: string | null;
|
||||
@Column()
|
||||
posLevelPlannedId: string | null;
|
||||
@Column()
|
||||
type: string | null;
|
||||
@Column()
|
||||
amount: number | null;
|
||||
}
|
||||
|
||||
export type UpdatePlannedGoal = Partial<CreatePlannedGoal>;
|
||||
40
src/entities/PlannedPeople.ts
Normal file
40
src/entities/PlannedPeople.ts
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
|
||||
@Entity("plannedPeople")
|
||||
export class PlannedPeople extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ผู้เกี่ยวข้อง",
|
||||
default: null,
|
||||
})
|
||||
groupTarget: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จำนวน(คน)",
|
||||
default: null,
|
||||
})
|
||||
amount: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "id โครงการ",
|
||||
default: null,
|
||||
})
|
||||
developmentPlannedPeopleId: string;
|
||||
|
||||
@ManyToOne(() => Development, (development: Development) => development.developmentPlannedPeoples)
|
||||
@JoinColumn({ name: "developmentPlannedPeopleId" })
|
||||
developmentPlannedPeople: Development;
|
||||
}
|
||||
|
||||
export class CreatePlannedPeople {
|
||||
@Column()
|
||||
groupTarget: string | null;
|
||||
@Column()
|
||||
amount: number | null;
|
||||
}
|
||||
|
||||
export type UpdatePlannedPeople = Partial<CreatePlannedPeople>;
|
||||
74
src/entities/PosLevel.ts
Normal file
74
src/entities/PosLevel.ts
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { PosType } from "./PosType";
|
||||
import { ActualGoal } from "./ActualGoal";
|
||||
import { PlannedGoal } from "./PlannedGoal";
|
||||
import { DevelopmentHistory } from "./DevelopmentHistory";
|
||||
|
||||
enum PosLevelAuthority {
|
||||
HEAD = "HEAD",
|
||||
DEPUTY = "DEPUTY",
|
||||
GOVERNOR = "GOVERNOR",
|
||||
}
|
||||
@Entity("posLevel")
|
||||
export class PosLevel extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อระดับตำแหน่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posLevelName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับของระดับตำแหน่ง",
|
||||
default: null,
|
||||
})
|
||||
posLevelRank: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment:
|
||||
"ผู้มีอำนาจสั่งบรรจุของระดับนี้ head = หัวหน้าหน่วยงาน , deputy = ปลัด , governor = ผู้ว่าฯ",
|
||||
type: "enum",
|
||||
enum: PosLevelAuthority,
|
||||
default: null,
|
||||
})
|
||||
posLevelAuthority: PosLevelAuthority;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
comment: "เป็นระดับของประเภทตำแหน่งใด",
|
||||
})
|
||||
posTypeId: string;
|
||||
|
||||
@ManyToOne(() => PosType, (posType: PosType) => posType.posLevels)
|
||||
@JoinColumn({ name: "posTypeId" })
|
||||
posType: PosType;
|
||||
|
||||
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.posLevelActual)
|
||||
actualGoals: ActualGoal[];
|
||||
|
||||
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.posLevelPlanned)
|
||||
plannedGoals: PlannedGoal[];
|
||||
|
||||
@OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posLevel)
|
||||
developmentHistorys: DevelopmentHistory[];
|
||||
}
|
||||
|
||||
export class CreatePosLevel {
|
||||
@Column()
|
||||
posLevelName: string;
|
||||
|
||||
@Column()
|
||||
posLevelRank: number;
|
||||
|
||||
@Column()
|
||||
posLevelAuthority: string;
|
||||
|
||||
@Column("uuid")
|
||||
posTypeId: string;
|
||||
}
|
||||
|
||||
export type UpdatePosLevel = Partial<CreatePosLevel> & { posLevelAuthority?: PosLevelAuthority };
|
||||
47
src/entities/PosType.ts
Normal file
47
src/entities/PosType.ts
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import { Entity, Column, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { PosLevel } from "./PosLevel";
|
||||
import { ActualGoal } from "./ActualGoal";
|
||||
import { PlannedGoal } from "./PlannedGoal";
|
||||
import { DevelopmentHistory } from "./DevelopmentHistory";
|
||||
|
||||
@Entity("posType")
|
||||
export class PosType extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อประเภทตำแหน่ง (ทั่วไป วิชาการ อำนวยการ บริหาร)",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
posTypeName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment:
|
||||
"ระดับของประเภทตำแหน่ง ไว้ใช้ระบุว่าประเภทตำแหน่งนี้อยู่ระดับสูงหรือต่ำกว่ากัน โดย 1 = ต่ำกว่า , มากกว่า 1 = สูงกว่า ทั่วไป = 1 วิชาการ = 2 อำนวยการ = 3 บริหาร = 4",
|
||||
default: null,
|
||||
})
|
||||
posTypeRank: number;
|
||||
|
||||
@OneToMany(() => PosLevel, (posLevel: PosLevel) => posLevel.posType)
|
||||
posLevels: PosLevel[];
|
||||
|
||||
@OneToMany(() => ActualGoal, (actualGoal: ActualGoal) => actualGoal.posTypeActual)
|
||||
actualGoals: ActualGoal[];
|
||||
|
||||
@OneToMany(() => PlannedGoal, (plannedGoal: PlannedGoal) => plannedGoal.posTypePlanned)
|
||||
plannedGoals: PlannedGoal[];
|
||||
|
||||
@OneToMany(() => DevelopmentHistory, (developmentHistory) => developmentHistory.posType)
|
||||
developmentHistorys: DevelopmentHistory[];
|
||||
}
|
||||
|
||||
export class CreatePosType {
|
||||
@Column()
|
||||
posTypeName: string;
|
||||
|
||||
@Column()
|
||||
posTypeRank: number;
|
||||
}
|
||||
|
||||
export type UpdatePosType = Partial<CreatePosType>;
|
||||
27
src/entities/Province.ts
Normal file
27
src/entities/Province.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { Entity, Column, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Development } from "./Development";
|
||||
|
||||
@Entity("province")
|
||||
export class Province extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "จังหวัด",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@OneToMany(() => Development, (development: Development) => development.province)
|
||||
developments: Development[];
|
||||
|
||||
@OneToMany(() => Development, (development: Development) => development.provinceActual)
|
||||
developmentActuals: Development[];
|
||||
}
|
||||
|
||||
export class CreateProvince {
|
||||
@Column()
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type UpdateProvince = Partial<CreateProvince>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue