entity.go 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package multiple_graph_config_chart_mapping
  2. import (
  3. "time"
  4. )
  5. // MultipleGraphConfigChartMapping 图表与多图配置的关系表
  6. type MultipleGraphConfigChartMapping struct {
  7. ID uint32 `gorm:"primaryKey;column:id;type:int(9) unsigned;not null" json:"-"`
  8. MultipleGraphConfigID int `gorm:"uniqueIndex:idx_confid_source;column:multiple_graph_config_id;type:int(9);default:null;default:0" json:"multipleGraphConfigId"` // 多图配置id
  9. ChartInfoID int `gorm:"unique;column:chart_info_id;type:int(9);default:null;default:0" json:"chartInfoId"` // 图表id
  10. Source int8 `gorm:"uniqueIndex:idx_confid_source;column:source;type:tinyint(9);default:null" json:"source"` // 来源,1:曲线图,2:相关性图;3:滚动相关性图1;4:滚动相关性图2;
  11. ModifyTime time.Time `gorm:"column:modify_time;type:timestamp;default:null;default:CURRENT_TIMESTAMP" json:"modifyTime"` // 最后一次修改时间
  12. CreateTime time.Time `gorm:"column:create_time;type:datetime;default:null" json:"createTime"` // 关系建立时间
  13. }
  14. // TableName get sql table name.获取数据库表名
  15. func (m *MultipleGraphConfigChartMapping) TableName() string {
  16. return "multiple_graph_config_chart_mapping"
  17. }
  18. // MultipleGraphConfigChartMappingColumns get sql column name.获取数据库列名
  19. var MultipleGraphConfigChartMappingColumns = struct {
  20. ID string
  21. MultipleGraphConfigID string
  22. ChartInfoID string
  23. Source string
  24. ModifyTime string
  25. CreateTime string
  26. }{
  27. ID: "id",
  28. MultipleGraphConfigID: "multiple_graph_config_id",
  29. ChartInfoID: "chart_info_id",
  30. Source: "source",
  31. ModifyTime: "modify_time",
  32. CreateTime: "create_time",
  33. }