|
|
@@ -1953,6 +1953,9 @@ type Ermcp3TaFutuReDataReport struct {
|
|
|
GOODSNAME string `json:"goodsname" xorm:"'GOODSNAME'"` // 交易合约名称
|
|
|
GOODUNITID int32 `json:"goodunitid" xorm:"'GOODUNITID'"` // 交易合约单位id
|
|
|
ACCOUNTNAME string `json:"accountname" xorm:"'ACCOUNTNAME'"` // 交易账号名称
|
|
|
+ MIDDLEGOODSID int32 `json:"middlegoodsid" xorm:"'MIDDLEGOODSID'"` // 套保品种id
|
|
|
+ MIDDLEGOODSNAME string `json:"middlegoodsname" xorm:"'MIDDLEGOODSNAME'"` // 套保商品名称
|
|
|
+ MIDDLEGOODSCODE string `json:"middlgoodscode" xorm:"'MIDDLEGOODSCODE'"` // 套保商品代码
|
|
|
|
|
|
OPENAVGPRICE float64 `json:"openavgprice"` // 开仓均价
|
|
|
CLOSEAVGPRICE float64 `json:"closeavgprice"` // 平仓均价
|
|
|
@@ -2006,13 +2009,17 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReckon(userType int32) string {
|
|
|
" gp.goodsgroupname," +
|
|
|
" g.goodscode," +
|
|
|
" g.goodsname," +
|
|
|
- " g.goodunitid" +
|
|
|
+ " g.goodunitid," +
|
|
|
+ " mg.middlegoodsid," +
|
|
|
+ " mg.middlegoodscode," +
|
|
|
+ " mg.middlegoodsname" +
|
|
|
" from (SELECT t.RECKONDATE," +
|
|
|
" t.GOODSID," +
|
|
|
" t.BUYORSELL," +
|
|
|
" t.CURRENCYID," +
|
|
|
" t.%v USERID," +
|
|
|
" t.GOODSGROUPID," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" sum(t.ORIHOLDQTY) ORIHOLDQTY," +
|
|
|
" sum(t.ORIOPENAMOUNT) ORIOPENAMOUNT," +
|
|
|
" sum(t.ORIHOLDAMOUNT) ORIHOLDAMOUNT," +
|
|
|
@@ -2043,11 +2050,14 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReckon(userType int32) string {
|
|
|
" t.BUYORSELL," +
|
|
|
" t.CURRENCYID," +
|
|
|
" t.%v," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" t.GOODSGROUPID) a" +
|
|
|
" left join goodsgroup gp" +
|
|
|
" on a.goodsgroupid = gp.goodsgroupid" +
|
|
|
" left join goods g" +
|
|
|
- " on a.goodsid = g.goodsid"
|
|
|
+ " on a.goodsid = g.goodsid" +
|
|
|
+ " left join erms_middlegoods mg on a.middlegoodsid=mg.middlegoodsid"
|
|
|
+
|
|
|
userId := "USERID"
|
|
|
var sqlParam utils.SQLVal
|
|
|
if userType == 2 {
|
|
|
@@ -2073,7 +2083,10 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReckonDetail(userType int32) string {
|
|
|
" g.goodscode," +
|
|
|
" g.goodsname," +
|
|
|
" g.goodunitid," +
|
|
|
- " ta.accountname" +
|
|
|
+ " ta.accountname," +
|
|
|
+ " mg.middlegoodsid," +
|
|
|
+ " mg.middlegoodscode," +
|
|
|
+ " mg.middlegoodsname" +
|
|
|
" from (SELECT t.reckondate," +
|
|
|
" t.GOODSID," +
|
|
|
" t.BUYORSELL," +
|
|
|
@@ -2081,6 +2094,7 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReckonDetail(userType int32) string {
|
|
|
" t.%v USERID," +
|
|
|
" t.accountid," +
|
|
|
" t.GOODSGROUPID," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" sum(t.ORIHOLDQTY) ORIHOLDQTY," +
|
|
|
" sum(t.ORIOPENAMOUNT) ORIOPENAMOUNT," +
|
|
|
" sum(t.ORIHOLDAMOUNT) ORIHOLDAMOUNT," +
|
|
|
@@ -2112,12 +2126,15 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReckonDetail(userType int32) string {
|
|
|
" t.CURRENCYID," +
|
|
|
" t.%v," +
|
|
|
" t.accountid," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" t.GOODSGROUPID) a" +
|
|
|
" left join goodsgroup gp" +
|
|
|
" on a.goodsgroupid = gp.goodsgroupid" +
|
|
|
" left join goods g" +
|
|
|
" on a.goodsid = g.goodsid" +
|
|
|
- " left join taaccount ta on a.accountid = ta.accountid"
|
|
|
+ " left join taaccount ta on a.accountid = ta.accountid" +
|
|
|
+ " left join erms_middlegoods mg on a.middlegoodsid=mg.middlegoodsid"
|
|
|
+
|
|
|
userId := "USERID"
|
|
|
var sqlParam utils.SQLVal
|
|
|
if userType == 2 {
|
|
|
@@ -2147,7 +2164,10 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReport(userType int32) string {
|
|
|
" gp.goodsgroupname," +
|
|
|
" g.goodscode," +
|
|
|
" g.goodsname," +
|
|
|
- " g.goodunitid" +
|
|
|
+ " g.goodunitid," +
|
|
|
+ " mg.middlegoodsid," +
|
|
|
+ " mg.middlegoodscode," +
|
|
|
+ " mg.middlegoodsname" +
|
|
|
" from (SELECT t.cycletype," +
|
|
|
" t.cycletime," +
|
|
|
" t.GOODSID," +
|
|
|
@@ -2155,6 +2175,7 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReport(userType int32) string {
|
|
|
" t.CURRENCYID," +
|
|
|
" t.%v USERID," +
|
|
|
" t.GOODSGROUPID," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" sum(t.ORIHOLDQTY) ORIHOLDQTY," +
|
|
|
" sum(t.ORIOPENAMOUNT) ORIOPENAMOUNT," +
|
|
|
" sum(t.ORIHOLDAMOUNT) ORIHOLDAMOUNT," +
|
|
|
@@ -2186,11 +2207,14 @@ func (r *Ermcp3TaFutuReDataReport) buildSqlReport(userType int32) string {
|
|
|
" t.BUYORSELL," +
|
|
|
" t.CURRENCYID," +
|
|
|
" t.%v," +
|
|
|
+ " t.middlegoodsid," +
|
|
|
" t.GOODSGROUPID) a" +
|
|
|
" left join goodsgroup gp" +
|
|
|
" on a.goodsgroupid = gp.goodsgroupid" +
|
|
|
" left join goods g" +
|
|
|
- " on a.goodsid = g.goodsid"
|
|
|
+ " on a.goodsid = g.goodsid" +
|
|
|
+ " left join erms_middlegoods mg on a.middlegoodsid=mg.middlegoodsid"
|
|
|
+
|
|
|
userId := "USERID"
|
|
|
var sqlParam utils.SQLVal
|
|
|
if userType == 2 {
|