crossbordercoll.sql 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. /*
  2. Navicat Premium Data Transfer
  3. Source Server : 跨境收款-测试
  4. Source Server Type : MySQL
  5. Source Server Version : 80024
  6. Source Host : 127.0.0.1:3306
  7. Source Schema : crossbordercoll
  8. Target Server Type : MySQL
  9. Target Server Version : 80024
  10. File Encoding : 65001
  11. Date: 25/04/2022 16:21:47
  12. */
  13. SET NAMES utf8mb4;
  14. SET FOREIGN_KEY_CHECKS = 0;
  15. -- ----------------------------
  16. -- Table structure for admin_u
  17. -- ----------------------------
  18. DROP TABLE IF EXISTS `admin_u`;
  19. CREATE TABLE `admin_u` (
  20. `id` int(0) NOT NULL AUTO_INCREMENT,
  21. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  22. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  23. `deleted_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  24. `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
  25. `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
  26. `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密碼',
  27. `salt` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '加密盐',
  28. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '狀態 0 待審核 1 審核中 2 正常 4 刪除 -1 已經註銷',
  29. `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '头像',
  30. `sex` tinyint(0) NOT NULL DEFAULT 0 COMMENT '性别 0 位置 1男 2女',
  31. `nickname` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用户真实昵称',
  32. `is_super_admin` tinyint(1) NOT NULL DEFAULT 0 COMMENT '超级管理员',
  33. PRIMARY KEY (`id`) USING BTREE
  34. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台登錄表' ROW_FORMAT = Dynamic;
  35. -- ----------------------------
  36. -- Records of admin_u
  37. -- ----------------------------
  38. -- ----------------------------
  39. -- Table structure for area
  40. -- ----------------------------
  41. DROP TABLE IF EXISTS `area`;
  42. CREATE TABLE `area` (
  43. `id` int(0) NOT NULL AUTO_INCREMENT,
  44. `area_id` bigint(0) NULL DEFAULT NULL,
  45. `area_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  46. `area_en` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  47. `state` int(0) NULL DEFAULT NULL,
  48. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  49. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  50. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  51. `pid` int(0) NULL DEFAULT 0 COMMENT '关联上一级区域',
  52. `level` int(0) NULL DEFAULT NULL COMMENT '区域级别 1 :国家或地区 ,2省或州级别 3:城市 ',
  53. `postal_code` varchar(16) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '邮政编码',
  54. PRIMARY KEY (`id`) USING BTREE
  55. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '行政区域' ROW_FORMAT = Dynamic;
  56. -- ----------------------------
  57. -- Records of area
  58. -- ----------------------------
  59. -- ----------------------------
  60. -- Table structure for bank
  61. -- ----------------------------
  62. DROP TABLE IF EXISTS `bank`;
  63. CREATE TABLE `bank` (
  64. `id` int(0) NOT NULL AUTO_INCREMENT,
  65. `bank_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '银行名称中文',
  66. `bank_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型',
  67. `state` int(0) NULL DEFAULT NULL,
  68. `created_at` datetime(0) NULL DEFAULT NULL,
  69. `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  70. `deleted_at` datetime(0) NULL DEFAULT NULL,
  71. PRIMARY KEY (`id`) USING BTREE
  72. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '币种' ROW_FORMAT = Dynamic;
  73. -- ----------------------------
  74. -- Records of bank
  75. -- ----------------------------
  76. -- ----------------------------
  77. -- Table structure for channel
  78. -- ----------------------------
  79. DROP TABLE IF EXISTS `channel`;
  80. CREATE TABLE `channel` (
  81. `id` int(0) NOT NULL AUTO_INCREMENT,
  82. `channel_id` bigint(0) NULL DEFAULT NULL,
  83. `channel_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  84. `channel_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '通道名称',
  85. `docking_method` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '对接方式',
  86. `channel_type` int(0) NULL DEFAULT NULL,
  87. `area` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '区域',
  88. `support_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '支持的币种',
  89. `config` tinytext CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL COMMENT '保存json配置信息',
  90. `state` int(0) NULL DEFAULT NULL,
  91. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  92. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  93. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  94. PRIMARY KEY (`id`) USING BTREE
  95. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  96. -- ----------------------------
  97. -- Records of channel
  98. -- ----------------------------
  99. -- ----------------------------
  100. -- Table structure for currency
  101. -- ----------------------------
  102. DROP TABLE IF EXISTS `currency`;
  103. CREATE TABLE `currency` (
  104. `id` int(0) NOT NULL AUTO_INCREMENT,
  105. `currency_id` bigint(0) NULL DEFAULT NULL COMMENT '货币国际编号',
  106. `currency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货币英文名 US Dollar',
  107. `currency_name_zh` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '货币中文名 美元',
  108. `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型 USD CNY',
  109. `country_zh` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发行国家(中文)',
  110. `min_unit` float(10, 5) NULL DEFAULT NULL COMMENT '流通的最小交易单位',
  111. `country_en` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '发行国家(英文)',
  112. `state` int(0) NULL DEFAULT NULL,
  113. `created_at` datetime(0) NULL DEFAULT NULL,
  114. `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  115. `deleted_at` datetime(0) NULL DEFAULT NULL,
  116. PRIMARY KEY (`id`) USING BTREE
  117. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '币种' ROW_FORMAT = Dynamic;
  118. -- ----------------------------
  119. -- Records of currency
  120. -- ----------------------------
  121. -- ----------------------------
  122. -- Table structure for merchant
  123. -- ----------------------------
  124. DROP TABLE IF EXISTS `merchant`;
  125. CREATE TABLE `merchant` (
  126. `id` int(0) NOT NULL AUTO_INCREMENT,
  127. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  128. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  129. `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  130. `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
  131. `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
  132. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '状态 0:关停,1:激活,2:待激活,3:待审核',
  133. `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像',
  134. `email` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '邮箱',
  135. `pause_transfer` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否暂停转账(0:否,1:是)',
  136. `pause_login` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否暂停登录(0:否,1:是)',
  137. `transfer_fee_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '付款手续费收取形式(0:内扣;1:外扣;) ',
  138. `join_fee` decimal(10, 2) NOT NULL COMMENT '开户费',
  139. `annual_fee` decimal(10, 2) NOT NULL COMMENT '年服务费',
  140. `transfer_fee` decimal(10, 2) NOT NULL COMMENT '外币付款手续费(USD)',
  141. `transfer_fee_cny` decimal(10, 2) NOT NULL COMMENT '人民币付款手续费(USD)',
  142. `confirm_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户验证码 (google登陆验证器token)',
  143. PRIMARY KEY (`id`) USING BTREE
  144. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  145. -- ----------------------------
  146. -- Records of merchant
  147. -- ----------------------------
  148. -- ----------------------------
  149. -- Table structure for merchant_account_out
  150. -- ----------------------------
  151. DROP TABLE IF EXISTS `merchant_account_out`;
  152. CREATE TABLE `merchant_account_out` (
  153. `id` int(0) NOT NULL AUTO_INCREMENT,
  154. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  155. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  156. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  157. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  158. `account_num_bank` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
  159. `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
  160. `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
  161. `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
  162. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  163. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  164. `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户识别码,用于标识',
  165. PRIMARY KEY (`id`) USING BTREE
  166. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
  167. -- ----------------------------
  168. -- Records of merchant_account_out
  169. -- ----------------------------
  170. -- ----------------------------
  171. -- Table structure for merchant_account_out_log
  172. -- ----------------------------
  173. DROP TABLE IF EXISTS `merchant_account_out_log`;
  174. CREATE TABLE `merchant_account_out_log` (
  175. `id` int(0) NOT NULL AUTO_INCREMENT,
  176. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  177. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  178. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  179. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  180. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
  181. `account_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
  182. `account_sys_id` int(0) NULL DEFAULT NULL COMMENT '充值到平台的系统账户的id',
  183. `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
  184. `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
  185. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  186. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  187. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  188. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  189. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  190. `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易单号',
  191. PRIMARY KEY (`id`) USING BTREE
  192. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  193. -- ----------------------------
  194. -- Records of merchant_account_out_log
  195. -- ----------------------------
  196. -- ----------------------------
  197. -- Table structure for merchant_account_out_tpl
  198. -- ----------------------------
  199. DROP TABLE IF EXISTS `merchant_account_out_tpl`;
  200. CREATE TABLE `merchant_account_out_tpl` (
  201. `id` int(0) NOT NULL AUTO_INCREMENT,
  202. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  203. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  204. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  205. `state` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '状态',
  206. `currency` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  207. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型',
  208. `currency_type_cn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型中文',
  209. `account_properties` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户属性',
  210. `tpl_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '模板识别码,用于标识当前的模板',
  211. PRIMARY KEY (`id`) USING BTREE
  212. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户模板表' ROW_FORMAT = Dynamic;
  213. -- ----------------------------
  214. -- Records of merchant_account_out_tpl
  215. -- ----------------------------
  216. -- ----------------------------
  217. -- Table structure for merchant_account_sys
  218. -- ----------------------------
  219. DROP TABLE IF EXISTS `merchant_account_sys`;
  220. CREATE TABLE `merchant_account_sys` (
  221. `id` int(0) NOT NULL AUTO_INCREMENT,
  222. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  223. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  224. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  225. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  226. `sys_account_id` int(0) NULL DEFAULT NULL COMMENT '关联的平台账户的id',
  227. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
  228. `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
  229. `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
  230. `currency_id` int(0) NULL DEFAULT 0 COMMENT '关联的币种id',
  231. `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
  232. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  233. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  234. PRIMARY KEY (`id`) USING BTREE
  235. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
  236. -- ----------------------------
  237. -- Records of merchant_account_sys
  238. -- ----------------------------
  239. -- ----------------------------
  240. -- Table structure for merchant_contperson
  241. -- ----------------------------
  242. DROP TABLE IF EXISTS `merchant_contperson`;
  243. CREATE TABLE `merchant_contperson` (
  244. `id` int(0) NOT NULL AUTO_INCREMENT,
  245. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  246. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  247. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  248. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  249. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  250. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  251. `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  252. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  253. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  254. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  255. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  256. `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  257. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  258. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  259. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  260. PRIMARY KEY (`id`) USING BTREE
  261. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  262. -- ----------------------------
  263. -- Records of merchant_contperson
  264. -- ----------------------------
  265. -- ----------------------------
  266. -- Table structure for merchant_kyc
  267. -- ----------------------------
  268. DROP TABLE IF EXISTS `merchant_kyc`;
  269. CREATE TABLE `merchant_kyc` (
  270. `id` int(0) NOT NULL AUTO_INCREMENT,
  271. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  272. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  273. `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  274. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  275. `company_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '企业名称',
  276. `tel` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电话',
  277. `biz_license_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '营业执照号',
  278. PRIMARY KEY (`id`) USING BTREE
  279. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  280. -- ----------------------------
  281. -- Records of merchant_kyc
  282. -- ----------------------------
  283. -- ----------------------------
  284. -- Table structure for payment_order
  285. -- ----------------------------
  286. DROP TABLE IF EXISTS `payment_order`;
  287. CREATE TABLE `payment_order` (
  288. `id` int(0) NOT NULL AUTO_INCREMENT,
  289. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  290. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  291. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  292. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  293. `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品台生成的交易单号',
  294. `from_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自银行的账户编号',
  295. `from_account_id` int(0) NULL DEFAULT 0 COMMENT '来自账户的id',
  296. `to_account_id` int(0) NULL DEFAULT 0 COMMENT '转到账户的id',
  297. `to_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '转到银行的账户编号',
  298. `channel_id` int(0) NULL DEFAULT NULL COMMENT '交易渠道id',
  299. `exchange_rate` decimal(10, 10) NULL DEFAULT NULL COMMENT '汇率',
  300. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  301. `from_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自币种',
  302. `to_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '目标币种',
  303. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  304. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  305. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  306. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  307. `trade_org_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的id',
  308. `trade_org_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构代码',
  309. `org_trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的交易单号',
  310. `state` tinyint(0) NULL DEFAULT NULL COMMENT '交易状态',
  311. PRIMARY KEY (`id`) USING BTREE
  312. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  313. -- ----------------------------
  314. -- Records of payment_order
  315. -- ----------------------------
  316. -- ----------------------------
  317. -- Table structure for payment_order_ext
  318. -- ----------------------------
  319. DROP TABLE IF EXISTS `payment_order_ext`;
  320. CREATE TABLE `payment_order_ext` (
  321. `id` int(0) NOT NULL AUTO_INCREMENT,
  322. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  323. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  324. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  325. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  326. `accout_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
  327. `accout_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
  328. `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
  329. `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
  330. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  331. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  332. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  333. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  334. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  335. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  336. PRIMARY KEY (`id`) USING BTREE
  337. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  338. -- ----------------------------
  339. -- Records of payment_order_ext
  340. -- ----------------------------
  341. -- ----------------------------
  342. -- Table structure for payment_order_log
  343. -- ----------------------------
  344. DROP TABLE IF EXISTS `payment_order_log`;
  345. CREATE TABLE `payment_order_log` (
  346. `id` int(0) NOT NULL AUTO_INCREMENT,
  347. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  348. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  349. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  350. `local_trade_no` int(0) NOT NULL DEFAULT 0 COMMENT '本地交易单号',
  351. `order_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '本地交易单号的id',
  352. `out_trade_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易单号,银行方',
  353. `step_r` int(0) NULL DEFAULT 0 COMMENT '交易的步骤',
  354. `step_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易的步骤名称',
  355. `local_msg` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '本地向银行机构发起的请求信息',
  356. `org_msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '银行机构通知的消息',
  357. PRIMARY KEY (`id`) USING BTREE
  358. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户支付订单记录' ROW_FORMAT = Dynamic;
  359. -- ----------------------------
  360. -- Records of payment_order_log
  361. -- ----------------------------
  362. -- ----------------------------
  363. -- Table structure for sys_account
  364. -- ----------------------------
  365. DROP TABLE IF EXISTS `sys_account`;
  366. CREATE TABLE `sys_account` (
  367. `id` int(0) NOT NULL AUTO_INCREMENT,
  368. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  369. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  370. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  371. `open_at` datetime(0) NULL DEFAULT NULL COMMENT '开户时间',
  372. `pid` int(0) NULL DEFAULT 0 COMMENT '子账户所关联的父账户id',
  373. `is_main` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否主账户{ 1:是 ,2:子账户}',
  374. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  375. `bank_mer_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行商户号',
  376. `bank_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '在银行的账户号',
  377. `bank_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '银行号',
  378. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  379. `bank_branch_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '分行代码',
  380. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  381. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名称',
  382. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  383. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区 如中国',
  384. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如广东省',
  385. `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州 如深圳市',
  386. `area` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的区域 如南山区',
  387. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  388. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  389. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  390. `state` tinyint(1) NULL DEFAULT NULL COMMENT '账户状态(特指本收款平台方)',
  391. `account_state` tinyint(1) NULL DEFAULT NULL COMMENT '银行账户状态(特指银行方)',
  392. `bank_state_branc_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT 'BSB(BankStateBranch)NO',
  393. `path_clearing_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '路径清算号',
  394. `bpay_biller_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  395. `bpay_customer_ref` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
  396. `cnaps_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '中国现代化支付系统;',
  397. `zengin_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'zengin',
  398. `fedwire` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'Fedwire',
  399. PRIMARY KEY (`id`) USING BTREE
  400. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '平台的银行帐户' ROW_FORMAT = Dynamic;
  401. -- ----------------------------
  402. -- Records of sys_account
  403. -- ----------------------------
  404. -- ----------------------------
  405. -- Table structure for table_template
  406. -- ----------------------------
  407. DROP TABLE IF EXISTS `table_template`;
  408. CREATE TABLE `table_template` (
  409. `id` int(0) NOT NULL AUTO_INCREMENT,
  410. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  411. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  412. `deleted_at` datetime(0) NOT NULL COMMENT '修改时间',
  413. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '狀態 0 待審核 1 審核中 2 正常 4 刪除 -1 已經註銷',
  414. PRIMARY KEY (`id`) USING BTREE
  415. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台登錄表' ROW_FORMAT = Dynamic;
  416. -- ----------------------------
  417. -- Records of table_template
  418. -- ----------------------------
  419. SET FOREIGN_KEY_CHECKS = 1;