package future_good_edb_data

import (
	"time"
)

// FutureGoodEdbData 期货指标的数据
type FutureGoodEdbData struct {
	FutureGoodEdbDataID int       `gorm:"primaryKey;column:future_good_edb_data_id;type:int(9) unsigned;not null" json:"-"`
	FutureGoodEdbInfoID int       `gorm:"index:idx_edbid_date;column:future_good_edb_info_id;type:int(9) unsigned" json:"futureGoodEdbInfoId"` // 期货指标id
	FutureGoodEdbCode   string    `gorm:"index:idx_code_date;column:future_good_edb_code;type:varchar(64)" json:"futureGoodEdbCode"`           // 期货指标code
	DataTime            time.Time `gorm:"index:idx_code_date;index:idx_edbid_date;column:data_time;type:date" json:"dataTime"`                 // 数据日期
	TradeCode           string    `gorm:"column:trade_code;type:varchar(64);default:''" json:"tradeCode"`                                      // 证券代码
	Open                float64   `gorm:"column:open;type:double;not null" json:"open"`                                                        // 开盘价
	High                float64   `gorm:"column:high;type:double" json:"high"`                                                                 // 最高价
	Low                 float64   `gorm:"column:low;type:double" json:"low"`                                                                   // 最低价
	Close               float64   `gorm:"column:close;type:double" json:"close"`                                                               // 收盘价
	Volume              float64   `gorm:"column:volume;type:double" json:"volume"`                                                             // 成交量
	Amt                 float64   `gorm:"column:amt;type:double" json:"amt"`                                                                   // 成交额
	Oi                  float64   `gorm:"column:oi;type:double" json:"oi"`                                                                     // 持仓量
	Settle              float64   `gorm:"column:settle;type:double" json:"settle"`                                                             // 结算价
	DataTimestamp       int64     `gorm:"column:data_timestamp;type:bigint(20)" json:"dataTimestamp"`                                          // 数据日期时间戳
	ModifyTime          time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`                                                  // 数据修改时间
	CreateTime          time.Time `gorm:"column:create_time;type:timestamp" json:"createTime"`                                                 // 数据创建时间
}

// TableName get sql table name.获取数据库表名
func (m *FutureGoodEdbData) TableName() string {
	return "future_good_edb_data"
}

// FutureGoodEdbDataColumns get sql column name.获取数据库列名
var FutureGoodEdbDataColumns = struct {
	FutureGoodEdbDataID string
	FutureGoodEdbInfoID string
	FutureGoodEdbCode   string
	DataTime            string
	TradeCode           string
	Open                string
	High                string
	Low                 string
	Close               string
	Volume              string
	Amt                 string
	Oi                  string
	Settle              string
	DataTimestamp       string
	ModifyTime          string
	CreateTime          string
}{
	FutureGoodEdbDataID: "future_good_edb_data_id",
	FutureGoodEdbInfoID: "future_good_edb_info_id",
	FutureGoodEdbCode:   "future_good_edb_code",
	DataTime:            "data_time",
	TradeCode:           "trade_code",
	Open:                "open",
	High:                "high",
	Low:                 "low",
	Close:               "close",
	Volume:              "volume",
	Amt:                 "amt",
	Oi:                  "oi",
	Settle:              "settle",
	DataTimestamp:       "data_timestamp",
	ModifyTime:          "modify_time",
	CreateTime:          "create_time",
}
