|
|
@@ -409,19 +409,24 @@ func QueryTradeOrderDetail(c *gin.Context) {
|
|
|
Select(`to_char(TRADE_ORDERDETAIL.ORDERID) as ORDERID, to_char(TRADE_ORDERDETAIL.PREORDERID) as PREORDERID, to_char(TRADE_ORDERDETAIL.CANCELORDERID) as CANCELORDERID, to_char(TRADE_ORDERDETAIL.RELATEDID) as RELATEDID,
|
|
|
TRADE_ORDERDETAIL.*, TRADE_ORDERDETAIL.ORDERQTY - TRADE_ORDERDETAIL.TRADEQTY - TRADE_ORDERDETAIL.CANCELQTY as ENABLEQTY,
|
|
|
GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE,GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE`).
|
|
|
- Where(fmt.Sprintf(`TRADE_ORDERDETAIL.ORDERSRC != 10 and TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
|
|
|
+ // Where(fmt.Sprintf(`TRADE_ORDERDETAIL.ORDERSRC != 10 and TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
|
|
|
+ Where("TRADE_ORDERDETAIL.ORDERSRC != 10").
|
|
|
+ In("TRADE_ORDERDETAIL.ACCOUNTID", strings.Split(req.AccountID, ",")).
|
|
|
Desc("TRADE_ORDERDETAIL.ORDERTIME")
|
|
|
if len(req.OrderStatus) > 0 {
|
|
|
- s = s.And(fmt.Sprintf(`TRADE_ORDERDETAIL.ORDERSTATUS in (%s)`, req.OrderStatus))
|
|
|
+ // s = s.And(fmt.Sprintf(`TRADE_ORDERDETAIL.ORDERSTATUS in (%s)`, req.OrderStatus))
|
|
|
+ s = s.In("TRADE_ORDERDETAIL.ORDERSTATUS", strings.Split(req.OrderStatus, ","))
|
|
|
}
|
|
|
if len(req.TradeMode) > 0 {
|
|
|
- s = s.And(fmt.Sprintf(`MARKET.TRADEMODE in (%s)`, req.TradeMode))
|
|
|
+ // s = s.And(fmt.Sprintf(`MARKET.TRADEMODE in (%s)`, req.TradeMode))
|
|
|
+ s = s.In("MARKET.TRADEMODE", strings.Split(req.TradeMode, ","))
|
|
|
}
|
|
|
if req.OrderID > 0 {
|
|
|
s = s.And("TRADE_ORDERDETAIL.ORDERID = ?", req.OrderID)
|
|
|
}
|
|
|
if req.IncOrderID != "" {
|
|
|
- s = s.And(fmt.Sprintf("TRADE_ORDERDETAIL.ORDERID > %v", req.IncOrderID))
|
|
|
+ // s = s.And(fmt.Sprintf("TRADE_ORDERDETAIL.ORDERID > %v", req.IncOrderID))
|
|
|
+ s = s.And("TRADE_ORDERDETAIL.ORDERID > ?", req.IncOrderID)
|
|
|
}
|
|
|
if err := s.Find(&datas); err != nil {
|
|
|
// 查询失败
|
|
|
@@ -515,22 +520,28 @@ func QueryHisTradeOrderDetail(c *gin.Context) {
|
|
|
Select(`to_char(HIS_TRADE_ORDERDETAIL.ORDERID) as ORDERID, to_char(HIS_TRADE_ORDERDETAIL.PREORDERID) as PREORDERID, to_char(HIS_TRADE_ORDERDETAIL.CANCELORDERID) as CANCELORDERID, to_char(HIS_TRADE_ORDERDETAIL.RELATEDID) as RELATEDID,
|
|
|
HIS_TRADE_ORDERDETAIL.*,
|
|
|
GOODS.GOODSCODE, GOODS.GOODSNAME,GOODS.DECIMALPLACE, GOODS.QTYDECIMALPLACE,GOODS.GOODUNITID, MARKET.MARKETNAME, MARKET.TRADEMODE`).
|
|
|
- Where(fmt.Sprintf(`HIS_TRADE_ORDERDETAIL.ORDERSRC != 10 and HIS_TRADE_ORDERDETAIL.ISVALIDDATA = 1 and HIS_TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
|
|
|
+ // Where(fmt.Sprintf(`HIS_TRADE_ORDERDETAIL.ORDERSRC != 10 and HIS_TRADE_ORDERDETAIL.ISVALIDDATA = 1 and HIS_TRADE_ORDERDETAIL.ACCOUNTID in (%s)`, req.AccountID)).
|
|
|
+ Where("HIS_TRADE_ORDERDETAIL.ORDERSRC != 10 and HIS_TRADE_ORDERDETAIL.ISVALIDDATA = 1").
|
|
|
+ In("HIS_TRADE_ORDERDETAIL.ACCOUNTID", strings.Split(req.AccountID, ",")).
|
|
|
Desc("HIS_TRADE_ORDERDETAIL.ORDERTIME")
|
|
|
if len(req.OrderStatus) > 0 {
|
|
|
- s = s.And(fmt.Sprintf(`HIS_TRADE_ORDERDETAIL.ORDERSTATUS in (%s)`, req.OrderStatus))
|
|
|
+ // s = s.And(fmt.Sprintf(`HIS_TRADE_ORDERDETAIL.ORDERSTATUS in (%s)`, req.OrderStatus))
|
|
|
+ s = s.And("HIS_TRADE_ORDERDETAIL.ORDERSTATUS", strings.Split(req.OrderStatus, ","))
|
|
|
}
|
|
|
if len(req.TradeMode) > 0 {
|
|
|
- s = s.And(fmt.Sprintf(`MARKET.TRADEMODE in (%s)`, req.TradeMode))
|
|
|
+ // s = s.And(fmt.Sprintf(`MARKET.TRADEMODE in (%s)`, req.TradeMode))
|
|
|
+ s = s.And("MARKET.TRADEMODE", strings.Split(req.TradeMode, ","))
|
|
|
}
|
|
|
if req.OrderID > 0 {
|
|
|
s = s.And("HIS_TRADE_ORDERDETAIL.ORDERID = ?", req.OrderID)
|
|
|
}
|
|
|
if len(req.StartDate) > 0 {
|
|
|
- s = s.And(fmt.Sprintf("to_date(HIS_TRADE_ORDERDETAIL.HISTRADEDATE,'yyyyMMdd') >= to_date('%s','yyyy-MM-dd')", req.StartDate))
|
|
|
+ // s = s.And(fmt.Sprintf("to_date(HIS_TRADE_ORDERDETAIL.HISTRADEDATE,'yyyyMMdd') >= to_date('%s','yyyy-MM-dd')", req.StartDate))
|
|
|
+ s = s.And("HIS_TRADE_ORDERDETAIL.HISTRADEDATE >= ?", strings.Replace(req.StartDate, "-", "", -1))
|
|
|
}
|
|
|
if len(req.EndDate) > 0 {
|
|
|
- s = s.And(fmt.Sprintf("to_date(HIS_TRADE_ORDERDETAIL.HISTRADEDATE,'yyyyMMdd') <= to_date('%s','yyyy-MM-dd')", req.EndDate))
|
|
|
+ // s = s.And(fmt.Sprintf("to_date(HIS_TRADE_ORDERDETAIL.HISTRADEDATE,'yyyyMMdd') <= to_date('%s','yyyy-MM-dd')", req.EndDate))
|
|
|
+ s = s.And("HIS_TRADE_ORDERDETAIL.HISTRADEDATE <= ?", strings.Replace(req.EndDate, "-", "", -1))
|
|
|
}
|
|
|
if err := s.Find(&datas); err != nil {
|
|
|
// 查询失败
|
|
|
@@ -819,11 +830,11 @@ func QueryHisTradeDetail(c *gin.Context) {
|
|
|
}
|
|
|
if len(req.StartDate) > 0 {
|
|
|
// s = s.And(fmt.Sprintf("to_date(HIS_TRADE_TRADEDETAIL.HISTRADEDATE,'yyyyMMdd') >= to_date('%s','yyyy-MM-dd')", req.StartDate))
|
|
|
- s = s.And("HIS_TRADE_TRADEDETAIL.HISTRADEDATE >= ?", req.StartDate)
|
|
|
+ s = s.And("HIS_TRADE_TRADEDETAIL.HISTRADEDATE >= ?", strings.Replace(req.StartDate, "-", "", -1))
|
|
|
}
|
|
|
if len(req.EndDate) > 0 {
|
|
|
// s = s.And(fmt.Sprintf("to_date(HIS_TRADE_TRADEDETAIL.HISTRADEDATE,'yyyyMMdd') <= to_date('%s','yyyy-MM-dd')", req.EndDate))
|
|
|
- s = s.And("HIS_TRADE_TRADEDETAIL.HISTRADEDATE <= ?", req.EndDate)
|
|
|
+ s = s.And("HIS_TRADE_TRADEDETAIL.HISTRADEDATE <= ?", strings.Replace(req.EndDate, "-", "", -1))
|
|
|
}
|
|
|
if err := s.Find(&datas); err != nil {
|
|
|
// 查询失败
|