From 4c91dfd0006cfe8a09b2ea9cce30402d60d5948f Mon Sep 17 00:00:00 2001 From: "guoshun.du" Date: Sat, 11 May 2024 10:13:19 +0800 Subject: [PATCH] =?UTF-8?q?*OceanBaseForOracle=E6=94=AF=E6=8C=81OffsetPage?= =?UTF-8?q?=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dict/ExeMarketType.cs | 102 ++++ .../Dict/HostMarketType.cs | 126 +++++ .../OceanBaseForOracleTest/Dict/IrSetType.cs | 104 ++++ .../OceanBaseForOracleTest/Dict/MarketType.cs | 90 ++++ .../Dict/ShgFixSelectModelType.cs | 19 + .../Dict/TradeParseInfo.cs | 69 +++ .../Enum/AccountStatus.cs | 34 ++ .../Enum/Bond/DefaultStatus.cs | 50 ++ .../Enum/Bond/ExerciseTypeEnum.cs | 34 ++ .../Enum/Bond/RatesEnum.cs | 28 ++ .../Enum/Bond/TerminationTypeEnum.cs | 28 ++ .../Enum/Instructions/ActionType.cs | 19 + .../Enum/Instructions/ExcuteType.cs | 22 + .../Instructions/InstructionsModelType.cs | 22 + .../Enum/Instructions/InstructionsStatus.cs | 53 ++ .../Enum/Instructions/InstructionsType.cs | 23 + .../Enum/Instructions/LimitResultType.cs | 22 + .../OceanBaseForOracleTest/Enum/IssueMode.cs | 22 + .../Enum/ParserCreateType.cs | 15 + .../Enum/RFQ/BiddDetailFromSource.cs | 22 + .../Enum/RFQ/DealType.cs | 77 +++ .../Enum/RFQ/DisFeeRepayType.cs | 34 ++ .../Enum/RFQ/FinancingWay.cs | 22 + .../Enum/RFQ/OrderStatus.cs | 88 ++++ .../Enum/RFQ/PartyType.cs | 22 + .../Enum/RFQ/PriceTypeEnum.cs | 34 ++ .../Enum/RFQ/PrimaryPriceType.cs | 28 ++ .../Enum/RFQ/QuotaPrimaryTradeType.cs | 22 + .../Enum/RFQ/QuotaType.cs | 34 ++ .../Enum/RFQ/QuoteSponsor.cs | 22 + .../Enum/RFQ/QuoteStatus.cs | 40 ++ .../Enum/RFQ/ReleaseStatus.cs | 34 ++ .../Enum/RFQ/RepoTradeType.cs | 19 + .../Enum/RFQ/SetDays.cs | 22 + .../Enum/RFQ/TradeType.cs | 24 + .../Enum/System/ContactType.cs | 31 ++ .../Enum/System/MessageEnum.cs | 83 +++ .../Enum/System/ModuleType.cs | 28 ++ .../Enum/System/ModuleVisiable.cs | 22 + .../Enum/System/RoleType.cs | 22 + .../Enum/System/TaskExecuteEnum.cs | 22 + .../Enum/TradeDateMode.cs | 33 ++ .../OceanBaseForOracleTest.csproj | 36 +- .../OceanBaseForOracleTest/Program.cs | 128 ++++- .../TMANAGER_SYS_USER.cs | 157 ++++++ .../OceanBaseForOracleTest/TRFQ_ACC_SECU.cs | 95 ++++ .../OceanBaseForOracleTest/TRFQ_BND.cs | 145 ++++++ .../TRFQ_COUNTERPARTY.cs | 246 +++++++++ .../TRFQ_INSTRUCTIONS.cs | 475 +++++++++++++++++- .../OceanBaseForOracleTest/TRFQ_SYS_TASK.cs | 110 ++++ .../OceanBaseForOracleQueryBuilder.cs | 26 +- 51 files changed, 3009 insertions(+), 76 deletions(-) create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ExeMarketType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/HostMarketType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/IrSetType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/MarketType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ShgFixSelectModelType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/TradeParseInfo.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/AccountStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/DefaultStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/ExerciseTypeEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/RatesEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/TerminationTypeEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ActionType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ExcuteType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsModelType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/LimitResultType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/IssueMode.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/ParserCreateType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/BiddDetailFromSource.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DealType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DisFeeRepayType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/FinancingWay.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/OrderStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PartyType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PriceTypeEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PrimaryPriceType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaPrimaryTradeType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteSponsor.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/ReleaseStatus.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/RepoTradeType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/SetDays.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/TradeType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ContactType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/MessageEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleVisiable.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/RoleType.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/TaskExecuteEnum.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/TradeDateMode.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/TMANAGER_SYS_USER.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_ACC_SECU.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_BND.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_COUNTERPARTY.cs create mode 100644 Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_SYS_TASK.cs diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ExeMarketType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ExeMarketType.cs new file mode 100644 index 000000000..b97694063 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ExeMarketType.cs @@ -0,0 +1,102 @@ +namespace xTPLM.RFQ.Common +{ + /// + /// 执行市场 + /// + public static class ExeMarketType + { + private static Dictionary _exeMarketDict; + + /// + /// 上交所固定收益平台 + /// + public const string CN_SH_FIX = "XSHG_FIX"; + + /// + /// 上交所新债券交易平台 + /// + public const string CN_SH_NEWBOND = "XSHG_NEWBOND"; + + /// + /// 上交所竞价系统 + /// + public const string CN_SH_NORMAL = "XSHG_NORMAL"; + + /// + /// 上交所综合业务平台 + /// + public const string CN_SH_LARGE = "XSHG_LARGE"; + + /// + /// 深交所综合协议交易平台 + /// + public const string CN_SZ_LARGE = "XSHE_LARGE"; + + /// + /// 深交所竞价系统 + /// + public const string CN_SZ_NORMAL = "XSHE_NORMAL"; + + /// + /// 深交所固定收益平台 + /// + public const string CN_SZ_FIX = "XSHE_FIX"; + + /// + /// 银行间场内 + /// + public const string CN_BD_IN = "X_CNBD_IN"; + + /// + /// 北交所交易支持平台 + /// + public const string X_BSE_NORMAL = "X_BSE_NORMAL"; + + /// + /// 北交所固定收益平台 + /// + public const string X_BSE_FIX = "X_BSE_FIX"; + + /// + /// 执行市场字典 + /// + public static Dictionary ExeMarketDict + { + get + { + if (_exeMarketDict == null) + { + _exeMarketDict = new Dictionary(); + + _exeMarketDict.Add(CN_SH_FIX, "上交所固定收益平台"); + _exeMarketDict.Add(CN_SH_NEWBOND, "上交所新债券交易平台"); + _exeMarketDict.Add(CN_SH_NORMAL, "上交所竞价系统"); + _exeMarketDict.Add(CN_SH_LARGE, "上交所综合业务平台"); + + _exeMarketDict.Add(CN_SZ_LARGE, "深交所综合协议交易平台"); + _exeMarketDict.Add(CN_SZ_NORMAL, "深交所竞价系统"); + _exeMarketDict.Add(CN_SZ_FIX, "深交所固定收益平台"); + + _exeMarketDict.Add(CN_BD_IN, "银行间场内"); + + _exeMarketDict.Add(X_BSE_FIX, "北交所固定收益平台"); + _exeMarketDict.Add(X_BSE_NORMAL, "北交所交易支持平台"); + } + return _exeMarketDict.ToDictionary(m => m.Key, m => m.Value); + } + } + + /// + /// 获取描述 + /// + /// + public static string GetDescription(string ExeMarket) + { + if (!string.IsNullOrWhiteSpace(ExeMarket) && ExeMarketDict.TryGetValue(ExeMarket, out string value)) + { + return value; + } + return string.Empty; + } + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/HostMarketType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/HostMarketType.cs new file mode 100644 index 000000000..1bbffe90e --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/HostMarketType.cs @@ -0,0 +1,126 @@ +namespace xTPLM.RFQ.Common.Dict +{ + /// + /// 托管市场 + /// + public static class HostMarketType + { + private static Dictionary _hostMarketTypeDict; + + /// + /// 上交所 + /// + public const string CN_SH = "XSHG"; + + /// + /// 深交所 + /// + public const string CN_SZ = "XSHE"; + + /// + /// 中债登 + /// + public const string CN_BD_ZZD = "X_CNBD_ZZD"; + + /// + /// 清算所 + /// + public const string CN_BD_QSS = "X_CNBD_QSS"; + + /// + /// 中金所 + /// + public const string CN_FFEX = "X_CNFFEX"; + + /// + /// 其他 + /// + public const string NONE = "NONE"; + + /// + /// 金交所 + /// + public const string CN_SGEX = "SGEX"; + + /// + /// 场外市场托管场所 + /// + public const string OTHER = "OTHER"; + + /// + /// 机构间市场托管场所 + /// + public const string X_INTER = "X_INTER"; + + /// + /// 自由贸易区托管场所 + /// + public const string X_FTZ = "X_FTZ"; + + /// + /// 票交所托管场所 + /// + public const string X_SHCPE = "X_SHCPE"; + + /// + /// 港交所 + /// + public const string XHKG = "XHKG"; + + /// + /// 新三板托管市场 + /// + public const string X_NEEQ = "X_NEEQ"; + + /// + /// 银登中心 + /// + public const string X_CBDC = "X_CBDC"; + + /// + /// 外汇市场 + /// + public const string X_FX = "X_FX"; + + /// + /// 欧清市场 + /// + public const string CMMT = "CMMT"; + + /// + /// 执行市场字典 + /// + public static Dictionary HostMarketTypeDict + { + get + { + if (_hostMarketTypeDict == null) + { + _hostMarketTypeDict = new Dictionary(); + _hostMarketTypeDict.TryAdd(CN_SH, "上交所"); + _hostMarketTypeDict.TryAdd(CN_SZ, "深交所"); + _hostMarketTypeDict.TryAdd(CN_BD_ZZD, "中债登"); + _hostMarketTypeDict.TryAdd(CN_BD_QSS, "清算所"); + _hostMarketTypeDict.TryAdd(CN_FFEX, "中金所"); + _hostMarketTypeDict.TryAdd(CN_SGEX, "金交所"); + _hostMarketTypeDict.TryAdd(OTHER, "场外市场"); + _hostMarketTypeDict.TryAdd(X_CBDC, "银登中心"); + } + return _hostMarketTypeDict.ToDictionary(m => m.Key, m => m.Value); + } + } + + /// + /// 获取描述 + /// + /// + public static string GetDescription(string type) + { + if (!string.IsNullOrWhiteSpace(type) && HostMarketTypeDict.TryGetValue(type, out string value)) + { + return value; + } + return string.Empty; + } + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/IrSetType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/IrSetType.cs new file mode 100644 index 000000000..8cda9225b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/IrSetType.cs @@ -0,0 +1,104 @@ +namespace xTPLM.RFQ.Common.Dict +{ + /// + /// IR的结算方式 + /// + public static class IrSetType + { + /// + /// 见券付款 + /// + public const string PaymentAfterDelivery = "PAD"; + + /// + /// 见款付券 + /// + public const string DeliveryAfterPayment = "DAP"; + + /// + /// 券款对付 + /// + public const string DeliveryVersusPayment = "DVP"; + + /// + /// 纯券过户 + /// + public const string FreeOfPayment = "FOP"; + + /// + /// 券券对付 + /// + public const string BondVersusBond = "BVB"; + + /// + /// 券费对付 + /// + public const string BondVersusPayment = "BVP"; + + /// + /// 返券付费解券 + /// + public const string BondAfterBondFree = "BVBF"; + + //TT6789 chengdengliang 2011-06-17 净额券款对付结算方式 + + /// + /// 净额券款对付 + /// + public const string NetDeliveryVersusPayment = "NDVP"; + + //2013-10-17 成登亮 + + /// + /// 双边清算 + /// + public const string BOTH = "BOTH"; + + /// + /// 主动扣款 2014-11-13 沈何凯 大宗商品远期 扣款方式 + /// + public const string ActiveDebit = "AD"; + + /// + /// 被动扣款 2014-11-13 沈何凯 大宗商品远期 扣款方式 + /// + public const string PassiveDebit = "PD"; + + /// + /// 交易所--担保交收(2017-07-24 蔡旦旭 TT2550) + /// + public const string SecureSettle = "SecureSet"; + + /// + /// 暂时不用这个枚举交易所--非担保交收(非RTGS)(2017-07-24 蔡旦旭 TT2550) + /// 2018-08-13 周志斌 TT9787交易所质押式回购结算方式修改,报价回购需要支持非担保交收(NGGS) + /// + public const string UnSecureSettleNGGS = "UnSecureSetNGGS"; + + /// + /// 交易所--非担保交收(2017-07-24 蔡旦旭 TT2550) + /// + public const string UnSecureSettleRTGS = "UnSecureSetRTGS"; + + + /// + /// 2021-08-13 王继博 对手账户结算 + /// + public const string CounterPartyAccountSettle = "CPAS"; + + + /// + /// 2021-08-13 王继博 直接划付 + /// + public const string DirectTransfer = "DIRECT"; + + /// + /// 其他 + /// 2022-03-04 冯彦谕 P008XIR-31852 江海-债券认购,增加结算方式:“其他” + /// 2022-03-04 冯彦谕 P008XIR-32198 开源证券-债券认购界面结算类型增加线下划款 + /// + public const string OTHER = "OTHER"; + + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/MarketType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/MarketType.cs new file mode 100644 index 000000000..2b6ce620b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/MarketType.cs @@ -0,0 +1,90 @@ +namespace xTPLM.RFQ.Common +{ + /// + /// 交易市场 + /// + public static class MarketType + { + private static Dictionary _marketTypeDict; + + /// + /// 上交所 + /// + public const string CN_SH = "XSHG"; + + /// + /// 银行间 + /// + public const string CN_BD = "X_CNBD"; + + /// + /// 深交所 + /// + public const string CN_SZ = "XSHE"; + + /// + /// 北交所 + /// + public const string X_BSE = "X_BSE"; + + /// + /// 执行市场字典 + /// + public static Dictionary MarketTypeDict + { + get + { + if (_marketTypeDict == null) + { + _marketTypeDict = new Dictionary(); + _marketTypeDict.Add(CN_SH, "上交所"); + _marketTypeDict.Add(CN_BD, "银行间"); + _marketTypeDict.Add(CN_SZ, "深交所"); + _marketTypeDict.Add(X_BSE, "北交所"); + } + return _marketTypeDict.ToDictionary(m => m.Key, m => m.Value); + } + } + + /// + /// 获取描述 + /// + /// + public static string GetDescription(string MarketType) + { + if (!string.IsNullOrWhiteSpace(MarketType) && MarketTypeDict.TryGetValue(MarketType, out string value)) + { + return value; + } + return string.Empty; + } + + /// + /// 获取市场后缀 + /// + /// + /// + public static string GetMaketSuffix(string MarketType) + { + var result = ""; + switch (MarketType) + { + case CN_SH: + result = ".SH"; + break; + case CN_BD: + result = ".IB"; + break; + case CN_SZ: + result = ".SZ"; + break; + case X_BSE: + result = ".BJ"; + break; + default: + break; + } + return result; + } + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ShgFixSelectModelType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ShgFixSelectModelType.cs new file mode 100644 index 000000000..6cc2b7c51 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/ShgFixSelectModelType.cs @@ -0,0 +1,19 @@ +namespace xTPLM.RFQ.Common.Dict +{ + /// + /// 固收上行选择直连模式 + /// 2019-04-24 潘鹤 TT11606 + /// + public static class ShgFixSelectModelType + { + /// + /// 直连柜台 + /// + public const string COUNTER = "COUNTER"; + + /// + /// 直连交易所 + /// + public const string EXCHANGE = "EXCHANGE"; + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/TradeParseInfo.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/TradeParseInfo.cs new file mode 100644 index 000000000..fa1e383b8 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Dict/TradeParseInfo.cs @@ -0,0 +1,69 @@ +namespace xTPLM.RFQ.Common +{ + /// + /// 交易解析配置 + /// + public static class TradeParseInfo + { + private static Dictionary _tradeParseInfoDict; + + /// + /// 文本解析对应交易员 + /// + public const string PARSETRADER = "PARSETRADER"; + + /// + /// 文本解析对应交易对手 + /// + public const string PARSEPARTY = "PARSEPARTY"; + + /// + /// 用户对应配置交易员 + /// + public const string USERTRADE = "USERTRADE"; + + /// + /// 内政 + /// + public const string INTSECU = "INTSECU"; + + /// + /// 执行员 + /// + public const string EXECUTOR = "EXECUTOR"; + + /// + /// 执行市场字典 + /// + public static Dictionary TradeParseInfoDict + { + get + { + if (_tradeParseInfoDict == null) + { + _tradeParseInfoDict = new Dictionary(); + _tradeParseInfoDict.Add(PARSETRADER, "文本解析对应交易员"); + _tradeParseInfoDict.Add(PARSEPARTY, "文本解析对应交易对手"); + _tradeParseInfoDict.Add(USERTRADE, "用户对应配置交易员"); + _tradeParseInfoDict.Add(INTSECU, "内政"); + _tradeParseInfoDict.Add(EXECUTOR, "执行员"); + } + return _tradeParseInfoDict.ToDictionary(m => m.Key, m => m.Value); + } + } + + /// + /// 获取描述 + /// + /// + public static string GetDescription(string TradeParseInfo) + { + if (!string.IsNullOrWhiteSpace(TradeParseInfo) && TradeParseInfoDict.TryGetValue(TradeParseInfo, out string value)) + { + return value; + } + return string.Empty; + } + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/AccountStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/AccountStatus.cs new file mode 100644 index 000000000..b59408c0b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/AccountStatus.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 账户状态 + /// + public enum AccountStatus + { + /// + /// 创建中 + /// + [Description("创建中")] + Opening = 0, + + /// + /// 已启用 + /// + [Description("已启用")] + Opened = 1, + + /// + /// 停用中 + /// + [Description("停用中")] + Closing = 2, + + /// + /// 已停用 + /// + [Description("已停用")] + Closed = 3 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/DefaultStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/DefaultStatus.cs new file mode 100644 index 000000000..48456f036 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/DefaultStatus.cs @@ -0,0 +1,50 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + public enum DefaultStatus + { + /// + /// 正常 + /// + [Description("正常")] + Normal = 0, + + /// + /// 兑息 + /// + [Description("兑息")] + PayInterest = 1, + + /// + /// 兑付 + /// + [Description("兑付")] + Mtr = 2, + + /// + /// 回售 + /// + [Description("回售")] + SellBack = 3, + + /// + /// 还本付息 + /// + [Description("还本付息")] + ReturnCorpusPayInterest = 4, + + /// + /// 其他违约 TT14433 2020-05-19 张景辉 + /// + [Description("其他违约")] + Other = 5, + + /// + /// 非标违约 + /// + /// 2020-12-08 丁信丽 P008XIR-17685 非标违约 + [Description("非标违约")] + CashLBDebt = 11, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/ExerciseTypeEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/ExerciseTypeEnum.cs new file mode 100644 index 000000000..95b022e02 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/ExerciseTypeEnum.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 类型 欧式、美式、百慕大式 + /// + public enum ExerciseTypeEnum + { + /// + /// 美式 + /// + [Description("美式")] + American = 0, + + /// + /// 百慕大式 + /// + [Description("百慕大式")] + Bermudan = 1, + + /// + /// 欧式 + /// + [Description("欧式")] + European = 2, + + /// + /// 不行权 + /// + [Description("不行权")] + None = 3, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/RatesEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/RatesEnum.cs new file mode 100644 index 000000000..4c495fd1b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/RatesEnum.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 是否利率债 + /// + public enum RatesEnum + { + /// + /// 未划分 + /// + [Description("未划分")] + None = 0, + + /// + /// 信用债 + /// + [Description("信用债")] + Credit = 1, + + /// + /// 利率债 + /// + [Description("利率债")] + Rate = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/TerminationTypeEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/TerminationTypeEnum.cs new file mode 100644 index 000000000..a2929b7de --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Bond/TerminationTypeEnum.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 提前兑付类型 + /// + public enum TerminationTypeEnum + { + /// + /// 未知类型 + /// + [Description("未知类型")] + EarlyTerminationUnknown = 0, + + /// + /// 提前兑付 + /// + [Description("提前兑付")] + Prepayment = 1, + + /// + /// 提前赎回 + /// + [Description("提前赎回")] + Redemption = 2, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ActionType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ActionType.cs new file mode 100644 index 000000000..7feb80558 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ActionType.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + public enum ActionType + { + /// + /// 修改指令额度 + /// + [Description("修改指令额度")] + EditInstructionOrderMoney = 1, + + /// + /// 指令撤回审批 + /// + [Description("指令撤回审批")] + InstructionRevoke = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ExcuteType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ExcuteType.cs new file mode 100644 index 000000000..2d667334a --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/ExcuteType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 指令执行关联类型 + /// + public enum ExcuteType + { + /// + /// 执行人 + /// + [Description("执行人")] + User = 1, + + /// + /// 执行部门 + /// + [Description("执行部门")] + Department = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsModelType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsModelType.cs new file mode 100644 index 000000000..8867dd848 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsModelType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 指令类型 + /// + public enum InstructionsModelType + { + /// + /// 现券指令 + /// + [Description("现券指令")] + Bond = 0, + + /// + /// 一级指令 + /// + [Description("一级指令")] + Primary = 1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsStatus.cs new file mode 100644 index 000000000..1d30adf7d --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsStatus.cs @@ -0,0 +1,53 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 指令状态 + /// + public enum InstructionsStatus + { + /// + /// 作废 + /// + [Description("作废")] + Close = -2, + + /// + /// 审批不通过 + /// + [Description("审批不通过")] + ApprovalFail = -1, + + /// + /// 新建 + /// + [Description("新建")] + Create = 0, + + /// + /// 提交中 + /// + [Description("提交中")] + Submiting = 3, + + /// + /// 审批中 + /// + [Description("审批中")] + Approval = 5, + + /// + /// 审批通过 + /// + [Description("审批通过")] + Approved = 10, + + /// + /// 已完成 + /// + [Description("已完成")] + Complete = 20, + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsType.cs new file mode 100644 index 000000000..2f2a35ecc --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/InstructionsType.cs @@ -0,0 +1,23 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 指令类型 + /// + public enum InstructionsType + { + /// + /// 精确指令 + /// + [Description("精确指令")] + Accurate = 1, + + + /// + /// 模糊指令 + /// + [Description("模糊指令")] + Vague = 2, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/LimitResultType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/LimitResultType.cs new file mode 100644 index 000000000..05509a479 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/Instructions/LimitResultType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 额度类型 + /// + public enum LimitResultType + { + /// + /// 申请额度 + /// + [Description("申请额度")] + Company = 1, + + /// + /// 剩余额度 + /// + [Description("剩余额度")] + ISSUER = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/IssueMode.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/IssueMode.cs new file mode 100644 index 000000000..e298cc936 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/IssueMode.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 发行方式 + /// + public enum IssueMode + { + /// + /// 公开发行 + /// + [Description("公开发行")] + OpenIssue = 0, + + /// + /// 定向发行 + /// + [Description("定向发行")] + OrientationIssue = 1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/ParserCreateType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/ParserCreateType.cs new file mode 100644 index 000000000..86b093cc8 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/ParserCreateType.cs @@ -0,0 +1,15 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 语料生成配置类型 + /// + public enum ParserCreateType + { + [Description("询价指令")] + Instructions = 1, + [Description("资管现券询价指令")] + AmcBondInstructions = 2, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/BiddDetailFromSource.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/BiddDetailFromSource.cs new file mode 100644 index 000000000..3d2e6ff26 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/BiddDetailFromSource.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 报价来源 + /// + public enum BiddDetailFromSource + { + /// + /// 手动录入 + /// + [Description("手动录入")] + Manual = 0, + + /// + /// QTrade + /// + [Description("QTrade")] + QTrade = 1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DealType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DealType.cs new file mode 100644 index 000000000..b466726ea --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DealType.cs @@ -0,0 +1,77 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 报价方式 + /// + public enum DealType + { + /// + /// 空 + /// + [Description("空")] + Empty = -1, + + /// + /// 做市报价 + /// + [Description("做市报价")] + MarketQuotation = 0, + + /// + /// 对话报价 + /// + [Description("对话报价")] + NegotiationQuotation = 2, + + /// + /// 其它 + /// + [Description("其它")] + OtherQuotation = 3, + + /// + /// 指定对手方报价 + /// + [Description("指定对手方报价")] + DesignatedCounterparty = 4, + + /// + /// 询价 + /// + [Description("询价")] + InquiryQuotation = 5, + + /// + /// 请求报价 + /// + [Description("请求报价")] + RequestQuotation = 6, + + /// + /// 匿名报价 + /// + [Description("匿名报价")] + X_Bond = 25, + + /// + /// 匹配成交 + /// + [Description("匹配成交")] + Match = 46, + + /// + /// 协商成交 + /// + [Description("协商成交")] + Negotiation = 47, + + /// + /// 询价成交 + /// + /// + [Description("询价成交")] + Enquiry = 49, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DisFeeRepayType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DisFeeRepayType.cs new file mode 100644 index 000000000..227bf9cfe --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/DisFeeRepayType.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 手续费返还方式 + /// + public enum DisFeeRepayType + { + /// + /// 不返 + /// + [Description("不返")] + None = 0, + + /// + /// 单返 + /// + [Description("单返")] + SingleReturn = 1, + + /// + /// 折价 + /// + [Description("折价")] + Convert = 2, + + /// + /// 溢价 + /// + [Description("溢价")] + Premium = 3, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/FinancingWay.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/FinancingWay.cs new file mode 100644 index 000000000..061877c67 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/FinancingWay.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 融资途径 + /// + public enum FinancingWay + { + [Description("待定")] + None, + + [Description("质押式正回购")] + PledgeRepo, + + [Description("买断式正回购")] + BuySellRepo, + + [Description("同业拆入")] + Lend, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/OrderStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/OrderStatus.cs new file mode 100644 index 000000000..04e2d5009 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/OrderStatus.cs @@ -0,0 +1,88 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 交易系统状态 + /// + public enum OrderStatus + { + /// + /// 新建 + /// + [Description("新建")] + Created = 0, + + /// + /// 审批中 + /// + [Description("审批中")] + Ordered = 1, + + /// + /// 交易错误 + /// + [Description("交易错误")] + Error = 2, + + /// + /// 返回失败 + /// + [Description("返回失败")] + Failed = 3, + + /// + /// 审批拒绝 + /// + [Description("审批拒绝")] + Rejected = 4, + + /// + /// 审批通过 + /// + [Description("审批通过")] + Confirmed = 5, + + /// + /// 该笔委托没有相应的成功撤单操作且成交数量小于委托数量 + /// + [Description("该笔委托没有相应的成功撤单操作且成交数量小于委托数量")] + PartDealed = 6, + + /// + /// 成交确认 + /// + [Description("成交确认")] + FullDealed = 7, + + /// + /// 撤单操作成功,成交数量小于委托数量 + /// + [Description("撤单操作成功,成交数量小于委托数量")] + PartWithdrawed = 8, + + /// + /// 交易撤单 + /// + [Description("交易撤单")] + FullWithdrawed = 9, + + /// + /// 风险预审中 + /// + [Description("风险预审中")] + PreCheckRisk = -3, + + /// + /// 交易执行中 + /// + [Description("交易执行中")] + Executing = -4, + + /// + /// 交易终止 + /// + [Description("交易终止")] + Terminated = 10 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PartyType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PartyType.cs new file mode 100644 index 000000000..1ea7af2a7 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PartyType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 交易对手类型 + /// + public enum PartyType + { + /// + /// 法人户 + /// + [Description("法人户")] + LegalPerson = 1, + + /// + /// 非法人户 + /// + [Description("非法人户")] + NotLegalPerson = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PriceTypeEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PriceTypeEnum.cs new file mode 100644 index 000000000..4f9a43e1c --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PriceTypeEnum.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 价格类型:1-到期收益率 2-行权收益率 3-净价 4-全价 + /// + public enum PriceTypeEnum + { + /// + /// 到期收益率 + /// + [Description("到期收益率")] + YTM = 1, + + /// + /// 行权收益率 + /// + [Description("行权收益率")] + YTM_OE = 2, + + /// + /// 净价 + /// + [Description("净价")] + NETPRICE = 3, + + /// + /// 全价 + /// + [Description("全价")] + PRICE = 4, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PrimaryPriceType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PrimaryPriceType.cs new file mode 100644 index 000000000..4e73f2566 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/PrimaryPriceType.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 一级询价价格类型 + /// + public enum PrimaryPriceType + { + /// + /// 分销价格 + /// + [Description("分销价格")] + ORDPRICE = 0, + + /// + /// 到期收益率 + /// + [Description("到期收益率")] + BND_YTM = 1, + + /// + /// 票面利率 + /// + [Description("票面利率")] + COUPON = 2, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaPrimaryTradeType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaPrimaryTradeType.cs new file mode 100644 index 000000000..ec9530c5a --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaPrimaryTradeType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 一级询价交易方向 + /// + public enum QuotaPrimaryTradeType + { + /// + /// 分销买入 + /// + [Description("分销买入")] + DistributionBuy = 61, + + /// + /// 分销卖出 + /// + [Description("分销卖出")] + DistributionSell = 62 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaType.cs new file mode 100644 index 000000000..98dd090bb --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuotaType.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + /// + /// 询价业务类型 + /// + public enum QuotaType + { + /// + /// 现券询价 + /// + [Description("现券询价")] + BndQuota = 1, + + /// + /// 一级询价 + /// + [Description("一级询价")] + PrimaryQuota = 2, + + /// + /// 逆回购询价 + /// + [Description("逆回购询价")] + RepoQuota = 3, + + /// + /// 正回购询价 + /// + [Description("正回购询价")] + FinancingQuota = 4, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteSponsor.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteSponsor.cs new file mode 100644 index 000000000..64ef54263 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteSponsor.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 询价发起方 + /// + public enum QuoteSponsor + { + /// + /// 本方发起 + /// + [Description("本方发起")] + This = 0, + + /// + /// 对方发起 + /// + [Description("对方发起")] + Competitor = 1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteStatus.cs new file mode 100644 index 000000000..130a3152b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/QuoteStatus.cs @@ -0,0 +1,40 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 询价状态 + /// + public enum QuoteStatus + { + /// + /// 已撤销 + /// + [Description("已撤销")] + Revoke = -1, + + /// + /// 新建 + /// + [Description("新建")] + Create = 0, + + /// + /// 交谈中 + /// + [Description("交谈中")] + Chating = 5, + + /// + /// 已确认 + /// + [Description("已确认")] + Confirmed = 10, + + /// + /// 已下达 + /// + [Description("已下达")] + Release = 20 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/ReleaseStatus.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/ReleaseStatus.cs new file mode 100644 index 000000000..26e4919d3 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/ReleaseStatus.cs @@ -0,0 +1,34 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 询价下达状态 0:未下达,5:下达中,10:下达成功,-1:下达失败 + /// + public enum ReleaseStatus + { + /// + /// 未下达 + /// + [Description("未下达")] + NoneRelease = 0, + + /// + /// 下达中 + /// + [Description("下达中")] + Releaseing = 5, + + /// + /// 下达成功 + /// + [Description("下达成功")] + Released = 10, + + /// + /// 下达失败 + /// + [Description("下达失败")] + ReleaseFail = -1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/RepoTradeType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/RepoTradeType.cs new file mode 100644 index 000000000..93d734aa7 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/RepoTradeType.cs @@ -0,0 +1,19 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.RFQ +{ + public enum RepoTradeType + { + /// + /// 质押式正回购 + /// + [Description("质押式正回购")] + RepoPlus = 40, + + /// + /// 质押式逆回购 + /// + [Description("质押式逆回购")] + RepoMinus = 41 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/SetDays.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/SetDays.cs new file mode 100644 index 000000000..c0b12a9c5 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/SetDays.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 清算速度 + /// + public enum SetDays + { + /// + /// T+0 + /// + [Description("T+0")] + T0 = 0, + + /// + /// T+1 + /// + [Description("T+1")] + T1 = 1, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/TradeType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/TradeType.cs new file mode 100644 index 000000000..bc2e65349 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/RFQ/TradeType.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 交易方向 + /// + public enum TradeType + { + /// + /// 买 + /// + [Description("买")] + Buy = 10, + + /// + /// 卖 + /// + [Description("卖")] + Sell = 20, + + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ContactType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ContactType.cs new file mode 100644 index 000000000..4a02bff8a --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ContactType.cs @@ -0,0 +1,31 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + public enum ContactType + { + /// + /// QQ + /// + [Description("QQ")] + QQ = 10, + + /// + /// QTrade + /// + [Description("QTrade")] + QTrade = 20, + + /// + /// 电话 + /// + [Description("电话")] + Phone = 30, + + /// + /// 邮箱 + /// + [Description("邮箱")] + Email = 40 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/MessageEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/MessageEnum.cs new file mode 100644 index 000000000..d085f27f4 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/MessageEnum.cs @@ -0,0 +1,83 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 消息推送类型 + /// + public enum MessagePushType + { + /// + /// 消息盒子 + /// + [Description("消息盒子")] + MessageBox = 0, + + /// + /// 弹窗消息 + /// + [Description("弹窗消息")] + MessagePushNotify = 1 + } + + /// + /// 消息业务类型 + /// + public enum MessageType + { + /// + /// 系统通知 + /// + [Description("系统通知")] + System = 0, + + + /// + /// 策略匹配 + /// + [Description("策略匹配")] + Strategy = 1 + } + + /// + /// 消息重要等级 + /// + public enum MessageLevel + { + /// + /// 普通 + /// + [Description("普通")] + Ordinary = 0, + + /// + /// 重要 + /// + [Description("普通")] + Important = 10, + + /// + /// 紧急 + /// + [Description("紧急")] + Urgent = 20, + } + + /// + /// 消息状态 + /// + public enum MessageStatus + { + /// + /// 未读 + /// + [Description("未读")] + Unread = 0, + + /// + /// 已读 + /// + [Description("已读")] + Read = 1, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleType.cs new file mode 100644 index 000000000..22ff17c0b --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleType.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 模块类型 + /// + public enum ModuleType + { + /// + /// 菜单 + /// + [Description("菜单")] + Menu = 1, + + /// + /// 按钮 + /// + [Description("按钮")] + Btn = 2, + + /// + /// 虚拟权限 + /// + [Description("虚拟权限")] + VirtualPermissions = 99 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleVisiable.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleVisiable.cs new file mode 100644 index 000000000..c73dc79ec --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/ModuleVisiable.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 菜单是否显示 + /// + public enum ModuleVisiable + { + /// + /// 隐藏 + /// + [Description("隐藏")] + hide = 0, + + /// + /// 显示 + /// + [Description("显示")] + show = 1, + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/RoleType.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/RoleType.cs new file mode 100644 index 000000000..8c279b2f3 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/RoleType.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common +{ + /// + /// 角色类型 + /// + public enum RoleType + { + /// + /// 组员 + /// + [Description("组员")] + Staff = 1, + + /// + /// 组长 + /// + [Description("组长")] + Leader = 2 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/TaskExecuteEnum.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/TaskExecuteEnum.cs new file mode 100644 index 000000000..3be6c2ef5 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/System/TaskExecuteEnum.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; + +namespace xTPLM.RFQ.Common.Enum.System +{ + /// + /// 计划任务执行状态 + /// + public enum TaskExecuteEnum + { + /// + /// 未执行 + /// + [Description("未执行")] + None = 0, + + /// + /// 执行中 + /// + [Description("执行中")] + Executing = 1 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/TradeDateMode.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/TradeDateMode.cs new file mode 100644 index 000000000..0350a2438 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Enum/TradeDateMode.cs @@ -0,0 +1,33 @@ +namespace xTPLM.RFQ.Common.Enum +{ + /// + /// 交易日期类型 + /// + public enum TradeDateMode + { + /// + /// 今天 + /// + Today = 0, + + /// + /// 明天 + /// + Tomorrow = 1, + + /// + /// 后天 + /// + DayAfterTomorrow = 2, + + /// + /// 周几 + /// + Weeks = 3, + + /// + /// 指定日期 + /// + Specified = 4 + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/OceanBaseForOracleTest.csproj b/Src/Asp.NetCore2/OceanBaseForOracleTest/OceanBaseForOracleTest.csproj index 20a26f1fd..9cd78d1f2 100644 --- a/Src/Asp.NetCore2/OceanBaseForOracleTest/OceanBaseForOracleTest.csproj +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/OceanBaseForOracleTest.csproj @@ -1,22 +1,26 @@  - - Exe - net6.0 - enable - enable - + + Exe + net6.0 + enable + enable + - - - - - + + + + + - - - - - + + + + + + + + + diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/Program.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/Program.cs index 964f8eb02..8ce096a4a 100644 --- a/Src/Asp.NetCore2/OceanBaseForOracleTest/Program.cs +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/Program.cs @@ -2,8 +2,9 @@ using SqlSugar; using SqlSugar.OceanBaseForOracle; using System.Xml.Linq; +using xTPLM.RFQ.Common.Enum; +using xTPLM.RFQ.Model.XMANAGER_APP; using xTPLM.RFQ.Model.XRFQ_APP; -using static Npgsql.Replication.PgOutput.Messages.RelationMessage; namespace OceanBaseForOracle { @@ -33,34 +34,107 @@ namespace OceanBaseForOracle Console.WriteLine(db.Ado.Connection.ConnectionString); }; Console.WriteLine("Master:"); + DateTime NextTime = DateTime.Now; + DateTime endTime = DateTime.Now; + db.Updateable().SetColumns(m => new TRFQ_SYS_TASK + { + NEXT_FIRE_TIME = NextTime, + PREVIOUS_FIRE_TIME = endTime, + COUNT = m.COUNT + 1 + }).Where(n => n.ID == 1).ExecuteCommand(); //db.Queryable().Where(m => m.REMARK==""&& m.PRICE_TYPE == 1 && m.PRICE >= 100 && m.PRICE_UPPER >= 100).ToList() ; //db.Insertable(new Dto { }).ExecuteCommand(); - db.Insertable(new TRFQ_INSTRUCTIONS - { - I_NAME = "测试新增", - END_TIME = DateTime.Now.Date, - REMARK = "我是备注", - CREATE_BY = 1, - UPDATE_TIME = DateTime.Now, - UPDATE_BY = 1, - STATUS = 0, - I_CODE = "090005", - A_TYPE = "SPT_BD", - M_TYPE = "X_CNBD", - ORDER_MONEY = 500, - I_TYPE = 1, - PRICE_TYPE = 3, - YTM = 0, - YTM_OE = 0, - PRICE = 100, - NETPRICE = 0, - TRADE_TYPE = "10", - PARTY_ID = 1000, - SECU_ACCID = "bss", - ORDER_DATE = DateTime.Now, - SET_DAYS = 0, - SOURCE_TYPE = "xRFQ" - }).ExecuteCommand(); + //db.Insertable(new TRFQ_INSTRUCTIONS + //{ + // A_TYPE= "SPT_BD", + // CREATE_BY=1, + // END_TIME=DateTime.Now.Date, + // I_CODE="090005", + // I_NAME= "09附息国债05", + // I_TYPE= InstructionsType.Accurate, + // M_TYPE= "X_CNBD", + // NETPRICE= 100M, + // ORDER_DATE= DateTime.Now.Date, + // PRICE= 100.3405M, + // ORDER_MONEY= 100M, + // PRICE_TYPE=xTPLM.RFQ.Common.PriceTypeEnum.NETPRICE, + // SECU_ACCID= "bss_in_secu_02", + // SET_DAYS=xTPLM.RFQ.Common.SetDays.T0, + // SOURCE_TYPE= "xRFQ", + // STATUS=InstructionsStatus.Create, + // TRADE_TYPE=TradeType.Buy, + // YTM= 4.0197M + //}).ExecuteCommand(); + int Count = 0; + var list = db.Queryable() + .LeftJoin((t, t1) => t.I_CODE == t1.I_CODE && t.A_TYPE == t1.A_TYPE && t.M_TYPE == t1.M_TYPE) + .Where(t => t.I_CODE != null) + .SelectMergeTable((t, t1) => new TRFQ_INSTRUCTIONS + { + I_ID = t.I_ID, + A_TYPE = t.A_TYPE, + CREATE_BY = t.CREATE_BY, + END_TIME = t.END_TIME, + I_CODE = t.I_CODE, + I_NAME = t.I_NAME, + IS_CITY_INVESTMENT = t.IS_CITY_INVESTMENT, + IS_RATES = t.IS_RATES, + M_TYPE = t.M_TYPE, + ORDER_MONEY = t.ORDER_MONEY, + PARTY_ID = t.PARTY_ID, + PERPETUAL = t.PERPETUAL, + PRICE_TYPE = t.PRICE_TYPE, + REMARK = t.REMARK, + STATUS = t.STATUS, + TRADE_TYPE = t.TRADE_TYPE, + UPDATE_BY = t.UPDATE_BY, + UPDATE_TIME = t.UPDATE_TIME, + ORDER_DATE_MIN = t.ORDER_DATE_MIN, + ORDER_DATE_MAX = t.ORDER_DATE_MAX, + SECU_ACCID = t.SECU_ACCID, + SYSID_EXT = t.SYSID_EXT, + MARKET = t.MARKET, + PARTY_NAME = SqlFunc.Subqueryable().Where(m => m.P_SYSID == t.PARTY_ID).Select(m => m.PARTYNAME_SHORT), + SUBMIT_IRUSER = t.SUBMIT_IRUSER, + P_CLASS = t.P_CLASS, + LAST_TERM = t.LAST_TERM, + LAST_TERM_TYPE = t.LAST_TERM_TYPE, + MODIFIED_D = t.MODIFIED_D, + SUBMIT_MESSAGE = t.SUBMIT_MESSAGE, + SET_DAYS = t.SET_DAYS, + ORDER_DATE = t.ORDER_DATE, + I_TYPE = t.I_TYPE, + I_NO = t.I_NO, + PRICE = t.PRICE, + NETPRICE = t.NETPRICE, + YTM = t.YTM, + YTM_OE = t.YTM_OE, + PRICE_UPPER = t.PRICE_UPPER, + NETPRICE_UPPER = t.NETPRICE_UPPER, + YTM_UPPER = t.YTM_UPPER, + YTM_OE_UPPER = t.YTM_OE_UPPER, + CREATE_BY_NAME = SqlFunc.Subqueryable().AS($"XMANAGER_APP.TMANAGER_SYS_USER").Where(m => m.U_ID == t.CREATE_BY).Select(m => m.U_NICKNAME ?? m.U_NAME), + SHG_AGREENUM = t.SHG_AGREENUM, + SHG_TRADER_CP = t.SHG_TRADER_CP, + SHG_SEATNO_CP = t.SHG_SEATNO_CP, + SECU_ACCNAME = SqlFunc.Subqueryable().Where(m => m.ACCID == t.SECU_ACCID).Select(m => m.ACCNAME), + ISSUER = t1.ISSUER, + B_NAME = t1.B_NAME, + SUBMIT_TIME = t.SUBMIT_TIME, + SOURCE_TYPE = t.SOURCE_TYPE, + CREATE_TIME = t.CREATE_TIME, + EXT_TRADE_ID = t.EXT_TRADE_ID, + CANCEL_STATUS = t.CANCEL_STATUS, + CASH_ACCID = t.CASH_ACCID, + }).GroupBy(t => new { t.I_CODE, t.A_TYPE, t.M_TYPE, t.B_NAME }) + .SelectMergeTable(t => new InsOrderList + { + I_CODE = t.I_CODE, + A_TYPE = t.A_TYPE, + M_TYPE = t.M_TYPE, + B_NAME = t.B_NAME, + MinId = SqlFunc.AggregateMin(t.I_ID) + }).OrderByDescending(t=>t.MinId).ToOffsetPage(2, 30, ref Count); Console.WriteLine("#### MasterSlave End ####"); } } diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TMANAGER_SYS_USER.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TMANAGER_SYS_USER.cs new file mode 100644 index 000000000..22d79f71f --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TMANAGER_SYS_USER.cs @@ -0,0 +1,157 @@ +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace xTPLM.RFQ.Model.XMANAGER_APP +{ + /// + ///用户表 + /// + [SugarTable("TMANAGER_SYS_USER")] + public partial class TMANAGER_SYS_USER + { + public TMANAGER_SYS_USER() + { + + + } + /// + /// Desc:主键 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, OracleSequenceName = "TMANAGER_SYS_USER$SEQ", IsIdentity = true)] + public int U_ID { get; set; } + + /// + /// Desc:用户名 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 48)] + public string U_NAME { get; set; } + + /// + /// Desc:密码 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 48)] + public string U_PWD { get; set; } + + /// + /// Desc:性别 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, Length = 1)] + public string U_SEX { get; set; } + + /// + /// Desc:邮件地址 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 100)] + public string U_EMAIL { get; set; } + + /// + /// Desc:手机号 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 20)] + public string U_MOBILE { get; set; } + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 1000)] + public string U_REMARK { get; set; } + + /// + /// Desc:逻辑删除 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, Length = 1)] + public string DELETED { get; set; } = "0"; + + /// + /// Desc:更新人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string UPDATED_BY { get; set; } + + /// + /// Desc:更新时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? UPDATED_TIME { get; set; } + + /// + /// Desc:用户启用状态 1:启用,0:禁用 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false)] + public int U_STATUS { get; set; } + + /// + /// Desc:昵称 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 255)] + public string U_NICKNAME { get; set; } + + /// + /// Desc:部门ID + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? U_DID { get; set; } + + /// + /// Desc:职务 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? U_POSITION { get; set; } + + /// + /// Desc:是否是IR单点登录用户 0:不是,1:是 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? IS_IRUSER { get; set; } + + /// + /// IR用户 + /// + [SugarColumn(IsIgnore = true)] + public string USER_CODE { get => this.IR_CODE; } + + /// + /// 部门名称 + /// + [SugarColumn(IsIgnore = true)] + public string D_NAME { get; set; } + + /// + /// IR账户名 + /// + [SugarColumn(IsIgnore = true)] + public string IR_CODE { get; set; } + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_ACC_SECU.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_ACC_SECU.cs new file mode 100644 index 000000000..1ed7cc2b2 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_ACC_SECU.cs @@ -0,0 +1,95 @@ +using SqlSugar; +using System; +using xTPLM.RFQ.Common.Enum; + +namespace xTPLM.RFQ.Model.XRFQ_APP +{ + /// + ///询报价—内证表 + /// + [SugarTable("TRFQ_ACC_SECU")] + public partial class TRFQ_ACC_SECU + { + public TRFQ_ACC_SECU() + { + + + } + /// + /// Desc:内证编号 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, Length = 32)] + public string ACCID { get; set; } + + /// + /// Desc:内证名称 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 512)] + public string ACCNAME { get; set; } + + /// + /// Desc:内资 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string CASH_ACCID { get; set; } + + /// + /// Desc:所有者 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string OWNER { get; set; } + + /// + /// Desc:证券账户状态 0:创建中 1:已启用 2:停用中 3:已停用 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public AccountStatus? STATUS { get; set; } + + /// + /// Desc:导入时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? IMPORTTIME { get; set; } + + /// + /// Desc:最后更新人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string UPDATED_BY { get; set; } + + /// + /// Desc:最后更新时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? UPDATED_TIME { get; set; } + + /// + /// + /// + [SugarColumn(IsNullable = true, Length = 100)] + public string SHTRADER_ID { get; set; } + + /// + /// 财务分类科目 + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string ACCFISCASUBJECT { get; set; } + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_BND.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_BND.cs new file mode 100644 index 000000000..6ce04ed83 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_BND.cs @@ -0,0 +1,145 @@ +using SqlSugar; +using System; +using xTPLM.RFQ.Common; + +namespace xTPLM.RFQ.Model.XRFQ_APP +{ + /// + ///询价债券表 + /// + [SugarTable("TRFQ_BND")] + public partial class TRFQ_BND + { + public TRFQ_BND() + { + + + } + /// + /// Desc:I_CODE + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, Length = 128)] + public string I_CODE { get; set; } + + /// + /// Desc:A_TYPE + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, IsPrimaryKey = true, Length = 128)] + public string A_TYPE { get; set; } + + /// + /// Desc:M_TYPE + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, IsPrimaryKey = true, Length = 128)] + public string M_TYPE { get; set; } + + /// + /// Desc:报价 价格类型:1-到期收益率 2-行权收益率 3-净价 4-全价 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, ColumnDataType = "INT")] + public PriceTypeEnum? PRICE_TYPE { get; set; } + + /// + /// Desc:最后一次修改时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? UPDATE_TIME { get; set; } + + /// + /// Desc:最后一次修改人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 128)] + public string UPDATE_BY { get; set; } + + /// + /// Desc:是否城投 0:否,1:是 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? IS_CITY_INVESTMENT { get; set; } + + /// + /// Desc:是否永续债,0:否;1:是 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? PERPETUAL { get; set; } + + /// + /// Desc:金融工具Name,债券简称 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string B_NAME { get; set; } + + /// + /// Desc:是否利率债 0:未划分,1:信用债,2:利率债 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public decimal? IS_RATES { get; set; } + + /// + /// Desc:发行人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 256)] + public string ISSUER { get; set; } + + /// + /// Desc:发行人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 256)] + public string BONDISSUER { get; set; } + + /// + /// 风控主体拼音全称 + /// + [SugarColumn(IsNullable = true, Length = 2048)] + public string BONDISSUER_PINYIN { get; set; } + + /// + /// 风控主体拼音简写 + /// + [SugarColumn(IsNullable = true, Length = 2048)] + public string BONDISSUER_PINYIN_SHORT { get; set; } + + /// + /// Desc:债券类别 + /// Default: + /// Nullable:True + /// + + [SugarColumn(IsNullable = true, Length = 128)] + public string P_CLASS { get; set; } + + /// + /// Desc:万得一级分类 + /// Default: + /// Nullable:True + /// + + [SugarColumn(IsNullable = true, Length = 128)] + public string WIND_CLASS1 { get; set; } + + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_COUNTERPARTY.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_COUNTERPARTY.cs new file mode 100644 index 000000000..265aefa37 --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_COUNTERPARTY.cs @@ -0,0 +1,246 @@ +using SqlSugar; +using System; +using System.Collections.Generic; + +namespace xTPLM.RFQ.Model.XRFQ_APP +{ + /// + ///交易对手表 + /// + [SugarTable("TRFQ_COUNTERPARTY")] + public partial class TRFQ_COUNTERPARTY + { + public TRFQ_COUNTERPARTY() + { + + + } + /// + /// Desc:主键 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, OracleSequenceName = "TRFQ_COUNTERPARTY$SEQ", IsIdentity = true)] + public int P_SYSID { get; set; } + + /// + /// Desc:名称 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, Length = 1000)] + public string PARTYNAME { get; set; } + + /// + /// Desc:简称 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 200)] + public string PARTYNAME_SHORT { get; set; } + + /// + /// Desc:启用状态:0=停用;1=启用 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? PARTYSTATUS { get; set; } + + /// + /// Desc:银行间会员代码 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string CNBD_MEMBERID { get; set; } + + /// + /// Desc:外汇21位机构代码 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string CNBD_ORGCODE { get; set; } + + /// + /// Desc:所在地域 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string BELONGTOAREA { get; set; } + + /// + /// Desc:上交所固收平台交易商代码 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string SHG_FIX_CUSTCODE { get; set; } + + /// + /// Desc:新增类型:0:手动,1:自动 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 10)] + public string PARTYSOURCE { get; set; } + + /// + /// Desc:统一社会信用代码 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 100)] + public string CREDITCODE { get; set; } + + /// + /// Desc:法人代表 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 200)] + public string LEGALPERSON { get; set; } + + /// + /// Desc:营业执照有效日期 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 10)] + public string EXPDATE { get; set; } + + /// + /// Desc:备注 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 500)] + public string REMARK { get; set; } + + /// + /// Desc:外汇做市商类型:0 非做市商,1 做市商,2 尝试做市商-综合做市,3 尝试做市商-专项做市 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 10)] + public string MARKETMAKER_TYPE { get; set; } + + /// + /// Desc:最后更新人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string UPDATED_BY { get; set; } + + /// + /// Desc:最后更新时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? UPDATED_TIME { get; set; } + + /// + /// Desc:别名 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 1000)] + public string ALIAS { get; set; } + + /// + /// Desc:外部ID + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? P_EXTID { get; set; } + + /// + /// Desc:导入时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? IMPORTTIME { get; set; } + + /// + /// Desc:所属机构 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? PARENTORGANPARTYID { get; set; } + + /// + /// Desc:客户信评等级 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 50)] + public string CREDITLEVEL { get; set; } + + /// + /// 净资产 + /// + [SugarColumn(IsNullable = true)] + public decimal? PARTY_NET_ASSETS { get; set; } + + /// + /// 交易对手名称_拼音首拼 + /// + [SugarColumn(IsNullable = true, Length = 512)] + public string PARTYNAME_PINYIN { get; set; } + + /// + /// 交易对手简称_拼音首拼 + /// + [SugarColumn(IsNullable = true, Length = 512)] + public string PARTYNAME_SHORT_PINYIN { get; set; } + + /// + /// 是否法人:1,法人;0,非法人 + /// + [SugarColumn(IsNullable = true, Length = 1)] + public string ISLEGALPERSON { get; set; } + + #region 数据库忽略字段 + + /// + /// 对手类型描述 + /// + [SugarColumn(IsIgnore = true)] + public string PARTY_TYPE_DESC + { + get + { + if (ISLEGALPERSON == "0") + { + return "非法人户"; + } + else if (ISLEGALPERSON == "1") + { + return "法人户"; + } + + return string.Empty; + } + } + + /// + /// 所属机构名称 + /// + [SugarColumn(IsIgnore = true)] + public string PARENTORGANPARTY { get; set; } + + /// + /// 更新人名称 + /// + [SugarColumn(IsIgnore = true)] + public string UPDATED_BY_NAME { get; set; } + #endregion + } +} diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_INSTRUCTIONS.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_INSTRUCTIONS.cs index 70f1eb40f..7e0efc922 100644 --- a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_INSTRUCTIONS.cs +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_INSTRUCTIONS.cs @@ -1,8 +1,12 @@ using SqlSugar; +using System; +using System.Collections.Generic; +using xTPLM.Base.Extend; +using xTPLM.RFQ.Common; +using xTPLM.RFQ.Common.Enum; namespace xTPLM.RFQ.Model.XRFQ_APP { - /// ///指令表 /// [SugarTable("TRFQ_INSTRUCTIONS")] @@ -78,8 +82,8 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// Default: /// Nullable:True /// - [SugarColumn(IsNullable = true)] - public int? STATUS { get; set; } + [SugarColumn(IsNullable = true, ColumnDataType = "INT")] + public InstructionsStatus? STATUS { get; set; } /// /// Desc:债券代码 @@ -118,16 +122,16 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// Default: /// Nullable:True /// - [SugarColumn(IsNullable = true)] - public int? PRICE_TYPE { get; set; } + [SugarColumn(IsNullable = true, ColumnDataType = "INT")] + public PriceTypeEnum? PRICE_TYPE { get; set; } /// /// Desc:交易方向 /// Default: /// Nullable:True /// - [SugarColumn(IsNullable = true)] - public string TRADE_TYPE { get; set; } + [SugarColumn(IsNullable = true, ColumnDataType = "VARCHAR2(50 BYTE)")] + public TradeType? TRADE_TYPE { get; set; } /// /// Desc:交易对手 @@ -159,7 +163,7 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// Nullable:True /// [SugarColumn(IsNullable = true)] - public int? IS_RATES { get; set; } + public RatesEnum? IS_RATES { get; set; } /// /// Desc:最小交易日期 @@ -237,17 +241,11 @@ namespace xTPLM.RFQ.Model.XRFQ_APP [SugarColumn(IsNullable = true, Length = 4000)] public string SUBMIT_MESSAGE { get; set; } - /// - /// 到期收益率 - /// - [SugarColumn(IsNullable = true)] - public decimal? YTM { get; set; } - /// /// 指令类型 1:精确指令 2:模糊指令 /// [SugarColumn(IsNullable = false)] - public int I_TYPE { get; set; } = 1; + public InstructionsType I_TYPE { get; set; } /// /// 交易日期 @@ -260,8 +258,8 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// Default: /// Nullable:True /// - [SugarColumn(IsNullable = true)] - public int SET_DAYS { get; set; } + [SugarColumn(IsNullable = true, ColumnDataType = "INT")] + public SetDays SET_DAYS { get; set; } = SetDays.T0; /// /// Desc:指令流水号 请勿使用 @@ -272,6 +270,12 @@ namespace xTPLM.RFQ.Model.XRFQ_APP [SugarColumn(IsNullable = true)] public string I_NO { get; set; } + /// + /// 到期收益率 + /// + [SugarColumn(IsNullable = true)] + public decimal? YTM { get; set; } + /// /// 行权收益率 /// @@ -294,26 +298,93 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// 到期收益率上限 (模糊指令有效) /// [SugarColumn(IsNullable = true)] - public decimal? YTM_UPPER { get; set; } + public decimal? YTM_UPPER + { + get + { + if (this.I_TYPE != InstructionsType.Vague) + { + return this.YTM; + } + else + { + return this._ytm_upper; + } + } + set + { + this._ytm_upper = value; + } + } /// /// 行政收益率上限 (模式指令有效) /// [SugarColumn(IsNullable = true)] - public decimal? YTM_OE_UPPER { get; set; } + public decimal? YTM_OE_UPPER + { + get + { + if (this.I_TYPE != InstructionsType.Vague) + { + return this.YTM_OE; + } + else + { + return this._ytm_oe_upper; + } + } + set + { + this._ytm_oe_upper = value; + } + } /// /// 净价上限(模糊指令有效) /// [SugarColumn(IsNullable = true)] - public decimal? NETPRICE_UPPER { get; set; } + public decimal? NETPRICE_UPPER + { + get + { + if (this.I_TYPE != InstructionsType.Vague) + { + return this.NETPRICE; + } + else + { + return this._netprice_upper; + } + } + set + { + this._netprice_upper = value; + } + } /// /// 全价上限 (模糊指令有效) /// [SugarColumn(IsNullable = true)] - public decimal? PRICE_UPPER { get; set; } - + public decimal? PRICE_UPPER + { + get + { + if (this.I_TYPE != InstructionsType.Vague) + { + return this.PRICE; + } + else + { + return this._price_upper; + } + } + set + { + this._price_upper = value; + } + } /// /// 提交审批时间 @@ -356,6 +427,366 @@ namespace xTPLM.RFQ.Model.XRFQ_APP /// [SugarColumn(IsNullable = true, Length = 128)] public string EXT_TRADE_ID { get; set; } + + /// + /// 作废前状态 + /// + [SugarColumn(IsNullable = true)] + public InstructionsStatus? CANCEL_STATUS { get; set; } + + #region 数据库忽略字段 + /// + /// 已下发的面额 + /// + [SugarColumn(IsIgnore = true)] + public decimal OrderMoneyRelease { get; set; } + + /// + /// 剩余可用额度 + /// + [SugarColumn(IsIgnore = true)] + public decimal REMAIN_LIMIT { get; set; } + + /// + /// 进度 + /// + [SugarColumn(IsIgnore = true)] + public decimal PROGRESS + { + get + { + if (this.ORDER_MONEY > 0) + { + return Math.Round(this.OrderMoneyRelease / this.ORDER_MONEY.Value, 2) * 100; + } + else + { + return 0; + } + } + } + + /// + /// 部门ID + /// + [SugarColumn(IsIgnore = true)] + public int? D_ID { get; set; } + + /// + /// 部门名称 + /// + [SugarColumn(IsIgnore = true)] + public string D_NAME { get; set; } + + /// + /// 交易对手名称 + /// + [SugarColumn(IsIgnore = true)] + public string PARTY_NAME { get; set; } + + /// + /// 执行人(执行人有多个) + /// + [SugarColumn(IsIgnore = true)] + public List UserId { get; set; } + + /// + /// 执行人姓名 + /// + [SugarColumn(IsIgnore = true)] + public string User_Desc { get; set; } + + /// + /// 录入人名称 + /// + [SugarColumn(IsIgnore = true)] + public string CREATE_BY_NAME { get; set; } + + /// + /// 是否能够编辑或者提交审批 + /// + [SugarColumn(IsIgnore = true)] + public bool IsEdit { get; set; } + + /// + /// 价格类型描述 + /// + [SugarColumn(IsIgnore = true)] + public string PRICE_TYPE_DESC + { + get + { + return this.PRICE_TYPE.GetValueOrDefault().GetDescription(); + } + } + + /// + /// 指令类型类型描述 + /// + [SugarColumn(IsIgnore = true)] + public string I_TYPE_DESC => this.I_TYPE.GetDescription(); + + /// + /// 状态描述 + /// + [SugarColumn(IsIgnore = true)] + public string STATUS_DESC + { + get + { + if (this.STATUS.HasValue) + { + return this.STATUS.Value.GetDescription(); + } + return string.Empty; + } + } + + /// + /// 交易方向描述 + /// + [SugarColumn(IsIgnore = true)] + public string TRADE_TYPE_DESC + { + get + { + if (this.TRADE_TYPE.HasValue) + { + return this.TRADE_TYPE.Value.GetDescription(); + } + return string.Empty; + } + + } + + /// + /// 清算速度描述 + /// + [SugarColumn(IsIgnore = true)] + public string SET_DAYS_DESC + { + get + { + return this.SET_DAYS.GetDescription(); + } + } + + /// + /// 价格范围 + /// + [SugarColumn(IsIgnore = true)] + public string PRICE_MIN + { + get + { + string result = string.Empty; + if (this.PRICE_TYPE.HasValue) + { + if (this.I_TYPE == InstructionsType.Vague) + { + switch (this.PRICE_TYPE.Value) + { + case PriceTypeEnum.YTM: + result = $"{this.YTM}-{this.YTM_UPPER}"; + break; + case PriceTypeEnum.YTM_OE: + result = $"{this.YTM_OE}-{this.YTM_OE_UPPER}"; + break; + case PriceTypeEnum.NETPRICE: + result = $"{this.NETPRICE}-{this.NETPRICE_UPPER}"; + break; + case PriceTypeEnum.PRICE: + result = $"{this.PRICE}-{this.PRICE_UPPER}"; + break; + default: + break; + } + } + else + { + switch (this.PRICE_TYPE.Value) + { + case PriceTypeEnum.YTM: + result = this.YTM.ToString(); + break; + case PriceTypeEnum.YTM_OE: + result = this.YTM_OE.ToString(); + break; + case PriceTypeEnum.NETPRICE: + result = this.NETPRICE.ToString(); + break; + case PriceTypeEnum.PRICE: + result = this.PRICE.ToString(); + break; + default: + break; + } + } + } + return result; + } + } + + /// + /// 内证账户名称 + /// + [SugarColumn(IsIgnore = true)] + public string SECU_ACCNAME { get; set; } + + /// + ///发行人 + /// + [SugarColumn(IsIgnore = true)] + public string ISSUER { get; set; } + + /// + /// 债券名称 + /// + [SugarColumn(IsIgnore = true)] + public string B_NAME { get; set; } + + /// + /// 交易市场描述 + /// + [SugarColumn(IsIgnore = true)] + public string M_TYPE_DESC + { + get + { + if (!string.IsNullOrWhiteSpace(this.M_TYPE)) + { + return MarketType.GetDescription(this.M_TYPE); + } + return string.Empty; + } + } + + /// + /// 关联有效询价列表(询价单状态已撤销或无记录或审批拒绝,视为无效) + /// + [SugarColumn(IsIgnore = true)] + public List ValidQuotaIDList { get; set; } + + #endregion + + #region 资管字段 + /// + /// 产品ID(内资代码) + /// + [SugarColumn(IsNullable = true, Length = 128)] + public string CASH_ACCID { get; set; } + + /// + /// 待确认操作类型 + /// + [SugarColumn(IsNullable = true, Length = 50)] + public ActionType? CONFIRM_ACTION_TYPE { get; set; } + + + #region 数据库忽略字段 + + /// + /// 产品名称 + /// + [SugarColumn(IsIgnore = true)] + public string PRODUCT_NAME { get; set; } + + #endregion + + #endregion + + /// + /// 价格处理 + /// + public void PriceMath() + { + if (this.NETPRICE.HasValue) + { + this.NETPRICE = Math.Round(this.NETPRICE.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.NETPRICE_UPPER.HasValue) + { + this.NETPRICE_UPPER = Math.Round(this.NETPRICE_UPPER.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.YTM.HasValue) + { + this.YTM = Math.Round(this.YTM.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.YTM_UPPER.HasValue) + { + this.YTM_UPPER = Math.Round(this.YTM_UPPER.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.YTM_OE.HasValue) + { + this.YTM_OE = Math.Round(this.YTM_OE.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.YTM_OE_UPPER.HasValue) + { + this.YTM_OE_UPPER = Math.Round(this.YTM_OE_UPPER.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.PRICE.HasValue) + { + this.PRICE = Math.Round(this.PRICE.Value, 4, MidpointRounding.AwayFromZero); + } + if (this.PRICE_UPPER.HasValue) + { + this.PRICE_UPPER = Math.Round(this.PRICE_UPPER.Value, 4, MidpointRounding.AwayFromZero); + } + } + + } + + + /// + /// 指令排序对象 + /// + public class InsOrderList + { + + /// + /// 债券代码 + /// + public string I_CODE { get; set; } + + /// + /// 资产类型 + /// + public string A_TYPE { get; set; } + + /// + /// 交易市场 + /// + public string M_TYPE { get; set; } + + /// + /// 债券名称 + /// + public string B_NAME { get; set; } + + /// + /// 交易市场描述 + /// + public string M_TYPE_DESC + { + get + { + if (!string.IsNullOrWhiteSpace(this.M_TYPE)) + { + return MarketType.GetDescription(this.M_TYPE); + } + return string.Empty; + } + } + + /// + /// 最小ID + /// + public int MinId { get; set; } + + /// + /// 子列表 + /// + public List ChildList { get; set; } } } diff --git a/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_SYS_TASK.cs b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_SYS_TASK.cs new file mode 100644 index 000000000..700d154af --- /dev/null +++ b/Src/Asp.NetCore2/OceanBaseForOracleTest/TRFQ_SYS_TASK.cs @@ -0,0 +1,110 @@ + +using SqlSugar; + +namespace xTPLM.RFQ.Model.XRFQ_APP +{ + /// + ///计划任务表 + /// + [SugarTable("TRFQ_SYS_TASK")] + public partial class TRFQ_SYS_TASK + { + public TRFQ_SYS_TASK() + { + + + } + /// + /// Desc:主键 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false, IsPrimaryKey = true, OracleSequenceName = "TRFQ_TASK$SEQ", IsIdentity = true)] + public int ID { get; set; } + + /// + /// Desc:任务名称 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 128)] + public string TASKNAME { get; set; } + + /// + /// Desc:执行ID + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public int? JOB_ID { get; set; } + + /// + /// Desc:任务配置 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 1024)] + public string TASK_CONFIG { get; set; } + + /// + /// Desc:状态1:启用,0:禁用 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false)] + public int STATUS { get; set; } + + /// + /// Desc:上一次执行时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? PREVIOUS_FIRE_TIME { get; set; } + + /// + /// Desc:下一次执行时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? NEXT_FIRE_TIME { get; set; } + + /// + /// Desc:已执行次数 + /// Default: + /// Nullable:False + /// + [SugarColumn(IsNullable = false)] + public int COUNT { get; set; } + + /// + /// Desc:最后一次修改人 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true, Length = 32)] + public string UPDATE_BY { get; set; } + + /// + /// Desc:最后一次修改时间 + /// Default: + /// Nullable:True + /// + [SugarColumn(IsNullable = true)] + public DateTime? UPDATE_TIME { get; set; } + + /// + /// 工作名称 + /// + [SugarColumn(IsIgnore = true)] + public string JOBNAME { get; set; } + + /// + /// 配置说明 + /// + [SugarColumn(IsIgnore = true)] + public string TASK_CONFIG_DESCRIPTION { get; set; } + + } +} diff --git a/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleQueryBuilder.cs b/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleQueryBuilder.cs index 4c3909451..83fdb7869 100644 --- a/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleQueryBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar.OceanBaseForOracle/OceanBase/SqlBuilder/OceanBaseForOracleQueryBuilder.cs @@ -23,18 +23,17 @@ namespace SqlSugar.OceanBaseForOracle } public override string ToSqlString() { - //OB的Oracle模式,暂不支持Offsetpage - //if (this.Offset == "true") - //{ - // return OffsetPage(); - //} + if (this.Offset == "true") + { + return OffsetPage(); + } var oldTake = Take; var oldSkip = Skip; var isDistinctPage = IsDistinct && (Take > 1 || Skip > 1); - //if (isDistinctPage) - //{ - // return OffsetPage(); - //} + if (isDistinctPage) + { + return OffsetPage(); + } var result = _ToSqlString(); //if (isDistinctPage) //{ @@ -58,12 +57,12 @@ namespace SqlSugar.OceanBaseForOracle private string OffsetPage() { - var skip = this.Skip; + var skip = this.Skip ?? 1; var take = this.Take; this.Skip = null; this.Take = null; this.Offset = null; - var pageSql = $"SELECT * FROM ( SELECT PAGETABLE1.*,ROWNUM PAGEINDEX FROM( {this.ToSqlString()}) PAGETABLE1 WHERE ROWNUM<={skip + take}) WHERE PAGEINDEX>={skip + 1}"; + var pageSql = $"SELECT * FROM ( SELECT PAGETABLE1.*,ROWNUM PAGEINDEX FROM( {this.ToSqlString()}) PAGETABLE1 WHERE ROWNUM<={skip + take}) WHERE PAGEINDEX>={(skip == 0 ? skip : (skip + 1))}"; return pageSql; } @@ -88,6 +87,11 @@ namespace SqlSugar.OceanBaseForOracle sql.Replace(UtilConstants.ReplaceKey, isRowNumber ? (isIgnoreOrderBy ? null : rowNumberString) : null); if (isIgnoreOrderBy) { this.OrderByValue = oldOrderBy; return sql.ToString(); } var result = ToPageSql(sql.ToString(), this.Take, this.Skip); + if (this.GetGroupByString == null && this.Take == 1 && this.Skip == 0 && oldOrderBy == "ORDER BY sysdate ") + { + result = $" {sql.ToString()} {(this.WhereInfos.Any() ? "AND" : "WHERE")} ROWNUM = 1 "; + result = result.Replace(rowNumberString, " "); + } if (ExternalPageIndex > 0) { if (externalOrderBy.IsNullOrEmpty()) -- Gitee