model OrgGroup
This commit is contained in:
parent
3c64d6b790
commit
89e68e5970
9 changed files with 655 additions and 3 deletions
119
src/entities/OrgChild2.ts
Normal file
119
src/entities/OrgChild2.ts
Normal file
|
|
@ -0,0 +1,119 @@
|
|||
import { Entity, Column, ManyToOne, JoinColumn, OneToOne, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { OrgRoot } from "./OrgRoot";
|
||||
import { OrgChild1 } from "./OrgChild1";
|
||||
import { OrgChild3 } from "./OrgChild3";
|
||||
import { OrgChild4 } from "./OrgChild4";
|
||||
|
||||
// ENUM orgChild2Rank
|
||||
enum OrgChild2Rank {
|
||||
DEPARTMENT = "department",
|
||||
OFFICE = "office",
|
||||
DIVISION = "division",
|
||||
SECTION = "section",
|
||||
}
|
||||
|
||||
export class OrgChild2 extends EntityBase {
|
||||
// @Column({
|
||||
// comment: "",
|
||||
// length: 40,
|
||||
// default: "00000000-0000-0000-0000-000000000000",
|
||||
// })
|
||||
// orgChild2Id: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อส่วนราชการ",
|
||||
length: 255,
|
||||
default: "string",
|
||||
})
|
||||
orgChild2Name: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อย่อส่วนราชการ",
|
||||
length: 16,
|
||||
default: "string",
|
||||
})
|
||||
orgChild2ShortName: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "รหัสส่วนราชการ",
|
||||
length: 8,
|
||||
default: "string",
|
||||
})
|
||||
orgChild2Code: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ระดับส่วนราชการ",
|
||||
type: "enum",
|
||||
enum: OrgChild2Rank,
|
||||
// default: OrgChild2Rank.DEPARTMENT,
|
||||
})
|
||||
orgChild2Rank: OrgChild2Rank;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ลำดับที่ของส่วนราชการภายใน Child เดียวกัน",
|
||||
})
|
||||
orgChild2Order: number;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
comment: "หมายเลขโทรศัพท์ที่ติดต่อจากภายนอก",
|
||||
})
|
||||
orgChild2PhoneEx: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
comment: "หมายเลขโทรศัพท์ที่ติดต่อจากภายใน",
|
||||
})
|
||||
orgChild2PhoneIn: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 64,
|
||||
comment: "หมายเลขโทรสาร",
|
||||
})
|
||||
orgChild2Fax: string;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
type: "tinyint",
|
||||
comment: "สถานะของหน่วยงาน", //ปกติ = 1 , ยุกเลิก = 0
|
||||
})
|
||||
orgChild2IsNormal: number;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
default: "00000000-0000-0000-0000-000000000000",
|
||||
})
|
||||
fkOrgRootId: string;
|
||||
|
||||
@Column({
|
||||
length: 40,
|
||||
default: "00000000-0000-0000-0000-000000000000",
|
||||
})
|
||||
fkOrgChild1Id: string;
|
||||
|
||||
@ManyToOne(() => OrgRoot, orgRoot => orgRoot.orgChild2s)
|
||||
@JoinColumn({ name: "fkOrgRootId" })
|
||||
orgRoot: OrgRoot;
|
||||
|
||||
@ManyToOne(() => OrgChild1, orgChild1 => orgChild1.orgChild2s)
|
||||
@JoinColumn({ name: "fkOrgChild1Id" })
|
||||
orgChild1: OrgChild1;
|
||||
|
||||
//child table 3,4
|
||||
@OneToMany(() => OrgChild3, orgChild3 => orgChild3.orgChild2)
|
||||
orgChild3s: OrgChild3[];
|
||||
|
||||
@OneToMany(() => OrgChild4, orgChild4 => orgChild4.orgChild2)
|
||||
orgChild4s: OrgChild4[];
|
||||
|
||||
}
|
||||
export type UpdateOrgChild2 = Partial<OrgChild2>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue