updated appoint by permission
This commit is contained in:
parent
ad5c953aa8
commit
ff2edc685c
3 changed files with 43 additions and 3 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany, JoinColumn } from "typeorm";
|
||||
import { Entity, Column, PrimaryGeneratedColumn, OneToMany, JoinColumn, OneToOne } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { AppointDirector } from "./AppointDirector";
|
||||
import { Personal } from "./Personal";
|
||||
|
||||
@Entity("appoint")
|
||||
export class Appoint extends EntityBase {
|
||||
|
|
@ -37,6 +38,10 @@ export class Appoint extends EntityBase {
|
|||
@OneToMany(() => AppointDirector, (director: AppointDirector) => director.appoint)
|
||||
@JoinColumn({ name: "id" })
|
||||
directors: AppointDirector[];
|
||||
|
||||
@OneToOne(() => Personal, (personal: Personal) => personal.personal_id)
|
||||
@JoinColumn({ name: "profileId" })
|
||||
personal: Personal;
|
||||
}
|
||||
|
||||
export class CreateAppoint {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import { Entity, Column, PrimaryGeneratedColumn, OneToOne, JoinColumn, OneToMany } from "typeorm";
|
||||
import { EntityBase } from "./base/Base";
|
||||
import { Assign } from "./Assign";
|
||||
import { Appoint } from "./Appoint";
|
||||
|
||||
@Entity("personal")
|
||||
export class Personal extends EntityBase {
|
||||
|
|
@ -119,6 +120,10 @@ export class Personal extends EntityBase {
|
|||
@OneToMany(() => Assign, (assign: Assign) => assign.personal_id)
|
||||
@JoinColumn({ name: "personal_id" })
|
||||
assign: Assign[];
|
||||
|
||||
@OneToOne(() => Appoint, (appoint: Appoint) => appoint.profileId)
|
||||
@JoinColumn({ name: "personal_id" })
|
||||
appoint: Appoint;
|
||||
}
|
||||
|
||||
export class CreatePersonal {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue