_copytrade_dump.sql 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036
  1. -- MySQL dump 10.13 Distrib 9.5.0, for macos15.4 (arm64)
  2. --
  3. -- Host: rm-3nsx177900f04a7gvwo.mysql.rds.aliyuncs.com Database: copytrade
  4. -- ------------------------------------------------------
  5. -- Server version 5.7.44-log
  6. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  7. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  8. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  9. /*!50503 SET NAMES utf8mb4 */;
  10. /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
  11. /*!40103 SET TIME_ZONE='+00:00' */;
  12. /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
  13. /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
  14. /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
  15. /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
  16. SET @MYSQLDUMP_TEMP_LOG_BIN = @@SESSION.SQL_LOG_BIN;
  17. SET @@SESSION.SQL_LOG_BIN= 0;
  18. --
  19. -- GTID state at the beginning of the backup
  20. --
  21. SET @@GLOBAL.GTID_PURGED=/*!80000 '+'*/ 'aa235d8a-12eb-11f1-ac23-00163e0a62c3:1-38906';
  22. --
  23. -- Table structure for table `card_info_application`
  24. --
  25. DROP TABLE IF EXISTS `card_info_application`;
  26. /*!40101 SET @saved_cs_client = @@character_set_client */;
  27. /*!50503 SET character_set_client = utf8mb4 */;
  28. CREATE TABLE `card_info_application` (
  29. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  30. `name` varchar(128) NOT NULL COMMENT '姓名',
  31. `addr` varchar(128) NOT NULL COMMENT '邮寄地址',
  32. `phone` varchar(128) NOT NULL COMMENT '联系电话',
  33. `number_cards` int(10) NOT NULL COMMENT '申请卡数量',
  34. `info` varchar(256) DEFAULT NULL COMMENT '交易信息',
  35. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  36. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  37. PRIMARY KEY (`id`)
  38. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='卡片申请信息';
  39. /*!40101 SET character_set_client = @saved_cs_client */;
  40. --
  41. -- Table structure for table `charge_money`
  42. --
  43. DROP TABLE IF EXISTS `charge_money`;
  44. /*!40101 SET @saved_cs_client = @@character_set_client */;
  45. /*!50503 SET character_set_client = utf8mb4 */;
  46. CREATE TABLE `charge_money` (
  47. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  48. `member_id` bigint(20) DEFAULT NULL COMMENT '会员id',
  49. `inviterId` bigint(20) DEFAULT NULL COMMENT '邀请者会员id',
  50. `total_amount` decimal(20,10) DEFAULT NULL COMMENT '总共充币值',
  51. `remind_date` date DEFAULT NULL,
  52. `is_add_time` tinyint(1) DEFAULT '0' COMMENT '是否已经给邀请者增加抽奖次数;1-已经,0-没有,初始值为0',
  53. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  54. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  55. PRIMARY KEY (`id`),
  56. UNIQUE KEY `memberId` (`member_id`)
  57. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='充钱表';
  58. /*!40101 SET character_set_client = @saved_cs_client */;
  59. --
  60. -- Table structure for table `close_position`
  61. --
  62. DROP TABLE IF EXISTS `close_position`;
  63. /*!40101 SET @saved_cs_client = @@character_set_client */;
  64. /*!50503 SET character_set_client = utf8mb4 */;
  65. CREATE TABLE `close_position` (
  66. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  67. `position_id` bigint(20) NOT NULL COMMENT '仓位ID',
  68. `entrust_price` decimal(20,10) DEFAULT NULL COMMENT '委托价格',
  69. `quantity` decimal(20,10) NOT NULL COMMENT '平仓张数',
  70. `entrust_time` bigint(20) NOT NULL COMMENT '委托时间',
  71. `status` tinyint(2) NOT NULL COMMENT '状态(0委托中 1已撤单 2委托失败 3已成交)',
  72. `close_type` tinyint(2) NOT NULL COMMENT '平仓类型(0平仓 1市价全平 2一键平仓 3反向开仓 4止盈止损 5爆仓 6管理员平仓)',
  73. `type` tinyint(2) NOT NULL COMMENT '委托类型(1限价 0市价)',
  74. `close_position_no` varchar(100) DEFAULT NULL COMMENT '平仓委托单号',
  75. `contract_order_entrust_id` varchar(100) DEFAULT NULL COMMENT '合约委托单号',
  76. `copy_contract_order_entrust_id` varchar(100) DEFAULT NULL COMMENT '跟随平仓委托单号',
  77. `transaction_fee` decimal(20,10) DEFAULT NULL COMMENT '交易手续费',
  78. `transaction_price` decimal(20,10) DEFAULT NULL COMMENT '成交价格',
  79. `transaction_amount` decimal(20,10) DEFAULT NULL COMMENT '成交金额',
  80. `transaction_time` bigint(20) DEFAULT NULL COMMENT '成交时间',
  81. `error` varchar(100) DEFAULT NULL COMMENT '平仓委托失败原因',
  82. `created_time` datetime DEFAULT NULL,
  83. `updated_time` datetime DEFAULT NULL,
  84. PRIMARY KEY (`id`),
  85. KEY `position_id` (`position_id`)
  86. ) ENGINE=InnoDB AUTO_INCREMENT=400632 DEFAULT CHARSET=utf8 COMMENT='平仓记录';
  87. /*!40101 SET character_set_client = @saved_cs_client */;
  88. --
  89. -- Table structure for table `copied_trade`
  90. --
  91. DROP TABLE IF EXISTS `copied_trade`;
  92. /*!40101 SET @saved_cs_client = @@character_set_client */;
  93. /*!50503 SET character_set_client = utf8mb4 */;
  94. CREATE TABLE `copied_trade` (
  95. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  96. `customer_id` bigint(20) NOT NULL COMMENT '用户ID',
  97. `trader_id` bigint(20) NOT NULL COMMENT '交易员ID',
  98. `entrust_no` varchar(100) DEFAULT NULL COMMENT '委托单号',
  99. `contract_order_entrust_id` varchar(100) DEFAULT NULL COMMENT '合约委托单号',
  100. `symbol` varchar(50) DEFAULT NULL COMMENT '交易对',
  101. `contract_symbol_id` bigint(20) DEFAULT NULL COMMENT '交易对ID',
  102. `order_type` tinyint(2) DEFAULT NULL COMMENT '订单类型(10交易员订单 20用户跟单)',
  103. `direction` tinyint(2) DEFAULT NULL COMMENT '委托方向(0多 1空)',
  104. `entrust_price` decimal(20,10) DEFAULT NULL COMMENT '委托价格',
  105. `trigger_price` decimal(20,10) DEFAULT NULL COMMENT '计划委托触发价格',
  106. `leverage` smallint(3) DEFAULT NULL COMMENT '杠杆倍数',
  107. `type` tinyint(2) DEFAULT NULL COMMENT '委托类型(0市价 1市价 2计划委托)',
  108. `volume` decimal(20,10) DEFAULT NULL COMMENT '委托数量(张)',
  109. `stop_loss_price` decimal(20,10) DEFAULT NULL COMMENT '止损价格',
  110. `stop_profit_price` decimal(20,10) DEFAULT NULL COMMENT '止赢价格',
  111. `copy_contract_order_entrust_id` varchar(100) DEFAULT NULL COMMENT '交易员订单单号',
  112. `principal_amount` decimal(20,10) DEFAULT NULL COMMENT '保证金',
  113. `status` tinyint(2) DEFAULT NULL COMMENT '订单状态(0委托中 1已撤单 2委托失败 3已成交)',
  114. `entrust_time` bigint(20) DEFAULT NULL COMMENT '委托时间',
  115. `error` varchar(255) DEFAULT NULL COMMENT '委托失败原因',
  116. `created_time` datetime DEFAULT NULL,
  117. `updated_time` datetime DEFAULT NULL,
  118. `open_price` decimal(20,10) DEFAULT NULL COMMENT '开仓价格',
  119. `position_id` bigint(20) DEFAULT NULL COMMENT '仓位ID',
  120. PRIMARY KEY (`id`),
  121. UNIQUE KEY `entrust` (`contract_order_entrust_id`),
  122. UNIQUE KEY `copy_unique` (`customer_id`,`copy_contract_order_entrust_id`),
  123. KEY `position_id` (`position_id`)
  124. ) ENGINE=InnoDB AUTO_INCREMENT=1157136 DEFAULT CHARSET=utf8 COMMENT='跟单记录表';
  125. /*!40101 SET character_set_client = @saved_cs_client */;
  126. --
  127. -- Table structure for table `customer`
  128. --
  129. DROP TABLE IF EXISTS `customer`;
  130. /*!40101 SET @saved_cs_client = @@character_set_client */;
  131. /*!50503 SET character_set_client = utf8mb4 */;
  132. CREATE TABLE `customer` (
  133. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  134. `nickname` varchar(50) DEFAULT NULL COMMENT '用户昵称',
  135. `avatar` varchar(1000) DEFAULT NULL COMMENT '头像',
  136. `description` varchar(100) DEFAULT NULL COMMENT '描述',
  137. `trader` tinyint(2) NOT NULL DEFAULT '10' COMMENT '是否是ID交易员(10不是 20交易员申请审核中 30交易员 40交易员申请不通过)',
  138. `max_loss` decimal(20,10) DEFAULT NULL COMMENT '最大亏损USDT',
  139. `max_profit` decimal(20,10) DEFAULT NULL COMMENT '最大盈利USDT',
  140. `member_id` bigint(20) NOT NULL COMMENT 'doge会员ID',
  141. `automatic_unfollow` tinyint(1) NOT NULL DEFAULT '1' COMMENT '自动取消跟随开关(1关闭 2开启)',
  142. `trader_level_id` bigint(20) DEFAULT NULL COMMENT '交易员等级ID',
  143. `balance` decimal(20,10) DEFAULT NULL COMMENT '合约资产',
  144. `trader_time` datetime DEFAULT NULL COMMENT '成为交易员时间',
  145. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  146. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  147. `min_follow_amount` bigint(20) DEFAULT NULL COMMENT '特级老师的最低跟随金额',
  148. `edit_data_switch` tinyint(1) DEFAULT NULL COMMENT '修改老师统计数据开关',
  149. `default_follow_customer` bigint(20) DEFAULT '0' COMMENT '当前跟单默认人数',
  150. `default_register_days` bigint(20) DEFAULT '0' COMMENT '入住的默认天数',
  151. `max_principal_amount` bigint(20) DEFAULT NULL COMMENT '按照固定保证金跟随时的保证金上限,null就是没有限制',
  152. `dividend_percent` int(6) DEFAULT NULL COMMENT '分润比例',
  153. PRIMARY KEY (`id`),
  154. UNIQUE KEY `memberId` (`member_id`),
  155. KEY `trader` (`trader`)
  156. ) ENGINE=InnoDB AUTO_INCREMENT=11268 DEFAULT CHARSET=utf8 COMMENT='用户表';
  157. /*!40101 SET character_set_client = @saved_cs_client */;
  158. --
  159. -- Table structure for table `customer_follow_symbol`
  160. --
  161. DROP TABLE IF EXISTS `customer_follow_symbol`;
  162. /*!40101 SET @saved_cs_client = @@character_set_client */;
  163. /*!50503 SET character_set_client = utf8mb4 */;
  164. CREATE TABLE `customer_follow_symbol` (
  165. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  166. `customer_id` bigint(20) NOT NULL COMMENT '用户id',
  167. `trader_id` bigint(20) DEFAULT NULL,
  168. `contract_symbol_id` bigint(20) NOT NULL COMMENT '交易员带单交易对ID',
  169. `symbol` varchar(50) NOT NULL COMMENT '交易对',
  170. `risk_control_id` bigint(20) NOT NULL COMMENT '风控id',
  171. `status` tinyint(2) NOT NULL COMMENT '跟单状态(10关闭 20开启)',
  172. `created_time` datetime DEFAULT NULL,
  173. `updated_time` datetime DEFAULT NULL,
  174. PRIMARY KEY (`id`),
  175. UNIQUE KEY `follow_symbol_unique` (`customer_id`,`trader_id`,`contract_symbol_id`)
  176. ) ENGINE=InnoDB AUTO_INCREMENT=28806 DEFAULT CHARSET=utf8 COMMENT='用户跟随交易对';
  177. /*!40101 SET character_set_client = @saved_cs_client */;
  178. --
  179. -- Table structure for table `exception_log`
  180. --
  181. DROP TABLE IF EXISTS `exception_log`;
  182. /*!40101 SET @saved_cs_client = @@character_set_client */;
  183. /*!50503 SET character_set_client = utf8mb4 */;
  184. CREATE TABLE `exception_log` (
  185. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  186. `message_name` varchar(128) DEFAULT NULL COMMENT '标题',
  187. `stack_label` varchar(128) DEFAULT NULL COMMENT '堆栈标签',
  188. `exception` text COMMENT '内容',
  189. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  190. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  191. PRIMARY KEY (`id`)
  192. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='异常记录';
  193. /*!40101 SET character_set_client = @saved_cs_client */;
  194. --
  195. -- Table structure for table `exchange_asset_flow`
  196. --
  197. DROP TABLE IF EXISTS `exchange_asset_flow`;
  198. /*!40101 SET @saved_cs_client = @@character_set_client */;
  199. /*!50503 SET character_set_client = utf8mb4 */;
  200. CREATE TABLE `exchange_asset_flow` (
  201. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '流水序号,自增主键',
  202. `transaction_id` bigint(20) DEFAULT NULL COMMENT '交易ID',
  203. `from_exchange_wallet_id` bigint(20) DEFAULT NULL COMMENT '资金来源钱包id',
  204. `to_exchange_wallet_id` bigint(20) DEFAULT NULL COMMENT '资金去向钱包id',
  205. `coin_symbol` varchar(255) NOT NULL COMMENT '币种名称或代码',
  206. `business_type` int(11) NOT NULL COMMENT '业务类型,具体可取值见上文',
  207. `amount` decimal(26,8) DEFAULT '0.00000000' COMMENT '变动金额,可为正(入金)或负(出金)',
  208. `frozen_amount` decimal(18,8) DEFAULT '0.00000000' COMMENT '冻结变动量,可为正(冻结)或负(解冻)',
  209. `available_balance` decimal(26,8) DEFAULT '0.00000000' COMMENT '流水后用户钱包的可用余额',
  210. `fee` decimal(18,8) DEFAULT '0.00000000' COMMENT '手续费,部分业务类型可能产生的手续费',
  211. `remark` varchar(255) DEFAULT NULL COMMENT '流水备注,部分业务类型的备注信息',
  212. `created_time` timestamp NULL DEFAULT CURRENT_TIMESTAMP COMMENT '流水创建时间',
  213. PRIMARY KEY (`id`),
  214. KEY `transaction_id` (`transaction_id`)
  215. ) ENGINE=InnoDB AUTO_INCREMENT=1125 DEFAULT CHARSET=utf8 COMMENT='资产流水表';
  216. /*!40101 SET character_set_client = @saved_cs_client */;
  217. --
  218. -- Table structure for table `exchange_coin`
  219. --
  220. DROP TABLE IF EXISTS `exchange_coin`;
  221. /*!40101 SET @saved_cs_client = @@character_set_client */;
  222. /*!50503 SET character_set_client = utf8mb4 */;
  223. CREATE TABLE `exchange_coin` (
  224. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  225. `symbol` varchar(255) NOT NULL,
  226. `base_coin_scale` int(11) NOT NULL,
  227. `base_symbol` varchar(255) DEFAULT NULL,
  228. `coin_scale` int(11) NOT NULL,
  229. `coin_symbol` varchar(255) DEFAULT NULL,
  230. `enable` int(11) NOT NULL,
  231. `fee` decimal(8,4) DEFAULT NULL COMMENT '交易手续费',
  232. `sell_fee` decimal(8,4) NOT NULL,
  233. `sort` int(11) NOT NULL,
  234. `enable_market_buy` int(11) DEFAULT '1' COMMENT '是否启用市价买',
  235. `enable_market_sell` int(11) DEFAULT '1' COMMENT '是否启用市价卖',
  236. `min_sell_price` decimal(18,8) DEFAULT NULL COMMENT '最低挂单卖价',
  237. `flag` int(11) DEFAULT '0' COMMENT '默认为0,1表示推荐',
  238. `max_trading_order` int(11) DEFAULT '0' COMMENT '最大允许同时交易的订单数,0表示不限制',
  239. `max_trading_time` int(11) DEFAULT '0' COMMENT '委托超时自动下架时间,单位为秒,0表示不过期',
  240. `instrument` varchar(20) DEFAULT NULL COMMENT '交易类型,B2C2特有',
  241. `min_turnover` decimal(18,8) DEFAULT NULL COMMENT '最小挂单成交额',
  242. `max_volume` decimal(18,8) DEFAULT NULL COMMENT '最大下单量',
  243. `min_volume` decimal(18,8) DEFAULT NULL COMMENT '最小下单量',
  244. `zone` int(11) DEFAULT '0',
  245. `clear_time` varchar(30) DEFAULT '1' COMMENT '清盘时间',
  246. `end_time` varchar(30) DEFAULT '1' COMMENT '结束时间',
  247. `publish_price` decimal(18,8) DEFAULT NULL COMMENT ' 分摊发行价格',
  248. `publish_type` int(11) DEFAULT '1' COMMENT '发行活动类型 1:无活动,2:抢购发行,3:分摊发行',
  249. `start_time` varchar(30) DEFAULT '1' COMMENT '开始时间',
  250. `exchangeable` int(11) DEFAULT '1' COMMENT ' 是否可交易',
  251. `publish_amount` decimal(18,8) DEFAULT NULL COMMENT ' 活动发行数量',
  252. `visible` int(11) DEFAULT '1' COMMENT ' 前台可见状态',
  253. `max_buy_price` decimal(18,8) DEFAULT NULL COMMENT '最高买单价',
  254. `robot_type` int(11) DEFAULT '0' COMMENT '机器人类型',
  255. `enable_buy` int(11) DEFAULT '1' COMMENT '是否允许买',
  256. `enable_sell` int(11) DEFAULT '1' COMMENT '是否允许卖',
  257. PRIMARY KEY (`id`)
  258. ) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='币币交易对';
  259. /*!40101 SET character_set_client = @saved_cs_client */;
  260. --
  261. -- Table structure for table `exchange_deal`
  262. --
  263. DROP TABLE IF EXISTS `exchange_deal`;
  264. /*!40101 SET @saved_cs_client = @@character_set_client */;
  265. /*!50503 SET character_set_client = utf8mb4 */;
  266. CREATE TABLE `exchange_deal` (
  267. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  268. `amount` decimal(32,8) NOT NULL COMMENT '金额',
  269. `price` decimal(32,8) NOT NULL COMMENT '价格',
  270. `type` int(1) DEFAULT NULL COMMENT '1.买入 2.卖出',
  271. `volume` decimal(32,8) NOT NULL COMMENT '数量',
  272. `sell_fee` decimal(16,8) DEFAULT NULL COMMENT '手续费',
  273. `buy_fee` decimal(16,8) NOT NULL COMMENT '手续费',
  274. `buy_commission_rate` decimal(16,8) NOT NULL COMMENT '买入手续费比率',
  275. `sell_commission_rate` decimal(16,8) DEFAULT NULL COMMENT '卖出手续费比列',
  276. `symbol_name` varchar(20) NOT NULL COMMENT '交易对名称',
  277. `buy_order_id` bigint(20) NOT NULL COMMENT '买单id',
  278. `sell_order_id` bigint(20) NOT NULL COMMENT '卖单id',
  279. `buy_account_id` bigint(20) NOT NULL COMMENT '买家id',
  280. `sell_account_id` bigint(20) NOT NULL COMMENT '卖家id',
  281. `deal_time` bigint(20) NOT NULL COMMENT '成交时间',
  282. `is_wallet_update` int(11) NOT NULL DEFAULT '0' COMMENT '0.未更新钱包 1.已更新钱包',
  283. `create_time` bigint(20) NOT NULL,
  284. `coin` varchar(10) NOT NULL COMMENT '交易币种',
  285. `base_coin` varchar(10) NOT NULL COMMENT '基础币种',
  286. PRIMARY KEY (`id`)
  287. ) ENGINE=InnoDB AUTO_INCREMENT=6652 DEFAULT CHARSET=utf8mb4 COMMENT='成交表';
  288. /*!40101 SET character_set_client = @saved_cs_client */;
  289. --
  290. -- Table structure for table `exchange_freeze_history`
  291. --
  292. DROP TABLE IF EXISTS `exchange_freeze_history`;
  293. /*!40101 SET @saved_cs_client = @@character_set_client */;
  294. /*!50503 SET character_set_client = utf8mb4 */;
  295. CREATE TABLE `exchange_freeze_history` (
  296. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  297. `member_id` bigint(20) NOT NULL,
  298. `coin_id` varchar(100) NOT NULL,
  299. `amount` decimal(18,8) NOT NULL,
  300. `created_time` datetime NOT NULL,
  301. `updated_time` datetime NOT NULL,
  302. `unfreeze_time` datetime NOT NULL,
  303. `status` int(2) NOT NULL,
  304. `type` int(2) NOT NULL,
  305. PRIMARY KEY (`id`),
  306. KEY `member_id` (`member_id`)
  307. ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8mb4;
  308. /*!40101 SET character_set_client = @saved_cs_client */;
  309. --
  310. -- Table structure for table `exchange_order`
  311. --
  312. DROP TABLE IF EXISTS `exchange_order`;
  313. /*!40101 SET @saved_cs_client = @@character_set_client */;
  314. /*!50503 SET character_set_client = utf8mb4 */;
  315. CREATE TABLE `exchange_order` (
  316. `order_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  317. `amount` decimal(18,8) DEFAULT NULL,
  318. `base_symbol` varchar(255) DEFAULT NULL,
  319. `canceled_time` bigint(20) DEFAULT NULL,
  320. `coin_symbol` varchar(255) DEFAULT NULL,
  321. `completed_time` bigint(20) DEFAULT NULL,
  322. `direction` int(11) DEFAULT NULL,
  323. `member_id` bigint(20) DEFAULT NULL,
  324. `price` decimal(18,8) DEFAULT NULL,
  325. `trigger_price` decimal(18,8) DEFAULT NULL,
  326. `fee` decimal(18,8) NOT NULL,
  327. `status` int(11) DEFAULT NULL,
  328. `symbol` varchar(255) DEFAULT NULL,
  329. `time` bigint(20) DEFAULT NULL,
  330. `traded_amount` decimal(26,16) DEFAULT NULL,
  331. `turnover` decimal(26,16) DEFAULT NULL,
  332. `type` int(11) DEFAULT NULL,
  333. `use_discount` varchar(255) DEFAULT NULL,
  334. `order_resource` int(11) DEFAULT NULL,
  335. `fee_rate` decimal(26,16) DEFAULT NULL COMMENT '手续费率',
  336. `trade_status` int(11) NOT NULL DEFAULT '0' COMMENT '撮合状态, 0 待开始 1撮合中 2 撮合停止 3 撮合完成',
  337. PRIMARY KEY (`order_id`) USING BTREE,
  338. KEY `symbol` (`symbol`,`member_id`,`status`) USING BTREE,
  339. KEY `member_id` (`member_id`),
  340. KEY `index_time` (`time`),
  341. KEY `index_type` (`type`)
  342. ) ENGINE=InnoDB AUTO_INCREMENT=12238 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='币币挂单';
  343. /*!40101 SET character_set_client = @saved_cs_client */;
  344. --
  345. -- Table structure for table `exchange_release_history`
  346. --
  347. DROP TABLE IF EXISTS `exchange_release_history`;
  348. /*!40101 SET @saved_cs_client = @@character_set_client */;
  349. /*!50503 SET character_set_client = utf8mb4 */;
  350. CREATE TABLE `exchange_release_history` (
  351. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  352. `member_id` bigint(20) NOT NULL,
  353. `coin_id` varchar(255) NOT NULL,
  354. `amount` decimal(18,8) NOT NULL,
  355. `release_time` datetime NOT NULL,
  356. `created_time` datetime DEFAULT NULL,
  357. `updated_time` datetime DEFAULT NULL,
  358. PRIMARY KEY (`id`),
  359. KEY `member_id` (`member_id`)
  360. ) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8mb4;
  361. /*!40101 SET character_set_client = @saved_cs_client */;
  362. --
  363. -- Table structure for table `exchange_statistics_data`
  364. --
  365. DROP TABLE IF EXISTS `exchange_statistics_data`;
  366. /*!40101 SET @saved_cs_client = @@character_set_client */;
  367. /*!50503 SET character_set_client = utf8mb4 */;
  368. CREATE TABLE `exchange_statistics_data` (
  369. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  370. `stat_time` datetime NOT NULL COMMENT '统计时间',
  371. `member_id` bigint(20) NOT NULL COMMENT '用户ID',
  372. `stat_type` int(8) NOT NULL COMMENT '统计类别1:零点统计,2:16点统计',
  373. `coin_symbol` varchar(255) DEFAULT NULL COMMENT '资产币种',
  374. `position_asset_price_usdt` decimal(26,8) DEFAULT NULL COMMENT '持仓资产价格(USDT计价)',
  375. `daily_profit_loss_usdt` decimal(26,8) DEFAULT NULL COMMENT '当天盈亏(USDT)',
  376. `frozen_asset_price_usdt` decimal(26,8) DEFAULT NULL COMMENT '持仓资产价格(USDT计价)',
  377. `created_time` datetime DEFAULT NULL,
  378. `updated_time` datetime DEFAULT NULL,
  379. PRIMARY KEY (`id`,`stat_type`,`member_id`,`stat_time`) USING BTREE
  380. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='现货统计数据表';
  381. /*!40101 SET character_set_client = @saved_cs_client */;
  382. --
  383. -- Table structure for table `exchange_wallet`
  384. --
  385. DROP TABLE IF EXISTS `exchange_wallet`;
  386. /*!40101 SET @saved_cs_client = @@character_set_client */;
  387. /*!50503 SET character_set_client = utf8mb4 */;
  388. CREATE TABLE `exchange_wallet` (
  389. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  390. `address` varchar(255) DEFAULT NULL,
  391. `balance` decimal(26,8) DEFAULT NULL COMMENT '可用余额',
  392. `frozen_balance` decimal(26,8) DEFAULT NULL COMMENT '冻结余额',
  393. `pledged_balance` decimal(18,8) DEFAULT NULL,
  394. `is_lock` int(11) DEFAULT '0' COMMENT '钱包不是锁定',
  395. `member_id` bigint(20) DEFAULT NULL,
  396. `to_released` decimal(18,8) DEFAULT NULL COMMENT '待释放总量',
  397. `daily_released` decimal(18,8) DEFAULT NULL,
  398. `version` int(11) NOT NULL,
  399. `coin_id` varchar(255) DEFAULT NULL,
  400. `release_date` date DEFAULT NULL,
  401. PRIMARY KEY (`id`) USING BTREE,
  402. UNIQUE KEY `UKm68bscpof0bpnxocxl4qdnvbe` (`member_id`,`coin_id`) USING BTREE
  403. ) ENGINE=InnoDB AUTO_INCREMENT=103226 DEFAULT CHARSET=utf8 COMMENT='会员钱包';
  404. /*!40101 SET character_set_client = @saved_cs_client */;
  405. --
  406. -- Table structure for table `favorite`
  407. --
  408. DROP TABLE IF EXISTS `favorite`;
  409. /*!40101 SET @saved_cs_client = @@character_set_client */;
  410. /*!50503 SET character_set_client = utf8mb4 */;
  411. CREATE TABLE `favorite` (
  412. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  413. `customer_id` bigint(20) DEFAULT NULL COMMENT '用户id',
  414. `trader_id` bigint(20) DEFAULT NULL COMMENT '交易员ID',
  415. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  416. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  417. PRIMARY KEY (`id`),
  418. UNIQUE KEY `favorite_unique` (`customer_id`,`trader_id`)
  419. ) ENGINE=InnoDB AUTO_INCREMENT=8467 DEFAULT CHARSET=utf8 COMMENT='关注表';
  420. /*!40101 SET character_set_client = @saved_cs_client */;
  421. --
  422. -- Table structure for table `follow`
  423. --
  424. DROP TABLE IF EXISTS `follow`;
  425. /*!40101 SET @saved_cs_client = @@character_set_client */;
  426. /*!50503 SET character_set_client = utf8mb4 */;
  427. CREATE TABLE `follow` (
  428. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  429. `customer_id` bigint(20) NOT NULL COMMENT '用户ID',
  430. `trader_id` bigint(20) NOT NULL COMMENT '交易员ID',
  431. `status` tinyint(2) NOT NULL DEFAULT '10' COMMENT '是否跟随(10跟随中 20用户消跟随 30被交易员移出)',
  432. `created_time` datetime DEFAULT NULL,
  433. `updated_time` datetime DEFAULT NULL,
  434. `expire_time` datetime DEFAULT NULL,
  435. PRIMARY KEY (`id`),
  436. UNIQUE KEY `follow_unique` (`customer_id`,`trader_id`)
  437. ) ENGINE=InnoDB AUTO_INCREMENT=12833 DEFAULT CHARSET=utf8 COMMENT='跟随表';
  438. /*!40101 SET character_set_client = @saved_cs_client */;
  439. --
  440. -- Table structure for table `follow_config`
  441. --
  442. DROP TABLE IF EXISTS `follow_config`;
  443. /*!40101 SET @saved_cs_client = @@character_set_client */;
  444. /*!50503 SET character_set_client = utf8mb4 */;
  445. CREATE TABLE `follow_config` (
  446. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  447. `config_name_en` varchar(100) DEFAULT NULL COMMENT '配置英文名',
  448. `config_name_cn` varchar(100) DEFAULT NULL COMMENT '配置中文名',
  449. `config_content` varchar(100) DEFAULT NULL COMMENT '配置内容',
  450. `created_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  451. `updated_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  452. `is_admin_edit` tinyint(1) DEFAULT '1' COMMENT '是否允许后台管理员修改;0-不可以,1-可以',
  453. PRIMARY KEY (`id`),
  454. UNIQUE KEY `config_name_cn` (`config_name_cn`),
  455. UNIQUE KEY `config_name_en` (`config_name_en`)
  456. ) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8 COMMENT='跟单配置表';
  457. /*!40101 SET character_set_client = @saved_cs_client */;
  458. --
  459. -- Table structure for table `kafka_message`
  460. --
  461. DROP TABLE IF EXISTS `kafka_message`;
  462. /*!40101 SET @saved_cs_client = @@character_set_client */;
  463. /*!50503 SET character_set_client = utf8mb4 */;
  464. CREATE TABLE `kafka_message` (
  465. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  466. `topic` varchar(100) NOT NULL COMMENT '队列',
  467. `message` varchar(4000) NOT NULL COMMENT '消息内容',
  468. `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(1未发送 2已发送)',
  469. `created_time` datetime DEFAULT NULL,
  470. `updated_time` datetime DEFAULT NULL,
  471. PRIMARY KEY (`id`)
  472. ) ENGINE=InnoDB AUTO_INCREMENT=1211647 DEFAULT CHARSET=utf8 COMMENT='kafka消息发送';
  473. /*!40101 SET character_set_client = @saved_cs_client */;
  474. --
  475. -- Table structure for table `member_prize_time`
  476. --
  477. DROP TABLE IF EXISTS `member_prize_time`;
  478. /*!40101 SET @saved_cs_client = @@character_set_client */;
  479. /*!50503 SET character_set_client = utf8mb4 */;
  480. CREATE TABLE `member_prize_time` (
  481. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
  482. `member_id` bigint(20) DEFAULT NULL COMMENT '会员id',
  483. `time` int(11) DEFAULT '0' COMMENT '次数',
  484. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  485. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  486. PRIMARY KEY (`id`),
  487. UNIQUE KEY `memberId` (`member_id`)
  488. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='会员抽奖次数表';
  489. /*!40101 SET character_set_client = @saved_cs_client */;
  490. --
  491. -- Table structure for table `message`
  492. --
  493. DROP TABLE IF EXISTS `message`;
  494. /*!40101 SET @saved_cs_client = @@character_set_client */;
  495. /*!50503 SET character_set_client = utf8mb4 */;
  496. CREATE TABLE `message` (
  497. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  498. `customer_id` bigint(20) NOT NULL,
  499. `title` varchar(200) DEFAULT NULL,
  500. `content` varchar(2000) DEFAULT NULL,
  501. `symbol` varchar(200) DEFAULT NULL,
  502. `message_type` varchar(100) DEFAULT NULL,
  503. `volume` decimal(18,8) DEFAULT NULL,
  504. `trigger_price` decimal(19,8) DEFAULT NULL,
  505. `deal_price` decimal(19,8) DEFAULT NULL,
  506. `create_time` datetime NOT NULL,
  507. `is_read` tinyint(1) NOT NULL,
  508. PRIMARY KEY (`id`)
  509. ) ENGINE=InnoDB AUTO_INCREMENT=1092086 DEFAULT CHARSET=utf8;
  510. /*!40101 SET character_set_client = @saved_cs_client */;
  511. --
  512. -- Table structure for table `message_allsend`
  513. --
  514. DROP TABLE IF EXISTS `message_allsend`;
  515. /*!40101 SET @saved_cs_client = @@character_set_client */;
  516. /*!50503 SET character_set_client = utf8mb4 */;
  517. CREATE TABLE `message_allsend` (
  518. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '消息群发ID',
  519. `message_type_id` bigint(20) NOT NULL COMMENT '消息类型ID',
  520. `message_title` varchar(50) DEFAULT NULL COMMENT '消息标题',
  521. `content` varchar(2000) DEFAULT NULL COMMENT '消息内容',
  522. `message_creater_id` bigint(20) DEFAULT NULL COMMENT '创建者id',
  523. `created_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  524. `updated_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  525. `send_time` timestamp NULL DEFAULT NULL,
  526. `is_send` tinyint(1) DEFAULT '0',
  527. `is_specific_user` tinyint(1) DEFAULT '0',
  528. PRIMARY KEY (`id`)
  529. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息群发表';
  530. /*!40101 SET character_set_client = @saved_cs_client */;
  531. --
  532. -- Table structure for table `message_config`
  533. --
  534. DROP TABLE IF EXISTS `message_config`;
  535. /*!40101 SET @saved_cs_client = @@character_set_client */;
  536. /*!50503 SET character_set_client = utf8mb4 */;
  537. CREATE TABLE `message_config` (
  538. `id` bigint(20) NOT NULL,
  539. `no_disturb` tinyint(1) NOT NULL,
  540. `open_success` tinyint(1) NOT NULL,
  541. `open_failure` tinyint(1) NOT NULL,
  542. `close_success` tinyint(1) NOT NULL,
  543. `force_close` tinyint(1) NOT NULL,
  544. `position_profit` tinyint(1) NOT NULL,
  545. `position_loss` tinyint(1) NOT NULL,
  546. `account_profit` tinyint(1) NOT NULL,
  547. `account_loss` tinyint(1) NOT NULL,
  548. `empty_remind` tinyint(1) NOT NULL,
  549. `unfollow_remind` tinyint(1) NOT NULL,
  550. PRIMARY KEY (`id`)
  551. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  552. /*!40101 SET character_set_client = @saved_cs_client */;
  553. --
  554. -- Table structure for table `message_detail`
  555. --
  556. DROP TABLE IF EXISTS `message_detail`;
  557. /*!40101 SET @saved_cs_client = @@character_set_client */;
  558. /*!50503 SET character_set_client = utf8mb4 */;
  559. CREATE TABLE `message_detail` (
  560. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '消息详情ID',
  561. `message_allsend_id` bigint(20) DEFAULT NULL COMMENT '0-私聊消息,其他为消息群发表的id',
  562. `sender_id` bigint(20) DEFAULT NULL COMMENT '发送者id',
  563. `receiver_id` bigint(20) DEFAULT NULL COMMENT '接收者id',
  564. `content` varchar(2000) DEFAULT NULL COMMENT '消息内容,私聊消息以外的需要取消息类型表的content',
  565. `is_send` tinyint(1) DEFAULT '0' COMMENT '是否发送',
  566. `is_read` tinyint(1) DEFAULT '0' COMMENT '是否已读',
  567. `destination` varchar(50) DEFAULT NULL COMMENT '监听路径',
  568. `created_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  569. `updated_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  570. `is_del` tinyint(1) DEFAULT '0',
  571. `send_time` timestamp NULL DEFAULT NULL,
  572. PRIMARY KEY (`id`)
  573. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='消息详情表';
  574. /*!40101 SET character_set_client = @saved_cs_client */;
  575. --
  576. -- Table structure for table `message_type`
  577. --
  578. DROP TABLE IF EXISTS `message_type`;
  579. /*!40101 SET @saved_cs_client = @@character_set_client */;
  580. /*!50503 SET character_set_client = utf8mb4 */;
  581. CREATE TABLE `message_type` (
  582. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  583. `message_type_cn` varchar(100) NOT NULL COMMENT '消息类型中文名',
  584. `message_type_en` varchar(100) DEFAULT NULL COMMENT '消息类型英文名',
  585. `created_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  586. `updated_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  587. PRIMARY KEY (`id`)
  588. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='消息类型表';
  589. /*!40101 SET character_set_client = @saved_cs_client */;
  590. --
  591. -- Table structure for table `mine_conf`
  592. --
  593. DROP TABLE IF EXISTS `mine_conf`;
  594. /*!40101 SET @saved_cs_client = @@character_set_client */;
  595. /*!50503 SET character_set_client = utf8mb4 */;
  596. CREATE TABLE `mine_conf` (
  597. `id` bigint(20) NOT NULL,
  598. `pledge_quantity` decimal(26,8) NOT NULL COMMENT '最小质押数量',
  599. `production_ratio` decimal(10,2) NOT NULL COMMENT '产币比例,单位%',
  600. `bonus_one` decimal(26,8) NOT NULL COMMENT '银牌分红',
  601. `created_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  602. `updated_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  603. `bonus_two` decimal(26,8) NOT NULL COMMENT '金牌分红',
  604. `bonus_three` decimal(26,8) NOT NULL COMMENT '合伙人分红',
  605. `total_quantity` decimal(26,8) NOT NULL COMMENT '矿池总量',
  606. PRIMARY KEY (`id`)
  607. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='挖矿配置';
  608. /*!40101 SET character_set_client = @saved_cs_client */;
  609. --
  610. -- Table structure for table `mine_customer_info`
  611. --
  612. DROP TABLE IF EXISTS `mine_customer_info`;
  613. /*!40101 SET @saved_cs_client = @@character_set_client */;
  614. /*!50503 SET character_set_client = utf8mb4 */;
  615. CREATE TABLE `mine_customer_info` (
  616. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  617. `pledge_number` decimal(26,8) NOT NULL COMMENT '质押数量',
  618. `release_number` decimal(26,8) NOT NULL COMMENT '待解押数量',
  619. `total_revenue` decimal(26,8) NOT NULL COMMENT '总收益',
  620. `available_revenue` decimal(26,8) NOT NULL COMMENT '可提取收益',
  621. `invite_number` int(11) NOT NULL COMMENT '邀请数量',
  622. `generations` int(11) NOT NULL COMMENT '代',
  623. `level` int(11) NOT NULL COMMENT '1.银牌商务,2.金牌商务,3.合伙人',
  624. `member_id` bigint(20) NOT NULL COMMENT '用户id',
  625. PRIMARY KEY (`id`)
  626. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='客户质押信息';
  627. /*!40101 SET character_set_client = @saved_cs_client */;
  628. --
  629. -- Table structure for table `mine_income_records`
  630. --
  631. DROP TABLE IF EXISTS `mine_income_records`;
  632. /*!40101 SET @saved_cs_client = @@character_set_client */;
  633. /*!50503 SET character_set_client = utf8mb4 */;
  634. CREATE TABLE `mine_income_records` (
  635. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  636. `member_id` bigint(20) NOT NULL COMMENT '用户id',
  637. `type` int(11) NOT NULL COMMENT '类型:1.收益 2.提出',
  638. `created_time` datetime NOT NULL,
  639. `updated_time` datetime NOT NULL,
  640. `quantity` decimal(26,8) NOT NULL COMMENT '数量',
  641. PRIMARY KEY (`id`)
  642. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='收益记录';
  643. /*!40101 SET character_set_client = @saved_cs_client */;
  644. --
  645. -- Table structure for table `mine_pledge_records`
  646. --
  647. DROP TABLE IF EXISTS `mine_pledge_records`;
  648. /*!40101 SET @saved_cs_client = @@character_set_client */;
  649. /*!50503 SET character_set_client = utf8mb4 */;
  650. CREATE TABLE `mine_pledge_records` (
  651. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  652. `member_id` bigint(20) NOT NULL COMMENT '用户id',
  653. `type` int(11) NOT NULL COMMENT '类型:1.质押 2.解押',
  654. `status` int(11) NOT NULL COMMENT '状态:0 待解押 1解押成功',
  655. `created_time` datetime NOT NULL,
  656. `updated_time` datetime NOT NULL,
  657. `quantity` decimal(26,8) NOT NULL COMMENT '数量',
  658. PRIMARY KEY (`id`)
  659. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='质押记录';
  660. /*!40101 SET character_set_client = @saved_cs_client */;
  661. --
  662. -- Table structure for table `position`
  663. --
  664. DROP TABLE IF EXISTS `position`;
  665. /*!40101 SET @saved_cs_client = @@character_set_client */;
  666. /*!50503 SET character_set_client = utf8mb4 */;
  667. CREATE TABLE `position` (
  668. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  669. `customer_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  670. `position_id` bigint(20) NOT NULL COMMENT '仓位ID',
  671. `trader_id` bigint(20) DEFAULT NULL COMMENT '交易员ID',
  672. `symbol` varchar(50) DEFAULT NULL COMMENT '交易对',
  673. `direction` tinyint(2) DEFAULT NULL COMMENT '方向(0多 1空)',
  674. `leverage` smallint(3) DEFAULT NULL COMMENT '杠杆倍数',
  675. `open_price` decimal(20,10) DEFAULT NULL COMMENT '开仓价格',
  676. `total_position` decimal(20,10) DEFAULT NULL COMMENT '总持仓张数',
  677. `total_principal_amount` decimal(20,10) DEFAULT NULL COMMENT '总本金',
  678. `available_position` decimal(20,10) DEFAULT NULL COMMENT '当前可平张数',
  679. `current_position` decimal(20,10) DEFAULT NULL COMMENT '当前持仓张数',
  680. `principal_amount` decimal(20,10) DEFAULT NULL COMMENT '保证金',
  681. `contract_order_entrust_id` varchar(100) DEFAULT NULL COMMENT '合约委托单号',
  682. `status` tinyint(2) DEFAULT NULL COMMENT '持仓状态(10未平仓 20部分平仓 30全部平仓)',
  683. `transaction_fee` decimal(20,10) DEFAULT NULL COMMENT '交易手续费',
  684. `open_time` bigint(20) DEFAULT NULL COMMENT '开仓时间',
  685. `close_time` bigint(20) DEFAULT NULL COMMENT '平仓时间',
  686. `close_price` decimal(20,10) DEFAULT NULL COMMENT '平仓均价',
  687. `profit_and_loss` decimal(20,10) DEFAULT NULL COMMENT '盈亏金额',
  688. `created_time` datetime DEFAULT NULL,
  689. `updated_time` datetime DEFAULT NULL,
  690. `dividend_fee` decimal(20,10) DEFAULT NULL COMMENT '分润金额',
  691. `trader_position_id` bigint(20) DEFAULT NULL COMMENT '老师的仓位ID',
  692. `is_send_close_message` tinyint(1) DEFAULT '0' COMMENT '是否已经发送强平消息;0-未发送,1-已发送',
  693. PRIMARY KEY (`id`),
  694. KEY `status` (`status`),
  695. KEY `customer_id` (`customer_id`),
  696. KEY `position_id` (`position_id`),
  697. KEY `trader_position_id` (`trader_position_id`),
  698. KEY `close_time` (`close_time`)
  699. ) ENGINE=InnoDB AUTO_INCREMENT=358129 DEFAULT CHARSET=utf8 COMMENT='跟单持仓表';
  700. /*!40101 SET character_set_client = @saved_cs_client */;
  701. --
  702. -- Table structure for table `prize`
  703. --
  704. DROP TABLE IF EXISTS `prize`;
  705. /*!40101 SET @saved_cs_client = @@character_set_client */;
  706. /*!50503 SET character_set_client = utf8mb4 */;
  707. CREATE TABLE `prize` (
  708. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '奖品ID',
  709. `picture` varchar(1000) DEFAULT NULL COMMENT '图片地址',
  710. `name` varchar(100) DEFAULT NULL COMMENT '名称',
  711. `probability` double(5,2) DEFAULT '1.00' COMMENT '中奖概率',
  712. `fiction_probability` double(5,2) DEFAULT '1.00' COMMENT '虚构中奖概率',
  713. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  714. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  715. PRIMARY KEY (`id`)
  716. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='奖品表';
  717. /*!40101 SET character_set_client = @saved_cs_client */;
  718. --
  719. -- Table structure for table `prize_log`
  720. --
  721. DROP TABLE IF EXISTS `prize_log`;
  722. /*!40101 SET @saved_cs_client = @@character_set_client */;
  723. /*!50503 SET character_set_client = utf8mb4 */;
  724. CREATE TABLE `prize_log` (
  725. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'id',
  726. `member_id` bigint(20) DEFAULT NULL COMMENT '会员id',
  727. `username` varchar(100) DEFAULT NULL COMMENT '用户名',
  728. `prize_id` bigint(20) DEFAULT NULL COMMENT '奖品id',
  729. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  730. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  731. PRIMARY KEY (`id`)
  732. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='中奖记录表';
  733. /*!40101 SET character_set_client = @saved_cs_client */;
  734. --
  735. -- Table structure for table `risk_control`
  736. --
  737. DROP TABLE IF EXISTS `risk_control`;
  738. /*!40101 SET @saved_cs_client = @@character_set_client */;
  739. /*!50503 SET character_set_client = utf8mb4 */;
  740. CREATE TABLE `risk_control` (
  741. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  742. `customer_id` bigint(20) NOT NULL COMMENT '用户ID',
  743. `follow_id` bigint(20) NOT NULL COMMENT '跟随ID',
  744. `leverage` smallint(3) DEFAULT NULL COMMENT '杠杆倍数(0代表跟随交易员)',
  745. `trading_amount` decimal(20,10) DEFAULT NULL COMMENT '跟单金额',
  746. `trading_mode` tinyint(2) DEFAULT NULL COMMENT '跟单方式(10固定比例 20固定资金)',
  747. `stop_loss_percentage` decimal(20,10) DEFAULT NULL COMMENT '止损比例',
  748. `stop_profit_percentage` decimal(20,10) DEFAULT NULL COMMENT '止赢比例',
  749. `max_copied_amount` decimal(20,10) DEFAULT NULL COMMENT '最大跟随金额',
  750. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  751. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  752. PRIMARY KEY (`id`)
  753. ) ENGINE=InnoDB AUTO_INCREMENT=14674 DEFAULT CHARSET=utf8 COMMENT='跟单风险控制表';
  754. /*!40101 SET character_set_client = @saved_cs_client */;
  755. --
  756. -- Table structure for table `robot_match_conf`
  757. --
  758. DROP TABLE IF EXISTS `robot_match_conf`;
  759. /*!40101 SET @saved_cs_client = @@character_set_client */;
  760. /*!50503 SET character_set_client = utf8mb4 */;
  761. CREATE TABLE `robot_match_conf` (
  762. `id` bigint(20) NOT NULL,
  763. `min_amount` decimal(26,8) NOT NULL COMMENT '最小数量',
  764. `max_amount` decimal(26,8) NOT NULL COMMENT '最大数量',
  765. `proportion` decimal(20,8) NOT NULL COMMENT '大盘比例:0.0001btc',
  766. `fixed_offset` decimal(26,16) NOT NULL COMMENT '价格固定偏移量',
  767. `random_offset` decimal(26,8) NOT NULL COMMENT '价格随机偏移量',
  768. PRIMARY KEY (`id`)
  769. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='配置名称';
  770. /*!40101 SET character_set_client = @saved_cs_client */;
  771. --
  772. -- Table structure for table `robot_match_plan`
  773. --
  774. DROP TABLE IF EXISTS `robot_match_plan`;
  775. /*!40101 SET @saved_cs_client = @@character_set_client */;
  776. /*!50503 SET character_set_client = utf8mb4 */;
  777. CREATE TABLE `robot_match_plan` (
  778. `id` bigint(20) NOT NULL,
  779. `start_time` datetime NOT NULL COMMENT '开盘时间',
  780. `amplitude` decimal(26,8) NOT NULL COMMENT '幅度:单位%',
  781. `type` int(11) NOT NULL COMMENT '1涨 2.跌',
  782. `end_time` datetime NOT NULL COMMENT '结束时间',
  783. PRIMARY KEY (`id`),
  784. UNIQUE KEY `robot_match_plan_pk` (`start_time`)
  785. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='机器人成交计划';
  786. /*!40101 SET character_set_client = @saved_cs_client */;
  787. --
  788. -- Table structure for table `statistics_data`
  789. --
  790. DROP TABLE IF EXISTS `statistics_data`;
  791. /*!40101 SET @saved_cs_client = @@character_set_client */;
  792. /*!50503 SET character_set_client = utf8mb4 */;
  793. CREATE TABLE `statistics_data` (
  794. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  795. `date_time` datetime NOT NULL COMMENT '时间',
  796. `customer_id` bigint(20) DEFAULT NULL COMMENT '用户ID',
  797. `balance` decimal(20,10) DEFAULT NULL COMMENT '资产',
  798. `earnings` decimal(20,10) DEFAULT NULL COMMENT '订单收益(USDT)',
  799. `principal_amount` decimal(20,10) DEFAULT NULL COMMENT '总保证金',
  800. `open_position` bigint(20) DEFAULT NULL COMMENT '开仓笔数',
  801. `profit_order_count` bigint(20) DEFAULT NULL COMMENT '盈利订单笔数',
  802. `day_yield_14` decimal(18,8) DEFAULT NULL COMMENT '14日收益率',
  803. `created_time` datetime DEFAULT NULL,
  804. `updated_time` datetime DEFAULT NULL,
  805. PRIMARY KEY (`id`)
  806. ) ENGINE=InnoDB AUTO_INCREMENT=14453 DEFAULT CHARSET=utf8 COMMENT='统计数据表';
  807. /*!40101 SET character_set_client = @saved_cs_client */;
  808. --
  809. -- Table structure for table `symbol_price`
  810. --
  811. DROP TABLE IF EXISTS `symbol_price`;
  812. /*!40101 SET @saved_cs_client = @@character_set_client */;
  813. /*!50503 SET character_set_client = utf8mb4 */;
  814. CREATE TABLE `symbol_price` (
  815. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  816. `symbol` varchar(50) NOT NULL COMMENT '交易对',
  817. `price` decimal(20,10) NOT NULL COMMENT '价格',
  818. `created_time` datetime DEFAULT NULL,
  819. `updated_time` datetime DEFAULT NULL,
  820. PRIMARY KEY (`id`),
  821. UNIQUE KEY `symbol_UNIQUE` (`symbol`)
  822. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='交易对实时价格';
  823. /*!40101 SET character_set_client = @saved_cs_client */;
  824. --
  825. -- Table structure for table `tag`
  826. --
  827. DROP TABLE IF EXISTS `tag`;
  828. /*!40101 SET @saved_cs_client = @@character_set_client */;
  829. /*!50503 SET character_set_client = utf8mb4 */;
  830. CREATE TABLE `tag` (
  831. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  832. `name` varchar(50) NOT NULL COMMENT '中文名称',
  833. `en_name` varchar(50) NOT NULL COMMENT '英文名称',
  834. `created_time` datetime DEFAULT NULL,
  835. `updated_time` datetime DEFAULT NULL,
  836. PRIMARY KEY (`id`),
  837. UNIQUE KEY `name` (`name`)
  838. ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 COMMENT='标签表';
  839. /*!40101 SET character_set_client = @saved_cs_client */;
  840. --
  841. -- Table structure for table `trader_data`
  842. --
  843. DROP TABLE IF EXISTS `trader_data`;
  844. /*!40101 SET @saved_cs_client = @@character_set_client */;
  845. /*!50503 SET character_set_client = utf8mb4 */;
  846. CREATE TABLE `trader_data` (
  847. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  848. `trader_id` bigint(20) DEFAULT NULL,
  849. `day_yield_14` decimal(18,8) DEFAULT NULL COMMENT '14日收益率',
  850. `day_yield_30` decimal(18,8) DEFAULT NULL COMMENT '30日收益率',
  851. `win_rate_14` decimal(18,8) DEFAULT NULL COMMENT '14日胜率',
  852. `follow_amount` decimal(20,10) DEFAULT NULL COMMENT '累积跟随资金',
  853. `profit_amount` decimal(20,10) DEFAULT NULL COMMENT '累积盈利额',
  854. `follow_customer` bigint(20) DEFAULT NULL COMMENT '累积跟随人数',
  855. `order_deal_14` bigint(20) DEFAULT NULL COMMENT '14日成交单量',
  856. `retraction_rate_14` decimal(18,8) DEFAULT NULL COMMENT '14日最大回撤率',
  857. `trading_days` bigint(20) DEFAULT NULL COMMENT '累积交易天数',
  858. `profit_days` bigint(20) DEFAULT NULL COMMENT '累积盈利天数',
  859. `current_month_follow` bigint(20) DEFAULT NULL COMMENT '本月跟随人数',
  860. `created_time` datetime DEFAULT NULL,
  861. `updated_time` datetime DEFAULT NULL,
  862. `team_profit14` decimal(20,10) DEFAULT NULL COMMENT '14日团队盈利',
  863. PRIMARY KEY (`id`),
  864. UNIQUE KEY `trader` (`trader_id`)
  865. ) ENGINE=InnoDB AUTO_INCREMENT=275 DEFAULT CHARSET=utf8 COMMENT='交易员统计数据';
  866. /*!40101 SET character_set_client = @saved_cs_client */;
  867. --
  868. -- Table structure for table `trader_level`
  869. --
  870. DROP TABLE IF EXISTS `trader_level`;
  871. /*!40101 SET @saved_cs_client = @@character_set_client */;
  872. /*!50503 SET character_set_client = utf8mb4 */;
  873. CREATE TABLE `trader_level` (
  874. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  875. `name` varchar(200) NOT NULL COMMENT '等级名称',
  876. `en_name` varchar(200) NOT NULL COMMENT '英文名称',
  877. `asset` decimal(20,10) DEFAULT NULL COMMENT '资产要求',
  878. `max_follow` int(11) DEFAULT NULL COMMENT '最大跟随数',
  879. `dividend_percent` int(6) NOT NULL,
  880. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  881. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  882. PRIMARY KEY (`id`),
  883. UNIQUE KEY `name` (`name`)
  884. ) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8 COMMENT='交易员等级表';
  885. /*!40101 SET character_set_client = @saved_cs_client */;
  886. --
  887. -- Table structure for table `trader_symbol`
  888. --
  889. DROP TABLE IF EXISTS `trader_symbol`;
  890. /*!40101 SET @saved_cs_client = @@character_set_client */;
  891. /*!50503 SET character_set_client = utf8mb4 */;
  892. CREATE TABLE `trader_symbol` (
  893. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  894. `trader_id` bigint(20) DEFAULT NULL COMMENT '交易员ID',
  895. `symbol` varchar(50) DEFAULT NULL COMMENT '合约交易对',
  896. `contract_symbol_id` int(11) DEFAULT NULL COMMENT '外部合约交易对id',
  897. `created_time` datetime DEFAULT NULL COMMENT '创建时间',
  898. `updated_time` datetime DEFAULT NULL COMMENT '更新时间',
  899. PRIMARY KEY (`id`),
  900. UNIQUE KEY `trader_symbol_unique` (`trader_id`,`contract_symbol_id`)
  901. ) ENGINE=InnoDB AUTO_INCREMENT=721 DEFAULT CHARSET=utf8 COMMENT='交易员带单合约';
  902. /*!40101 SET character_set_client = @saved_cs_client */;
  903. --
  904. -- Table structure for table `trader_tag`
  905. --
  906. DROP TABLE IF EXISTS `trader_tag`;
  907. /*!40101 SET @saved_cs_client = @@character_set_client */;
  908. /*!50503 SET character_set_client = utf8mb4 */;
  909. CREATE TABLE `trader_tag` (
  910. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  911. `trader_id` bigint(20) NOT NULL COMMENT '交易员ID',
  912. `tag_id` bigint(20) NOT NULL COMMENT '标签ID',
  913. `created_time` datetime DEFAULT NULL,
  914. `updated_time` datetime DEFAULT NULL,
  915. PRIMARY KEY (`id`)
  916. ) ENGINE=InnoDB AUTO_INCREMENT=733 DEFAULT CHARSET=utf8 COMMENT='交易员标签表';
  917. /*!40101 SET character_set_client = @saved_cs_client */;
  918. --
  919. -- Table structure for table `user`
  920. --
  921. DROP TABLE IF EXISTS `user`;
  922. /*!40101 SET @saved_cs_client = @@character_set_client */;
  923. /*!50503 SET character_set_client = utf8mb4 */;
  924. CREATE TABLE `user` (
  925. `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '用户ID',
  926. `username` varchar(50) DEFAULT NULL COMMENT '用户名',
  927. `password` varchar(100) DEFAULT NULL COMMENT '密码',
  928. `mobile` varchar(50) DEFAULT NULL COMMENT '手机',
  929. `email` varchar(50) DEFAULT NULL COMMENT '邮箱',
  930. `status` tinyint(2) DEFAULT NULL COMMENT '状态',
  931. `created_time` timestamp NULL DEFAULT NULL COMMENT '创建时间',
  932. `updated_time` timestamp NULL DEFAULT NULL COMMENT '更新时间',
  933. PRIMARY KEY (`id`)
  934. ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='测试用户表';
  935. /*!40101 SET character_set_client = @saved_cs_client */;
  936. SET @@SESSION.SQL_LOG_BIN = @MYSQLDUMP_TEMP_LOG_BIN;
  937. /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
  938. /*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
  939. /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
  940. /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
  941. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  942. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  943. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  944. /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
  945. -- Dump completed on 2026-02-28 13:09:36