import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 车辆GPS数据
 */
@Entity('t_operation_vehicle_gps')
export class PushVehicleGpsEntity extends BaseEntity {
  @Index()
  @Column({ comment: '设备序列号' })
  sn: string;

  @Column({ comment: '消息序列号' })
  msgSeq: string;

  @Index()
  @Column({ comment: '消息创建时间', nullable: true })
  createDate: Date;

  @Index()
  @Column({ comment: '车牌号', nullable: true })
  vehicleNo: string;

  @Column({ comment: 'GPS定位时间', nullable: true })
  gpsTime: Date;

  @Column({ comment: '经度', type: 'decimal', precision: 10, scale: 6, nullable: true })
  longitude: number;

  @Column({ comment: '纬度', type: 'decimal', precision: 10, scale: 6, nullable: true })
  latitude: number;

  @Column({ comment: '速度', type: 'decimal', precision: 5, scale: 2, nullable: true })
  speed: number;

  @Column({ comment: '方向角', type: 'int', nullable: true })
  direction: number;

  @Column({ comment: '海拔高度', type: 'decimal', precision: 6, scale: 2, nullable: true })
  elevation: number;

  @Column({ comment: '定位精度' })
  status: string;
}