crossbordercoll.sql 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  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 16:20:04
  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. `sys_account_id` int(0) NULL DEFAULT NULL COMMENT '关联的平台账户的id',
  220. `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行的账户编号',
  221. `balance_amount` decimal(10, 2) NOT NULL COMMENT '余额',
  222. `freeze_amount` decimal(10, 2) NOT NULL COMMENT '冻结的余额',
  223. `currency_id` int(0) NULL DEFAULT 0 COMMENT '关联的币种id',
  224. `capital_prop` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '资金的属性',
  225. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  226. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  227. PRIMARY KEY (`id`) USING BTREE
  228. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户表' ROW_FORMAT = Dynamic;
  229. -- ----------------------------
  230. -- Records of merchant_account_sys
  231. -- ----------------------------
  232. -- ----------------------------
  233. -- Table structure for merchant_contperson
  234. -- ----------------------------
  235. DROP TABLE IF EXISTS `merchant_contperson`;
  236. CREATE TABLE `merchant_contperson` (
  237. `id` int(0) NOT NULL AUTO_INCREMENT,
  238. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  239. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  240. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  241. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  242. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  243. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  244. `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  245. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  246. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  247. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  248. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  249. `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  250. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  251. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  252. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  253. PRIMARY KEY (`id`) USING BTREE
  254. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  255. -- ----------------------------
  256. -- Records of merchant_contperson
  257. -- ----------------------------
  258. -- ----------------------------
  259. -- Table structure for merchant_kyc
  260. -- ----------------------------
  261. DROP TABLE IF EXISTS `merchant_kyc`;
  262. CREATE TABLE `merchant_kyc` (
  263. `id` int(0) NOT NULL AUTO_INCREMENT,
  264. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  265. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  266. `deleted_at` datetime(0) NULL DEFAULT NULL COMMENT '修改时间',
  267. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  268. `company_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '企业名称',
  269. `tel` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '电话',
  270. `biz_license_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '营业执照号',
  271. PRIMARY KEY (`id`) USING BTREE
  272. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户基本信息表' ROW_FORMAT = Dynamic;
  273. -- ----------------------------
  274. -- Records of merchant_kyc
  275. -- ----------------------------
  276. -- ----------------------------
  277. -- Table structure for payment_order
  278. -- ----------------------------
  279. DROP TABLE IF EXISTS `payment_order`;
  280. CREATE TABLE `payment_order` (
  281. `id` int(0) NOT NULL AUTO_INCREMENT,
  282. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  283. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  284. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  285. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  286. `trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '品台生成的交易单号',
  287. `from_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自银行的账户编号',
  288. `from_account_id` int(0) NULL DEFAULT 0 COMMENT '来自账户的id',
  289. `to_account_id` int(0) NULL DEFAULT 0 COMMENT '转到账户的id',
  290. `to_account_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '转到银行的账户编号',
  291. `exchange_rate` decimal(10, 10) NULL DEFAULT NULL COMMENT '汇率',
  292. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  293. `from_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '来自币种',
  294. `to_currency_id` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '目标币种',
  295. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  296. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  297. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  298. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  299. `trade_org_id` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的id',
  300. `trade_org_code` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构代码',
  301. `org_trade_no` varchar(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '交易机构的交易单号',
  302. PRIMARY KEY (`id`) USING BTREE
  303. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  304. -- ----------------------------
  305. -- Records of payment_order
  306. -- ----------------------------
  307. -- ----------------------------
  308. -- Table structure for payment_order_ext
  309. -- ----------------------------
  310. DROP TABLE IF EXISTS `payment_order_ext`;
  311. CREATE TABLE `payment_order_ext` (
  312. `id` int(0) NOT NULL AUTO_INCREMENT,
  313. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  314. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  315. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  316. `merchant_id` int(0) NOT NULL DEFAULT 0 COMMENT '商户ID',
  317. `accout_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '外部账户关联的银行的账户编号',
  318. `accout_out_id` int(0) NULL DEFAULT 0 COMMENT '外部账户记录的id',
  319. `before` decimal(10, 2) NOT NULL COMMENT '交易前的余额',
  320. `after` decimal(10, 2) NOT NULL COMMENT '交易后的余额',
  321. `amount` decimal(10, 2) NOT NULL COMMENT '交易的金额',
  322. `currency_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '币种',
  323. `transfer_type` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易类型(汇兑、结汇、充值)',
  324. `transfer_state` tinyint(1) NOT NULL DEFAULT 0 COMMENT '交易状态',
  325. `remark` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '备注',
  326. `loan_mark` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '借贷标识',
  327. PRIMARY KEY (`id`) USING BTREE
  328. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户余额明细记录' ROW_FORMAT = Dynamic;
  329. -- ----------------------------
  330. -- Records of payment_order_ext
  331. -- ----------------------------
  332. -- ----------------------------
  333. -- Table structure for payment_order_log
  334. -- ----------------------------
  335. DROP TABLE IF EXISTS `payment_order_log`;
  336. CREATE TABLE `payment_order_log` (
  337. `id` int(0) NOT NULL AUTO_INCREMENT,
  338. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  339. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  340. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  341. `local_trade_no` int(0) NOT NULL DEFAULT 0 COMMENT '本地交易单号',
  342. `order_id` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '本地交易单号的id',
  343. `out_trade_no` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '交易单号,银行方',
  344. `step_r` int(0) NULL DEFAULT 0 COMMENT '交易的步骤',
  345. `step_name` varchar(10) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '交易的步骤名称',
  346. `local_msg` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '本地向银行机构发起的请求信息',
  347. `org_msg` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '银行机构通知的消息',
  348. PRIMARY KEY (`id`) USING BTREE
  349. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户支付订单记录' ROW_FORMAT = Dynamic;
  350. -- ----------------------------
  351. -- Records of payment_order_log
  352. -- ----------------------------
  353. -- ----------------------------
  354. -- Table structure for sys_account
  355. -- ----------------------------
  356. DROP TABLE IF EXISTS `sys_account`;
  357. CREATE TABLE `sys_account` (
  358. `id` int(0) NOT NULL AUTO_INCREMENT,
  359. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  360. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  361. `deleted_at` datetime(0) NOT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  362. `pid` int(0) NULL DEFAULT 0 COMMENT '子账户所关联的父账户id',
  363. `is_main` tinyint(1) NOT NULL DEFAULT 0 COMMENT '是否主账户{ 1:是 ,2:子账户}',
  364. `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  365. `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  366. `account_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  367. `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  368. `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  369. `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  370. `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  371. `city` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  372. `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  373. `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  374. `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'SWIFT CODE',
  375. PRIMARY KEY (`id`) USING BTREE
  376. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '商户外部账户交易明细' ROW_FORMAT = Dynamic;
  377. -- ----------------------------
  378. -- Records of sys_account
  379. -- ----------------------------
  380. -- ----------------------------
  381. -- Table structure for table_template
  382. -- ----------------------------
  383. DROP TABLE IF EXISTS `table_template`;
  384. CREATE TABLE `table_template` (
  385. `id` int(0) NOT NULL AUTO_INCREMENT,
  386. `created_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '创建时间',
  387. `updated_at` datetime(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间',
  388. `deleted_at` datetime(0) NOT NULL COMMENT '修改时间',
  389. `state` tinyint(0) NOT NULL DEFAULT 0 COMMENT '狀態 0 待審核 1 審核中 2 正常 4 刪除 -1 已經註銷',
  390. PRIMARY KEY (`id`) USING BTREE
  391. ) ENGINE = InnoDB AUTO_INCREMENT = 67 CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '后台登錄表' ROW_FORMAT = Dynamic;
  392. -- ----------------------------
  393. -- Records of table_template
  394. -- ----------------------------
  395. SET FOREIGN_KEY_CHECKS = 1;