INIT
This commit is contained in:
107
backend/src/mpt/entities/mpt.entity.ts
Normal file
107
backend/src/mpt/entities/mpt.entity.ts
Normal file
@@ -0,0 +1,107 @@
|
||||
import { BaseModel } from 'src/common/entities/base.entity';
|
||||
import { FarmModel } from 'src/farm/entities/farm.entity';
|
||||
import {
|
||||
Column,
|
||||
Entity,
|
||||
JoinColumn,
|
||||
ManyToOne,
|
||||
PrimaryGeneratedColumn,
|
||||
} from 'typeorm';
|
||||
|
||||
/**
|
||||
* 혈액화학검사 결과 (1개체 N검사)
|
||||
*/
|
||||
@Entity({ name: 'tb_mpt' })
|
||||
export class MptModel extends BaseModel {
|
||||
@PrimaryGeneratedColumn({
|
||||
name: 'pk_mpt_no',
|
||||
type: 'int',
|
||||
comment: 'MPT 번호 (PK)',
|
||||
})
|
||||
pkMptNo: number;
|
||||
|
||||
@Column({
|
||||
name: 'cow_short_no',
|
||||
type: 'varchar',
|
||||
length: 4,
|
||||
nullable: true,
|
||||
comment: '개체 요약번호',
|
||||
})
|
||||
cowShortNo: string;
|
||||
|
||||
@Column({
|
||||
name: 'fk_farm_no',
|
||||
type: 'int',
|
||||
nullable: true,
|
||||
comment: '농장번호 FK',
|
||||
})
|
||||
fkFarmNo: number;
|
||||
|
||||
@Column({ name: 'test_dt', type: 'date', nullable: true, comment: '검사일자' })
|
||||
testDt: Date;
|
||||
|
||||
@Column({ name: 'month_age', type: 'int', nullable: true, comment: '월령' })
|
||||
monthAge: number;
|
||||
|
||||
@Column({ name: 'milk_yield', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '유량' })
|
||||
milkYield: number;
|
||||
|
||||
@Column({ name: 'parity', type: 'int', nullable: true, comment: '산차' })
|
||||
parity: number;
|
||||
|
||||
@Column({ name: 'glucose', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '혈당' })
|
||||
glucose: number;
|
||||
|
||||
@Column({ name: 'cholesterol', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '콜레스테롤' })
|
||||
cholesterol: number;
|
||||
|
||||
@Column({ name: 'nefa', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '유리지방산(NEFA)' })
|
||||
nefa: number;
|
||||
|
||||
@Column({ name: 'bcs', type: 'decimal', precision: 5, scale: 2, nullable: true, comment: 'BCS' })
|
||||
bcs: number;
|
||||
|
||||
@Column({ name: 'total_protein', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '총단백질' })
|
||||
totalProtein: number;
|
||||
|
||||
@Column({ name: 'albumin', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '알부민' })
|
||||
albumin: number;
|
||||
|
||||
@Column({ name: 'globulin', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '총글로불린' })
|
||||
globulin: number;
|
||||
|
||||
@Column({ name: 'ag_ratio', type: 'decimal', precision: 5, scale: 2, nullable: true, comment: 'A/G 비율' })
|
||||
agRatio: number;
|
||||
|
||||
@Column({ name: 'bun', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '요소태질소(BUN)' })
|
||||
bun: number;
|
||||
|
||||
@Column({ name: 'ast', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: 'AST' })
|
||||
ast: number;
|
||||
|
||||
@Column({ name: 'ggt', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: 'GGT' })
|
||||
ggt: number;
|
||||
|
||||
@Column({ name: 'fatty_liver_idx', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '지방간지수' })
|
||||
fattyLiverIdx: number;
|
||||
|
||||
@Column({ name: 'calcium', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '칼슘' })
|
||||
calcium: number;
|
||||
|
||||
@Column({ name: 'phosphorus', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '인' })
|
||||
phosphorus: number;
|
||||
|
||||
@Column({ name: 'ca_p_ratio', type: 'decimal', precision: 5, scale: 2, nullable: true, comment: '칼슘/인 비율' })
|
||||
caPRatio: number;
|
||||
|
||||
@Column({ name: 'magnesium', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '마그네슘' })
|
||||
magnesium: number;
|
||||
|
||||
@Column({ name: 'creatinine', type: 'decimal', precision: 10, scale: 2, nullable: true, comment: '크레아틴' })
|
||||
creatinine: number;
|
||||
|
||||
// Relations
|
||||
@ManyToOne(() => FarmModel, { onDelete: 'CASCADE' })
|
||||
@JoinColumn({ name: 'fk_farm_no' })
|
||||
farm: FarmModel;
|
||||
}
|
||||
Reference in New Issue
Block a user