|
|
@@ -12,6 +12,7 @@ import (
|
|
|
"mtp2_if/db"
|
|
|
"mtp2_if/logger"
|
|
|
"mtp2_if/mtpcache"
|
|
|
+ "mtp2_if/utils"
|
|
|
)
|
|
|
|
|
|
// ErmcpSpotContractModel 现货合同结构(对应现货合同菜单)
|
|
|
@@ -351,3 +352,47 @@ func (r *ErmcpModel) GetData(contractType, nQueryType int32) ([]ErmcpModel, erro
|
|
|
}
|
|
|
return sData, nil
|
|
|
}
|
|
|
+
|
|
|
+// ErmcpTradeConfigTMP 交易模板配置
|
|
|
+type ErmcpTradeConfigTMP struct {
|
|
|
+ TRADECONFIGTMPID int64 `json:"tradeconfigtmpid" xorm:"'TRADECONFIGTMPID'"` // 交易配置模板ID(SEQ_TRADECONFIGTMP)
|
|
|
+ TRADECONFIGTMPTYPE int32 `json:"tradeconfigtmptype" xorm:"'TRADECONFIGTMPTYPE'"` // 交易配置模板类型 - 1:保证金 2:手续费 3:汇率
|
|
|
+ TRADECONFIGTMPNAME string `json:"tradeconfigtmpname" xorm:"'TRADECONFIGTMPNAME'"` // 交易配置模板名称
|
|
|
+ REMARK string `json:"remark" xorm:"'REMARK'"` // 备注
|
|
|
+ UPDATETIME string `json:"updatetime" xorm:"'UPDATETIME'"` // 更新时间
|
|
|
+ MODIFIERID int32 `json:"modifierid" xorm:"'MODIFIERID'"` // 修改人
|
|
|
+ AREAUSERID int64 `json:"areauserid" xorm:"'AREAUSERID'"` // 所属机构
|
|
|
+ BASICCURRENCYID int64 `json:"basiccurrencyid" xorm:"'BASICCURRENCYID'"` // 基本币种ID[汇率] - 目标币种
|
|
|
+ MAINACCOUNTID int64 `json:"mainaccountid" xorm:"'MAINACCOUNTID'"` // 主账户ID
|
|
|
+}
|
|
|
+
|
|
|
+func (r *ErmcpTradeConfigTMP) calc() {
|
|
|
+}
|
|
|
+
|
|
|
+func (r *ErmcpTradeConfigTMP) buildSql() string {
|
|
|
+ var sqlId utils.SQLVal = "select t.areauserid," +
|
|
|
+ " t.tradeconfigtmpid," +
|
|
|
+ " t.tradeconfigtmptype," +
|
|
|
+ " t.tradeconfigtmpname," +
|
|
|
+ " t.basiccurrencyid," +
|
|
|
+ " t.mainaccountid," +
|
|
|
+ " t.modifierid," +
|
|
|
+ " t.remark," +
|
|
|
+ " to_char(t.updatetime, 'yyyy-mm-dd hh24:mi:ss') updatetime" +
|
|
|
+ " from TRADECONFIGTMP t" +
|
|
|
+ " where 1=1"
|
|
|
+ if r.AREAUSERID > 0 {
|
|
|
+ sqlId.And("t.AREAUSERID", r.AREAUSERID)
|
|
|
+ }
|
|
|
+ return sqlId.String()
|
|
|
+}
|
|
|
+
|
|
|
+// GetDataEx 获取交易配置模板
|
|
|
+func (r *ErmcpTradeConfigTMP) GetDataEx() (interface{}, error) {
|
|
|
+ sData := make([]ErmcpTradeConfigTMP, 0)
|
|
|
+ err := db.GetEngine().SQL(r.buildSql()).Find(&sData)
|
|
|
+ for i := range sData {
|
|
|
+ sData[i].calc()
|
|
|
+ }
|
|
|
+ return sData, err
|
|
|
+}
|