CREATE TABLE `swap_position` ( `id` bigint NOT NULL AUTO_INCREMENT, `PositionId` bigint NOT NULL COMMENT '期初持仓id', `SwapTradeId` int NOT NULL COMMENT '互换交易编码', `PosiDirection` tinyint NOT NULL COMMENT '收支方向 1:收取,2:支付', `PositionType` tinyint NOT NULL COMMENT '多空方向 1:long,2:short', `UnderlyingCode` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci DEFAULT NULL COMMENT '标的代码', `CountRatio` double(18,4) NOT NULL COMMENT '乘积因子', `ContractSize` double(18,4) NOT NULL COMMENT '合约乘数', `PosiGrossPrice` double(18,4) NOT NULL COMMENT '期初标的价格不含费', `PosiNetPrice` double(18,4) NOT NULL COMMENT '期初标的价格', `PosiQuantity` double(18,10) NOT NULL COMMENT '交易数量', `PosiTradingFee` double(18,4) NOT NULL COMMENT '交易费用', `PositionLots` double(18,4) NOT NULL COMMENT '持仓手数', `PosiNotionalValue` double(18,4) NOT NULL COMMENT '期初名义本金', `PosiStartDate` date NOT NULL COMMENT '起始日', `PosiMatuirityDate` date DEFAULT NULL COMMENT '到期日', `PosiDividendIncome` double(18,4) NOT NULL COMMENT '平仓部分分红收益(累计)', `PosiTradingFeePending` double(18,4) NOT NULL COMMENT '交易费用(待结算累计)', `InterestDirection` tinyint DEFAULT NULL COMMENT '1:收取,2:支付', `InterestRateDefault` double(18,4) NOT NULL COMMENT '计息利率(年化)', `InterestMode` tinyint NOT NULL COMMENT '计息方式 1:固定值,2:合约名义本金规模,3:持仓名义本金,4:持仓市值', `InterestPrincipalFix` double(18,4) NOT NULL COMMENT '计息基准(固定值时适用)', `InterestSwapInterval` text CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT '互换间隔', `InterestAmount` double(18,4) NOT NULL COMMENT '利息金额(实时持仓用)', `InterestFeePending` double(18,4) NOT NULL COMMENT '待结算其他费用(实时持仓用)', `IsInitial` bit(1) NOT NULL COMMENT '0实时,1期初', `OptId` int NOT NULL COMMENT '操作人ID', `OptName` varchar(64) NOT NULL COMMENT '操作人名称', `OptTime` datetime NOT NULL COMMENT '操作时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=41 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC COMMENT='互换持仓数据表';