Template สำหรับลงในตำแหน่ง/เงินเดือน
This commit is contained in:
parent
40440ca250
commit
9d755fc8ff
5 changed files with 285 additions and 18 deletions
45
src/entities/CommandSalary.ts
Normal file
45
src/entities/CommandSalary.ts
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
import { Entity, Column, JoinColumn, ManyToOne } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { CommandSys } from "./CommandSys";
|
||||
|
||||
@Entity("commandSalary")
|
||||
export class CommandSalary extends EntityBase {
|
||||
@Column({
|
||||
nullable: true,
|
||||
comment: "ชื่อคำสั่ง",
|
||||
length: 255,
|
||||
default: null,
|
||||
})
|
||||
name: string;
|
||||
|
||||
@Column({
|
||||
comment: "สถานะการใช้งาน",
|
||||
default: true,
|
||||
})
|
||||
isActive: boolean;
|
||||
|
||||
@Column({
|
||||
nullable: true,
|
||||
length: 255,
|
||||
comment: "คีย์นอก(FK)ของตาราง CommandSys",
|
||||
default: null,
|
||||
})
|
||||
commandSysId: string;
|
||||
|
||||
@ManyToOne(() => CommandSys, (commandSys) => commandSys.commandSalarys)
|
||||
@JoinColumn({ name: "commandSysId" })
|
||||
commandSalarySys: CommandSys;
|
||||
}
|
||||
|
||||
export class CreateCommandSalary {
|
||||
@Column()
|
||||
name: string;
|
||||
|
||||
@Column()
|
||||
isActive: boolean;
|
||||
|
||||
@Column()
|
||||
commandSysId: string;
|
||||
}
|
||||
|
||||
export type UpdateCommandSalary = Partial<CreateCommandSalary>;
|
||||
|
|
@ -7,6 +7,7 @@ import {
|
|||
OneToMany,
|
||||
} from "typeorm";
|
||||
import { CommandType } from "./CommandType";
|
||||
import { CommandSalary } from "./CommandSalary";
|
||||
|
||||
@Entity("commandSys")
|
||||
export class CommandSys {
|
||||
|
|
@ -60,6 +61,9 @@ export class CommandSys {
|
|||
|
||||
@OneToMany(() => CommandType, (commandType) => commandType.commandTypeSys)
|
||||
commandTypes: CommandType[];
|
||||
|
||||
@OneToMany(() => CommandSalary, (commandSalary) => commandSalary.commandSalarySys)
|
||||
commandSalarys: CommandSalary[];
|
||||
}
|
||||
|
||||
export class CreateCommandSys {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue