crossbordercoll.sql 28 KB

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