|
@@ -299,7 +299,7 @@ func (r *ReportReckonDayPosition) buildSql() string {
|
|
|
where t.buycurpositionqty > 0
|
|
where t.buycurpositionqty > 0
|
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
|
and t.accountid = %v
|
|
and t.accountid = %v
|
|
|
- and t.reckondate = %v
|
|
|
|
|
|
|
+ and t.reckondate = '%v'
|
|
|
union
|
|
union
|
|
|
select 1 buyorsell,
|
|
select 1 buyorsell,
|
|
|
t.sellcurpositionqty curpositionqty,
|
|
t.sellcurpositionqty curpositionqty,
|
|
@@ -318,7 +318,7 @@ union
|
|
|
where t.sellcurpositionqty > 0
|
|
where t.sellcurpositionqty > 0
|
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
|
and t.accountid = %v
|
|
and t.accountid = %v
|
|
|
- and t.reckondate = %v ) p
|
|
|
|
|
|
|
+ and t.reckondate = '%v' ) p
|
|
|
left join goods g
|
|
left join goods g
|
|
|
on g.goodsid = p.goodsid
|
|
on g.goodsid = p.goodsid
|
|
|
left join market m
|
|
left join market m
|
|
@@ -357,7 +357,7 @@ func (r *ReportReckonDayPosition) buildSql_m() string {
|
|
|
where t.buycurpositionqty > 0
|
|
where t.buycurpositionqty > 0
|
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
|
and t.cycletype = 1
|
|
and t.cycletype = 1
|
|
|
- and t.cycletime = %v
|
|
|
|
|
|
|
+ and t.cycletime = '%v'
|
|
|
and t.accountid = %v
|
|
and t.accountid = %v
|
|
|
union
|
|
union
|
|
|
select 1 buyorsell,
|
|
select 1 buyorsell,
|
|
@@ -378,7 +378,7 @@ union
|
|
|
where t.sellcurpositionqty > 0
|
|
where t.sellcurpositionqty > 0
|
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
and m.trademode not in (40, 41, 48, 51)
|
|
|
and t.cycletype = 1
|
|
and t.cycletype = 1
|
|
|
- and t.cycletime = %v
|
|
|
|
|
|
|
+ and t.cycletime = '%v'
|
|
|
and t.accountid = %v) p
|
|
and t.accountid = %v) p
|
|
|
left join goods g
|
|
left join goods g
|
|
|
on g.goodsid = p.goodsid
|
|
on g.goodsid = p.goodsid
|
|
@@ -411,18 +411,18 @@ func (r *ReportReckonDayPosition) GetDataByPage() (interface{}, error, int, int,
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
type ReportTradeDetail struct {
|
|
type ReportTradeDetail struct {
|
|
|
- TRADETIME string `json:"tradetime" xorm:"TRADETIME"` // 时间
|
|
|
|
|
- GOODSDISPLAY string `json:"goodsdisplay" xorm:"GOODSDISPLAY"` // 商品
|
|
|
|
|
- BUYORSELLDISPLAY string `json:"buyorselldisplay" xorm:"BUYORSELLDISPLAY"` // 类型/方向
|
|
|
|
|
- TRADEQTY int64 `json:"tradeqty" xorm:"TRADEQTY"` // 数量
|
|
|
|
|
- TRADEPRICE float64 `json:"tradeprice" xorm:"TRADEPRICE"` // 价格
|
|
|
|
|
- TRADEAMOUNT float64 `json:"tradeamount" xorm:"TRADEAMOUNT"` // 成交金额
|
|
|
|
|
- CHARGE float64 `json:"charge" xorm:"CHARGE"` // 服务费
|
|
|
|
|
- TRADEID string `json:"tradeid" xorm:"TRADEID"` // 成交单号
|
|
|
|
|
- ACCOUNTID int64 `json:"accountid" xorm:"ACCOUNTID"` // 资金账户
|
|
|
|
|
- GOODSID int32 `json:"goodsid" xorm:"GOODSID"` // 期货合约ID(自增ID SEQ_GOODS)
|
|
|
|
|
- DECIMALPLACE int32 `json:"decimalplace" xorm:"DECIMALPLACE"` // 报价小数位
|
|
|
|
|
- HISTRADEDATE string `json:"histradedate" xorm:"HISTRADEDATE" binding:"required"` // 查询日期 日报表-yyyyMMdd 月报表-yyyyMM
|
|
|
|
|
|
|
+ TRADETIME string `json:"tradetime" xorm:"TRADETIME"` // 时间
|
|
|
|
|
+ GOODSDISPLAY string `json:"goodsdisplay" xorm:"GOODSDISPLAY"` // 商品
|
|
|
|
|
+ BUYORSELLDISPLAY string `json:"buyorselldisplay" xorm:"BUYORSELLDISPLAY"` // 类型/方向
|
|
|
|
|
+ TRADEQTY int64 `json:"tradeqty" xorm:"TRADEQTY"` // 数量
|
|
|
|
|
+ TRADEPRICE float64 `json:"tradeprice" xorm:"TRADEPRICE"` // 价格
|
|
|
|
|
+ TRADEAMOUNT float64 `json:"tradeamount" xorm:"TRADEAMOUNT"` // 成交金额
|
|
|
|
|
+ CHARGE float64 `json:"charge" xorm:"CHARGE"` // 服务费
|
|
|
|
|
+ TRADEID string `json:"tradeid" xorm:"TRADEID"` // 成交单号
|
|
|
|
|
+ ACCOUNTID int64 `json:"accountid" xorm:"ACCOUNTID" form:"accountid" binding:"required"` // 资金账户
|
|
|
|
|
+ GOODSID int32 `json:"goodsid" xorm:"GOODSID"` // 期货合约ID(自增ID SEQ_GOODS)
|
|
|
|
|
+ DECIMALPLACE int32 `json:"decimalplace" xorm:"DECIMALPLACE"` // 报价小数位
|
|
|
|
|
+ HISTRADEDATE string `json:"histradedate" xorm:"HISTRADEDATE" form:"histradedate" binding:"required"` // 查询日期 日报表-yyyyMMdd 月报表-yyyyMM
|
|
|
|
|
|
|
|
ReportType int `form:"reporttype" binding:"required"` // 报表类型 日报表-1 月报表-2
|
|
ReportType int `form:"reporttype" binding:"required"` // 报表类型 日报表-1 月报表-2
|
|
|
|
|
|
|
@@ -643,7 +643,7 @@ func (r *Reporttaaccount) buildSql() string {
|
|
|
t.floatnetvalue,
|
|
t.floatnetvalue,
|
|
|
t.riskrate
|
|
t.riskrate
|
|
|
from report_taaccount t
|
|
from report_taaccount t
|
|
|
- where t.cycletype = 1 and t.cycletime = %v and t.accountid = %v
|
|
|
|
|
|
|
+ where t.cycletype = 1 and t.cycletime = '%v' and t.accountid = %v
|
|
|
`
|
|
`
|
|
|
sqlId.FormatParam(r.CYCLETIME, r.ACCOUNTID)
|
|
sqlId.FormatParam(r.CYCLETIME, r.ACCOUNTID)
|
|
|
|
|
|