dba-kit
(张天师)
3
CREATE TABLE `account_stat` (
`service_account_id` varchar(30) NOT NULL COMMENT '服务账户ID',
`cal_date` date NOT NULL COMMENT '计算日期',
`broker` varchar(10) NOT NULL COMMENT '渠道编号',
`broker_user_id` varchar(255) NOT NULL COMMENT '上层客户编号',
`po_code` varchar(10) NOT NULL COMMENT '投顾策略代码',
`open_position_flag` varchar(1) NOT NULL COMMENT '是否建仓中 Y是 N否',
`deviation_rate` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT 'ca实际偏离率',
`refer_deviation_rate` decimal(20,4) NOT NULL DEFAULT '0.0000' COMMENT '定制账户参考偏离率',
`total_asset` decimal(20,6) NOT NULL COMMENT '账号当日总资产',
`turnover_rate` decimal(14,8) DEFAULT '0.00000000' COMMENT '换手率',
`processing_amount` decimal(14,8) DEFAULT '0.00000000' COMMENT '在途资产 = total_asset-market_value',
`fund_details` json NOT NULL COMMENT '[{"fundCode":"000509","amountSum":123.24,"shareSum":1234.23,"percentInPoAsset":0.2342}]',
`txn_account_ids` varchar(1024) NOT NULL DEFAULT '' COMMENT '交易账户集合,逗号分割',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
`update_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`service_account_id`,`cal_date`) /*T![clustered_index] CLUSTERED */,
KEY `idx_po_code` (`cal_date`,`po_code`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin COMMENT='定制账户pms指标存储表'