wangzhibo
2026-07-18 167510c1019f2c72ce9a544daec91aa5fe5409a5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';
 
/**
 * ETL任务日志
 */
@Entity('t_report_joblog')
@Index(['jobName', 'dataDate'], { unique: true })
export class ReportJoblogEntity extends BaseEntity {
  @Index()
  @Column({ comment: '任务类型: SITE_DAILY(站点日汇总), DEPT_DAILY(部门日汇总)' })
  jobName: string;
 
  @Index()
  @Column({ comment: '数据目标日期', type: 'date' })
  dataDate: string;
 
  @Column({ type: 'datetime',comment: '开始时间', nullable: true })
  startTime: Date;
 
  @Column({ type: 'datetime',comment: '结束时间', nullable: true })
  endTime: Date;
 
  @Column({
    type: 'enum',
    enum: ['INIT', 'RUNNING', 'SUCCESS', 'FAILED'],
    default: 'INIT',
    comment: '状态: 未开始, 运行中, 成功, 失败',
  })
  status: 'INIT' | 'RUNNING' | 'SUCCESS' | 'FAILED';
 
  @Column({ comment: '处理记录数', default: 0 })
  recordsProcessed: number;
 
  @Column({ comment: '失败次数', default: 0 })
  failedCount: number;
 
  @Column({ comment: '错误堆栈信息', type: 'text', nullable: true })
  errorMessage: string;
}