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

create index idx_tenant_4fd0f4bc on hrsa_statreportlogs_detail(tenant_key);
/

create index idx_del_up_e798e3ef on hrsa_statreportlogs_detail(delete_type,update_time);
/

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

create index idx_tenan_0ad78df3 on hrsa_statreportlogs(tenant_key);
/

create index idx_del_u_7c93862b on hrsa_statreportlogs(delete_type,update_time);
/