CREATE TABLE `eod_swap_position` ( `id` bigint NOT NULL AUTO_INCREMENT COMMENT 'ID', `ValueDate` date NOT NULL COMMENT '归档日期', `ClientId` int NOT NULL COMMENT '客户编码', `SwapTradeId` int NOT NULL COMMENT '互换交易编码', `PositionId` bigint 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 '标的代码', `ContractSize` double(18,4) NOT NULL COMMENT '合约乘数', `CountRatio` double(18,4) NOT NULL COMMENT '合约乘积因子', `PosiNetPrice` double(18,4) NOT NULL COMMENT '期初标的价格', `PosiGrossPrice` double(18,4) NOT NULL COMMENT '期初标的价格-不含费', `PosiQuantity` double(18,10) NOT NULL COMMENT '剩余持仓数量', `PosiNotionalValue` double(18,4) NOT NULL COMMENT '期初名义本金', `PosiTradingFee` double(18,4) NOT NULL COMMENT '开仓佣金费用', `PosiStartDate` date NOT NULL COMMENT '起始日', `PosiMatuirityDate` date DEFAULT NULL COMMENT '到期日', `UnderlyingPrice` double(18,4) NOT NULL COMMENT '盯市价格', `UnderlyingMarketValue` double(18,4) NOT NULL COMMENT '标的市值,空头持仓为负数', `TdPosiDividend` double(18,4) NOT NULL COMMENT '当日浮动端分红', `PosiMtmPnL` double(18,4) NOT NULL COMMENT '因标的价格变化导致的收益(盯市、未实现)', `PosiDividendSum` double(18,4) NOT NULL COMMENT '因分红导致的分红收益(未实现)', `PosiFeePending` double(18,4) NOT NULL COMMENT '后付的费用(未实现)', `PosiProfitSum` double(18,4) NOT NULL COMMENT '浮动端的所有待实现收益(当前浮动腿的价值)', `InterestDirection` tinyint NOT NULL COMMENT '利息端收支方向', `InterestMode` tinyint NOT NULL COMMENT '计息基准类型', `InterestPrincipalFix` double(18,4) NOT NULL COMMENT '计息基准固定值', `InterestRateDefault` double(18,4) NOT NULL COMMENT '互换利率(年化)', `InterestSwapInterval` text COMMENT '利息互换间隔', `InterestFeePending` double(18,4) NOT NULL COMMENT '待结算其他费用', `TdInterestPrincipal` double(18,4) NOT NULL COMMENT '当前交易日适用的具体计息基准值', `TdInterestRate` double(18,4) NOT NULL COMMENT '当前交易日适用的具体利率值', `TdInterestIncome` double(18,4) NOT NULL COMMENT '当日利率端新计利息', `TdInterestFee` double(18,4) NOT NULL COMMENT '当日利率端新增费用', `InterestIncomeSum` double(18,4) NOT NULL COMMENT '利率端待实现收益-利息', `InterestFeeSum` double(18,4) NOT NULL COMMENT '利率端待实现收益-其他费用', `InterestProfitSum` double(18,4) NOT NULL COMMENT '利率端待实现收益', `SwapPositionValue` double(18,4) NOT NULL COMMENT '互换持仓价值', `TdCloseQty` double(18,10) NOT NULL COMMENT '当日平仓数量', `TdChangedQty` double(18,10) NOT NULL COMMENT '当日公司行为数量', `TdCloseMtmPnl` double(18,4) NOT NULL COMMENT '当日浮动端平仓盈亏·盯市', `TdCloseDividend` double(18,4) NOT NULL COMMENT '当日浮动端平仓盈亏·分红', `TdCloseFee` double(18,4) NOT NULL COMMENT '当日浮动端平仓盈亏·费用', `TdCloseInterest` double(18,4) NOT NULL COMMENT '当日利率端平仓盈亏·利息', `TdCloseInterestFee` double(18,4) NOT NULL COMMENT '当日利率端平仓盈亏·其他费用', `RealizedMtmPnL` double(18,4) NOT NULL COMMENT '浮动端累计已实现盈亏·盯市', `RealizedDividend` double(18,4) NOT NULL COMMENT '浮动端累计已实现盈亏·分红', `RealizedFee` double(18,4) NOT NULL COMMENT '浮动端累计已实现盈亏·费用', `RealizedInterest` double(18,4) NOT NULL COMMENT '利率端累计已实现盈亏·利息', `RealizedInterestFee` double(18,4) NOT NULL COMMENT '利率端累计已实现盈亏·其他费用', `RealizedPnl` double(18,4) NOT NULL COMMENT '持仓累计已实现盈亏', `TdCurrency` double(18,4) NOT NULL COMMENT '当日适用汇率', `PosiStatus` tinyint NOT NULL COMMENT '持仓状态', `Invalid` bit(1) NOT NULL COMMENT '是否无效', `OptId` int NOT NULL COMMENT '操作人ID', `OptName` varchar(64) DEFAULT NULL COMMENT '操作人名称', `OptTime` datetime NOT NULL COMMENT '估值更新时间', PRIMARY KEY (`id`) USING BTREE ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8 ROW_FORMAT=DYNAMIC;