package predict_edb_conf_calculate_mapping

import (
	"time"
)

// PredictEdbConfCalculateMapping 预测基础指标规则 与 计算预测指标关联关系表
type PredictEdbConfCalculateMapping struct {
	PredictEdbConfCalculateMappingID int       `gorm:"primaryKey;column:predict_edb_conf_calculate_mapping_id;type:int(11);not null" json:"-"`
	EdbInfoID                        uint32    `gorm:"column:edb_info_id;type:int(11) unsigned;default:0" json:"edbInfoId"`                                // 预测指标id
	ConfigID                         int       `gorm:"uniqueIndex:idx_config_from_id;column:config_id;type:int(11);default:0" json:"configId"`             // 指标id
	FromEdbInfoID                    int       `gorm:"uniqueIndex:idx_config_from_id;column:from_edb_info_id;type:int(11);default:0" json:"fromEdbInfoId"` // 来源指标id
	FromEdbCode                      string    `gorm:"column:from_edb_code;type:varchar(50);default:''" json:"fromEdbCode"`                                // 来源指标编码
	FromEdbName                      string    `gorm:"column:from_edb_name;type:varchar(255);default:''" json:"fromEdbName"`                               // 来源指标名称
	FromSource                       int8      `gorm:"column:from_source;type:tinyint(4);default:0" json:"fromSource"`                                     // 来源指标渠道
	FromSourceName                   string    `gorm:"column:from_source_name;type:varchar(100);default:''" json:"fromSourceName"`                         // 来源指标渠道名称
	Sort                             int8      `gorm:"column:sort;type:tinyint(4);default:0" json:"sort"`                                                  // 顺序
	CreateTime                       time.Time `gorm:"column:create_time;type:datetime" json:"createTime"`                                                 // 创建时间
	ModifyTime                       time.Time `gorm:"column:modify_time;type:datetime" json:"modifyTime"`                                                 // 修改时间
	FromTag                          string    `gorm:"column:from_tag;type:varchar(10);default:''" json:"fromTag"`                                         // 标签
}

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

// PredictEdbConfCalculateMappingColumns get sql column name.获取数据库列名
var PredictEdbConfCalculateMappingColumns = struct {
	PredictEdbConfCalculateMappingID string
	EdbInfoID                        string
	ConfigID                         string
	FromEdbInfoID                    string
	FromEdbCode                      string
	FromEdbName                      string
	FromSource                       string
	FromSourceName                   string
	Sort                             string
	CreateTime                       string
	ModifyTime                       string
	FromTag                          string
}{
	PredictEdbConfCalculateMappingID: "predict_edb_conf_calculate_mapping_id",
	EdbInfoID:                        "edb_info_id",
	ConfigID:                         "config_id",
	FromEdbInfoID:                    "from_edb_info_id",
	FromEdbCode:                      "from_edb_code",
	FromEdbName:                      "from_edb_name",
	FromSource:                       "from_source",
	FromSourceName:                   "from_source_name",
	Sort:                             "sort",
	CreateTime:                       "create_time",
	ModifyTime:                       "modify_time",
	FromTag:                          "from_tag",
}
