| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- import { Entity, Column, PrimaryGeneratedColumn, ManyToOne, JoinColumn, Index } from 'typeorm';
- import { Platform } from '@d8d/allin-platform-module/entities';
- @Entity('employer_company')
- @Index('idx_company_name_platform', ['companyName', 'platformId'], { unique: true })
- export class Company {
- @PrimaryGeneratedColumn({
- name: 'company_id',
- type: 'int',
- unsigned: true,
- comment: '公司ID'
- })
- id!: number;
- @Column({
- name: 'platform_id',
- type: 'int',
- unsigned: true,
- nullable: true,
- comment: '平台ID'
- })
- platformId!: number | null;
- @Column({
- name: 'company_name',
- type: 'varchar',
- length: 100,
- nullable: false,
- comment: '公司名称'
- })
- companyName!: string;
- @Column({
- name: 'contact_person',
- type: 'varchar',
- length: 50,
- nullable: true,
- comment: '联系人'
- })
- contactPerson!: string | null;
- @Column({
- name: 'contact_phone',
- type: 'varchar',
- length: 20,
- nullable: true,
- comment: '联系电话'
- })
- contactPhone!: string | null;
- @Column({
- name: 'contact_email',
- type: 'varchar',
- length: 100,
- nullable: true,
- comment: '联系邮箱'
- })
- contactEmail!: string | null;
- @Column({
- name: 'address',
- type: 'varchar',
- length: 200,
- nullable: true,
- comment: '地址'
- })
- address!: string | null;
- @Column({
- name: 'status',
- type: 'int',
- default: 1,
- comment: '状态:1-正常,0-禁用'
- })
- status!: number;
- @Column({
- name: 'create_time',
- type: 'timestamp',
- default: () => 'CURRENT_TIMESTAMP',
- comment: '创建时间'
- })
- createTime!: Date;
- @Column({
- name: 'update_time',
- type: 'timestamp',
- default: () => 'CURRENT_TIMESTAMP',
- onUpdate: 'CURRENT_TIMESTAMP',
- comment: '更新时间'
- })
- updateTime!: Date;
- @ManyToOne(() => Platform, { eager: true })
- @JoinColumn({ name: 'platform_id' })
- platform?: Platform;
- }
|