crossbordercoll.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439
  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: 24/04/2022 17:57:33
  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,
  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. `supported_currencies` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '支持的币种',
  89. `state` int(0) NULL DEFAULT NULL,
  90. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  91. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  92. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  93. PRIMARY KEY (`id`) USING BTREE
  94. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic;
  95. -- ----------------------------
  96. -- Records of channel
  97. -- ----------------------------
  98. -- ----------------------------
  99. -- Table structure for currency
  100. -- ----------------------------
  101. DROP TABLE IF EXISTS `currency`;
  102. CREATE TABLE `currency` (
  103. `id` int(0) NOT NULL AUTO_INCREMENT,
  104. `currency_id` bigint(0) NULL DEFAULT NULL,
  105. `currency_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL,
  106. `currency_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT '币种类型',
  107. `state` int(0) NULL DEFAULT NULL,
  108. `created_at` datetime(0) NULL DEFAULT NULL,
  109. `updated_at` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0),
  110. `deleted_at` datetime(0) NULL DEFAULT NULL,
  111. PRIMARY KEY (`id`) USING BTREE
  112. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci COMMENT = '币种' ROW_FORMAT = Dynamic;
  113. -- ----------------------------
  114. -- Records of currency
  115. -- ----------------------------
  116. -- ----------------------------
  117. -- Table structure for merchant
  118. -- ----------------------------
  119. DROP TABLE IF EXISTS `merchant`;
  120. CREATE TABLE `merchant` (
  121. `id` int(0) NOT NULL AUTO_INCREMENT,
  122. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  123. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  124. `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  125. `username` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '用戶名字',
  126. `phone` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '手机号',
  127. `password` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '密碼',
  128. `salt` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '加密盐',
  129. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '状态 0:关停,1:激活,2:待激活,3:待审核',
  130. `avatar` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '头像',
  131. `email` varchar(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '' COMMENT '邮箱',
  132. `pause_transfer` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否暂停转账(0:否,1:是)',
  133. `pause_login` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否暂停登录(0:否,1:是)',
  134. `transfer_fee_type` tinyint(1) NOT NULL DEFAULT 0 COMMENT '付款手续费收取形式(0:内扣;1:外扣;) ',
  135. `join_fee` decimal(10, 2) NOT NULL COMMENT '开户费',
  136. `anual_fee` decimal(10, 2) NOT NULL COMMENT '年服务费',
  137. `transfer_fee` decimal(10, 2) NOT NULL COMMENT '外币付款手续费(USD)',
  138. `transfer_fee_cny` decimal(10, 2) NOT NULL COMMENT '人民币付款手续费(USD)',
  139. `confirm_token` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '开户验证码 (google登陆验证器token)',
  140. PRIMARY KEY (`id`) USING BTREE
  141. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  142. -- ----------------------------
  143. -- Records of merchant
  144. -- ----------------------------
  145. -- ----------------------------
  146. -- Table structure for merchant_account_out
  147. -- ----------------------------
  148. DROP TABLE IF EXISTS `merchant_account_out`;
  149. CREATE TABLE `merchant_account_out` (
  150. `id` int(0) NOT NULL AUTO_INCREMENT,
  151. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  152. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  153. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  154. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  155. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
  156. `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
  157. `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
  158. `currency_id` int(0) NULL DEFAULT 0 COMMENT '关联的币种id',
  159. `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
  160. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  161. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  162. PRIMARY KEY (`id`) USING BTREE
  163. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
  164. -- ----------------------------
  165. -- Records of merchant_account_out
  166. -- ----------------------------
  167. -- ----------------------------
  168. -- Table structure for merchant_account_out_log
  169. -- ----------------------------
  170. DROP TABLE IF EXISTS `merchant_account_out_log`;
  171. CREATE TABLE `merchant_account_out_log` (
  172. `id` int(0) NOT NULL AUTO_INCREMENT,
  173. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  174. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  175. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  176. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  177. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
  178. `account_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
  179. `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
  180. `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
  181. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  182. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  183. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  184. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  185. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  186. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  187. PRIMARY KEY (`id`) USING BTREE
  188. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  189. -- ----------------------------
  190. -- Records of merchant_account_out_log
  191. -- ----------------------------
  192. -- ----------------------------
  193. -- Table structure for merchant_account_out_tpl
  194. -- ----------------------------
  195. DROP TABLE IF EXISTS `merchant_account_out_tpl`;
  196. CREATE TABLE `merchant_account_out_tpl` (
  197. `id` int(0) NOT NULL AUTO_INCREMENT,
  198. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  199. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  200. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  201. `state` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '状态',
  202. `currency` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  203. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型',
  204. `currency_type_cn` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '货币类型中文',
  205. `account_properties` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '账户属性',
  206. PRIMARY KEY (`id`) USING BTREE
  207. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户模板表' ROW_FORMAT = Dynamic;
  208. -- ----------------------------
  209. -- Records of merchant_account_out_tpl
  210. -- ----------------------------
  211. -- ----------------------------
  212. -- Table structure for merchant_account_sys
  213. -- ----------------------------
  214. DROP TABLE IF EXISTS `merchant_account_sys`;
  215. CREATE TABLE `merchant_account_sys` (
  216. `id` int(0) NOT NULL AUTO_INCREMENT,
  217. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  218. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  219. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  220. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  221. `sys_account_id` int(0) NULL DEFAULT NULL COMMENT '关联的平台账户的id',
  222. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
  223. `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
  224. `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
  225. `currency_id` int(0) NULL DEFAULT 0 COMMENT '关联的币种id',
  226. `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
  227. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  228. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  229. PRIMARY KEY (`id`) USING BTREE
  230. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
  231. -- ----------------------------
  232. -- Records of merchant_account_sys
  233. -- ----------------------------
  234. -- ----------------------------
  235. -- Table structure for merchant_contperson
  236. -- ----------------------------
  237. DROP TABLE IF EXISTS `merchant_contperson`;
  238. CREATE TABLE `merchant_contperson` (
  239. `id` int(0) NOT NULL AUTO_INCREMENT,
  240. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  241. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  242. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  243. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  244. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  245. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  246. `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  247. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  248. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  249. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  250. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  251. `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  252. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  253. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  254. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  255. PRIMARY KEY (`id`) USING BTREE
  256. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  257. -- ----------------------------
  258. -- Records of merchant_contperson
  259. -- ----------------------------
  260. -- ----------------------------
  261. -- Table structure for merchant_kyc
  262. -- ----------------------------
  263. DROP TABLE IF EXISTS `merchant_kyc`;
  264. CREATE TABLE `merchant_kyc` (
  265. `id` int(0) NOT NULL AUTO_INCREMENT,
  266. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  267. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  268. `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  269. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  270. `company_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '企业名称',
  271. `tel` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电话',
  272. `biz_license_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '营业执照号',
  273. PRIMARY KEY (`id`) USING BTREE
  274. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  275. -- ----------------------------
  276. -- Records of merchant_kyc
  277. -- ----------------------------
  278. -- ----------------------------
  279. -- Table structure for payment_order
  280. -- ----------------------------
  281. DROP TABLE IF EXISTS `payment_order`;
  282. CREATE TABLE `payment_order` (
  283. `id` int(0) NOT NULL AUTO_INCREMENT,
  284. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  285. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  286. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  287. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  288. `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品台生成的交易单号',
  289. `from_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自银行的账户编号',
  290. `from_account_id` int(0) NULL DEFAULT 0 COMMENT '来自账户的id',
  291. `to_account_id` int(0) NULL DEFAULT 0 COMMENT '转到账户的id',
  292. `to_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '转到银行的账户编号',
  293. `channel_id` int(0) NULL DEFAULT NULL COMMENT '交易渠道id',
  294. `exchange_rate` decimal(10, 10) NULL DEFAULT NULL COMMENT '汇率',
  295. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  296. `from_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自币种',
  297. `to_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '目标币种',
  298. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  299. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  300. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  301. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  302. `trade_org_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的id',
  303. `trade_org_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构代码',
  304. `org_trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的交易单号',
  305. `state` tinyint(0) NULL DEFAULT NULL COMMENT '交易状态',
  306. PRIMARY KEY (`id`) USING BTREE
  307. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  308. -- ----------------------------
  309. -- Records of payment_order
  310. -- ----------------------------
  311. -- ----------------------------
  312. -- Table structure for payment_order_ext
  313. -- ----------------------------
  314. DROP TABLE IF EXISTS `payment_order_ext`;
  315. CREATE TABLE `payment_order_ext` (
  316. `id` int(0) NOT NULL AUTO_INCREMENT,
  317. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  318. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  319. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  320. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  321. `accout_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
  322. `accout_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
  323. `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
  324. `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
  325. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  326. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  327. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  328. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  329. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  330. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  331. PRIMARY KEY (`id`) USING BTREE
  332. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  333. -- ----------------------------
  334. -- Records of payment_order_ext
  335. -- ----------------------------
  336. -- ----------------------------
  337. -- Table structure for payment_order_log
  338. -- ----------------------------
  339. DROP TABLE IF EXISTS `payment_order_log`;
  340. CREATE TABLE `payment_order_log` (
  341. `id` int(0) NOT NULL AUTO_INCREMENT,
  342. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  343. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  344. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  345. `local_trade_no` int(0) NOT NULL DEFAULT 0 COMMENT '本地交易单号',
  346. `order_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '本地交易单号的id',
  347. `out_trade_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易单号,银行方',
  348. `step_r` int(0) NULL DEFAULT 0 COMMENT '交易的步骤',
  349. `step_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易的步骤名称',
  350. `local_msg` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '本地向银行机构发起的请求信息',
  351. `org_msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '银行机构通知的消息',
  352. PRIMARY KEY (`id`) USING BTREE
  353. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户支付订单记录' ROW_FORMAT = Dynamic;
  354. -- ----------------------------
  355. -- Records of payment_order_log
  356. -- ----------------------------
  357. -- ----------------------------
  358. -- Table structure for sys_account
  359. -- ----------------------------
  360. DROP TABLE IF EXISTS `sys_account`;
  361. CREATE TABLE `sys_account` (
  362. `id` int(0) NOT NULL AUTO_INCREMENT,
  363. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  364. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  365. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  366. `pid` int(0) NULL DEFAULT 0 COMMENT '子账户所关联的父账户id',
  367. `is_main` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否主账户{ 1:是 ,2:子账户}',
  368. `bank_id` int(0) NULL DEFAULT NULL COMMENT '银行记录的id',
  369. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  370. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  371. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  372. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  373. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  374. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  375. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  376. `area_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  377. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  378. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  379. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  380. PRIMARY KEY (`id`) USING BTREE
  381. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户交易明细' ROW_FORMAT = Dynamic;
  382. -- ----------------------------
  383. -- Records of sys_account
  384. -- ----------------------------
  385. -- ----------------------------
  386. -- Table structure for table_template
  387. -- ----------------------------
  388. DROP TABLE IF EXISTS `table_template`;
  389. CREATE TABLE `table_template` (
  390. `id` int(0) NOT NULL AUTO_INCREMENT,
  391. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  392. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  393. `deleted_at` datetime(0) NOT NULL COMMENT '修改时间',
  394. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '狀態 0 待審核 1 審核中 2 正常 4 刪除 -1 已經註銷',
  395. PRIMARY KEY (`id`) USING BTREE
  396. ) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台登錄表' ROW_FORMAT = Dynamic;
  397. -- ----------------------------
  398. -- Records of table_template
  399. -- ----------------------------
  400. SET FOREIGN_KEY_CHECKS = 1;