import { PrimaryKeyProp, defineEntity, p } from '@mikro-orm/core';

export class IcrClassdatacollect {
  [PrimaryKeyProp]?: 'Id';
  Id!: bigint;
  SchoolId!: bigint;
  GradeId!: bigint;
  ClassId!: bigint;
  ObjectivenNum!: number;
  SubjectiveNum!: number;
  YesNoNum!: number;
  PKNum!: number;
  CollectNum!: number;
  Revision!: number;
  CreatedBy?: bigint;
  CreatedTime!: Date;
  UpdatedBy?: bigint;
  UpdatedTime?: Date;
  IsDeleted!: unknown;
}

export const IcrClassdatacollectSchema = defineEntity({
  class: IcrClassdatacollect,
  properties: {
    Id: p.bigint().primary().name('Id').unsigned(false).autoincrement(false).comment('主键Id'),
    SchoolId: p.bigint().name('SchoolId').comment('学校id'),
    GradeId: p.bigint().name('GradeId').comment('年级id'),
    ClassId: p.bigint().name('ClassId').comment('班级id'),
    ObjectivenNum: p.integer().name('ObjectivenNum').comment('客观题互动次数'),
    SubjectiveNum: p.integer().name('SubjectiveNum').comment('主观题互动次数'),
    YesNoNum: p.integer().name('YesNoNum').comment('Y/N互动次数'),
    PKNum: p.integer().name('PKNum').comment('PK互动次数'),
    CollectNum: p.integer().name('CollectNum').comment('采集次数'),
    Revision: p.integer().name('Revision').comment('乐观锁'),
    CreatedBy: p.bigint().name('CreatedBy').nullable().comment('创建者用户Id'),
    CreatedTime: p.datetime().name('CreatedTime').length(3).comment('创建时间'),
    UpdatedBy: p.bigint().name('UpdatedBy').nullable().comment('修改者用户Id'),
    UpdatedTime: p.datetime().name('UpdatedTime').length(3).nullable().comment('修改时间'),
    IsDeleted: p.array().name('IsDeleted').comment('是否删除'),
  },
});
