create table hrsa_statreportlogs_detail
(
  id bigint primary key ,
  create_time datetime,
  update_time datetime,
  creator bigint,
  delete_type int default 0,
  tenant_key nvarchar(10),
  uuid nvarchar(36) not null,
  mainid nvarchar(36) not null,
  dataid nvarchar(50) not null,
  belongdataid nvarchar(50) not null,
  tablename nvarchar(200) not null,
  tablenamelabelid nvarchar(50) default '-1' not null,
  tablenamedesc nvarchar(50) not null,
  fieldname nvarchar(200) not null,
  fieldnamelabelid nvarchar(50) default '-1' not null,
  newvalue nvarchar(max) not null,
  oldvalue nvarchar(max) not null,
  newrealvalue nvarchar(max) not null,
  oldrealvalue nvarchar(max) not null,
  fielddesc nvarchar(200) not null,
  showorder int not null,
  isdetail int default 0 not null
)
GO

create index idx_tenant_4fd0f4bc on hrsa_statreportlogs_detail(tenant_key)
GO

create index idx_del_up_e798e3ef on hrsa_statreportlogs_detail(delete_type,update_time)
GO

create table hrsa_statreportlogs
(
  id bigint primary key ,
  create_time datetime,
  update_time datetime,
  creator bigint,
  delete_type int default 0,
  tenant_key nvarchar(10),
  uuid nvarchar(36) not null,
  log_date datetime not null,
  device nvarchar(500) not null,
  log_operator bigint not null,
  operatorname nvarchar(100),
  targetid bigint default '-1' not null,
  targetname nvarchar(max) not null,
  modulename nvarchar(100) not null,
  functionname nvarchar(100) not null,
  interfacename nvarchar(100) not null,
  requesturl nvarchar(200) not null,
  requesturi nvarchar(200) not null,
  operatetype nvarchar(50) not null,
  operatetypename nvarchar(100) not null,
  operatedesc nvarchar(3000) not null,
  params nvarchar(max) not null,
  belongmainid nvarchar(36) not null,
  clientip nvarchar(50) not null,
  groupid nvarchar(50) not null,
  groupnamelabel nvarchar(1000) not null,
  redoservice nvarchar(200) not null,
  redocontext nvarchar(max) not null,
  cancelservice nvarchar(200) not null,
  cancelcontext nvarchar(max) not null,
  totalruntime bigint default '0' not null,
  mainruntime bigint default '0' not null,
  log_result nvarchar(100) not null,
  fromterminal nvarchar(100) not null,
  resultdesc nvarchar(max) not null,
  old_content nvarchar(3000) not null,
  link_type nvarchar(20) not null,
  link_id bigint default '0' not null,
  old_link_id bigint default '0' not null
)
GO

create index idx_tenan_0ad78df3 on hrsa_statreportlogs(tenant_key)
GO

create index idx_del_u_7c93862b on hrsa_statreportlogs(delete_type,update_time)
GO