|
|
@@ -829,7 +829,7 @@ type QueryHedgeTradeDetailRsp struct {
|
|
|
}
|
|
|
|
|
|
// GetHedgeInnerTradeDetails 获取通道交易内部成交单信息
|
|
|
-func GetHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
+func GetHedgeInnerTradeDetails(accountID, goodsID, buyOrSell, orderID int) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
type tradeDetail struct {
|
|
|
Tradeid string `json:"tradeid" xorm:"'TRADEIDSTR'"` // 成交单号(108+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
|
|
|
Buyorsell int32 `json:"buyorsell" xorm:"'BUYORSELL'"` // 方向 - 0:买 1:卖
|
|
|
@@ -898,6 +898,9 @@ func GetHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeT
|
|
|
if buyOrSell != 0 {
|
|
|
session = session.And("T.BUYORSELL = ?", buyOrSell)
|
|
|
}
|
|
|
+ if orderID != 0 {
|
|
|
+ session = session.And("T.ORDERID = ?", orderID)
|
|
|
+ }
|
|
|
if err := session.Desc("T.TRADEID").
|
|
|
Find(&tradeDetails); err != nil {
|
|
|
return nil, err
|
|
|
@@ -936,7 +939,7 @@ func GetHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeT
|
|
|
}
|
|
|
|
|
|
// GetHisHedgeInnerTradeDetails 获取通道交易历史内部成交单信息
|
|
|
-func GetHisHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int, startDate, endDate string) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
+func GetHisHedgeInnerTradeDetails(accountID, goodsID, buyOrSell, orderID int, startDate, endDate string) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
type tradeDetail struct {
|
|
|
Tradeid string `json:"tradeid" xorm:"'TRADEIDSTR'"` // 成交单号(108+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
|
|
|
Buyorsell int32 `json:"buyorsell" xorm:"'BUYORSELL'"` // 方向 - 0:买 1:卖
|
|
|
@@ -1005,6 +1008,9 @@ func GetHisHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int, startDate,
|
|
|
if buyOrSell != 0 {
|
|
|
session = session.And("T.BUYORSELL = ?", buyOrSell)
|
|
|
}
|
|
|
+ if orderID != 0 {
|
|
|
+ session = session.And("T.ORDERID = ?", orderID)
|
|
|
+ }
|
|
|
if len(startDate) > 0 {
|
|
|
session = session.And(fmt.Sprintf("to_date(T.HISTRADEDATE,'yyyyMMdd') >= to_date('%s','yyyy-MM-dd')", startDate))
|
|
|
}
|
|
|
@@ -1049,7 +1055,7 @@ func GetHisHedgeInnerTradeDetails(accountID, goodsID, buyOrSell int, startDate,
|
|
|
}
|
|
|
|
|
|
// GetHedgeOutTradeDetails 获取通道交易外部成交单信息
|
|
|
-func GetHedgeOutTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
+func GetHedgeOutTradeDetails(accountID, goodsID, buyOrSell, orderID int) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
type tradeDetail struct {
|
|
|
Outtradeid string `json:"outtradeid" xorm:"'OUTTRADEIDSTR'" binding:"required"` // 外部成交单ID(114+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
|
|
|
Tradedate string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyyMMdd)
|
|
|
@@ -1100,6 +1106,9 @@ func GetHedgeOutTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeTra
|
|
|
if buyOrSell != 0 {
|
|
|
session = session.And("T.BUYORSELL = ?", buyOrSell)
|
|
|
}
|
|
|
+ if orderID != 0 {
|
|
|
+ session = session.And("T.RELATEDOUTORDERID = ?", orderID)
|
|
|
+ }
|
|
|
if err := session.Desc("T.OUTTRADEID").
|
|
|
Find(&tradeDetails); err != nil {
|
|
|
return nil, err
|
|
|
@@ -1138,7 +1147,7 @@ func GetHedgeOutTradeDetails(accountID, goodsID, buyOrSell int) ([]QueryHedgeTra
|
|
|
}
|
|
|
|
|
|
// GetHisHedgeOutTradeDetails 获取通道交易外部历史成交单信息
|
|
|
-func GetHisHedgeOutTradeDetails(accountID, goodsID, buyOrSell int, startDate, endDate string) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
+func GetHisHedgeOutTradeDetails(accountID, goodsID, buyOrSell, orderID int, startDate, endDate string) ([]QueryHedgeTradeDetailRsp, error) {
|
|
|
type tradeDetail struct {
|
|
|
Outtradeid string `json:"outtradeid" xorm:"'OUTTRADEIDSTR'" binding:"required"` // 外部成交单ID(114+Unix秒时间戳(10位)+2位(MarketServiceID)+xxxx)
|
|
|
Tradedate string `json:"tradedate" xorm:"'TRADEDATE'"` // 交易日(yyyyMMdd)
|
|
|
@@ -1189,6 +1198,9 @@ func GetHisHedgeOutTradeDetails(accountID, goodsID, buyOrSell int, startDate, en
|
|
|
if buyOrSell != 0 {
|
|
|
session = session.And("T.BUYORSELL = ?", buyOrSell)
|
|
|
}
|
|
|
+ if orderID != 0 {
|
|
|
+ session = session.And("T.RELATEDOUTORDERID = ?", orderID)
|
|
|
+ }
|
|
|
if len(startDate) > 0 {
|
|
|
session = session.And(fmt.Sprintf("to_date(T.HISTRADEDATE,'yyyyMMdd') >= to_date('%s','yyyy-MM-dd')", startDate))
|
|
|
}
|