DROP TABLE IF EXISTS `T_USERDATA`;
CREATE TABLE `T_USERDATA` (
  `UUID` varchar(32) NOT NULL COMMENT '主键',
  `PARTY_ID` varchar(32) DEFAULT NULL,
  `RECHARGE` double DEFAULT NULL,
  `WITHDRAW` double DEFAULT NULL,
  `AMOUNT` double DEFAULT NULL,
  `FEE` double DEFAULT NULL,
  `CREATE_TIME` datetime DEFAULT NULL,
  `ORDER_INCOME` double DEFAULT NULL,
  PRIMARY KEY (`UUID`),
  KEY `INDEX_USERDATA_PARTY_ID` (`PARTY_ID`,`CREATE_TIME`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

DROP TABLE IF EXISTS `T_AGENT`;
CREATE TABLE `T_AGENT` (
`UUID`  varchar(32) NOT NULL ,
`PARTY_ID`  varchar(32) NOT NULL ,
`PARENT_PARTY_ID`  varchar(32) ,
PRIMARY KEY (`UUID`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

create index INDEX_AGENT_PARTY_ID on T_AGENT (
   PARTY_ID
);
create index INDEX_AGENT_PARENT_PARTY_ID on T_AGENT (
   PARENT_PARTY_ID
);

DROP TABLE IF EXISTS `T_USER`;
CREATE TABLE `T_USER` (
`UUID`  varchar(32) NOT NULL ,
`PARTY_ID`  varchar(32) NOT NULL ,
`PARENT_PARTY_ID`  varchar(32) ,
PRIMARY KEY (`UUID`)
)ENGINE=InnoDB DEFAULT CHARSET=utf8;

create index INDEX_USER_PARTY_ID on T_USER (
   PARTY_ID
);
create index INDEX_USER_PARENT_PARTY_ID on T_USER (
   PARENT_PARTY_ID
);


