##  系统银行记录表
> 伞形账户的主账户 由`is_main`判断， 主账户 有多个子账户
> 
> 伞形账户的子账户的pid关联当前银行记录表的主账户

> is_main :是否主账户，主账户关联本表的一个或多个子账户
>
> pid` int DEFAULT '0' COMMENT '子账户所关联的父账户id
>
> bank_id: 关联银行记录的id[bank.id](./bank.md)  ,
>
> bank_code :关联银行记录[bank.bank_code](./bank.md)  ，
>
> bank_name  : 关联银行记录[bank.bank_name](./bank.md)  ，
> 
> area_id : 关联区域的id[area.id](./area.md)
>
> postal_code : 关联区域的邮政编码[area.postal_code](./area.md)
>
> swift_code ：国际结算系统中编号


```mysql
CREATE TABLE `sys_account` (
  `id` int NOT NULL AUTO_INCREMENT,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
  `updated_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `deleted_at` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '修改时间',
  `pid` int DEFAULT '0' COMMENT '子账户所关联的父账户id',
  `is_main` tinyint(1) NOT NULL DEFAULT '0' COMMENT '是否主账户{ 1：是 ,2：子账户}',
  `bank_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '银行名称',
  `bank_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '0' COMMENT '银行代码',
  `account_num` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户编号',
  `account_name` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名',
  `account_name_en` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '账户名 英文',
  `country` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL COMMENT '账户所属的国家/地区',
  `province` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州',
  `area_id` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '账户所属的省/州城市',
  `address` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '详细地址',
  `postal_code` varchar(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT '' COMMENT '邮政编码',
  `swift_code` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT 'SWIFT CODE',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 ROW_FORMAT=DYNAMIC COMMENT='商户外部账户交易明细';
```