report_chapter_ticker.go 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package models
  2. import (
  3. "eta_gn/eta_api/global"
  4. "time"
  5. )
  6. type ReportChapterTicker struct {
  7. Id int `gorm:"column:id;primaryKey"` //`orm:"column(id);pk" gorm:"primaryKey" description:"主键ID"`
  8. ReportChapterId int `gorm:"column:report_chapter_id"` //`description:"报告章节ID"`
  9. Sort int `gorm:"column:sort"` //`description:"排序"`
  10. Ticker string `gorm:"column:ticker"` //`description:"ticker"`
  11. CreateTime time.Time `gorm:"column:create_time"` //`description:"创建时间"`
  12. UpdateTime time.Time `gorm:"column:update_time"` //`description:"更新时间"`
  13. }
  14. // 新增章节ticker
  15. func InsertChapterTicker(tickerInfo *ReportChapterTicker) (lastId int64, err error) {
  16. err = global.DmSQL["rddp"].Create(tickerInfo).Error
  17. lastId = int64(tickerInfo.Id)
  18. return
  19. }
  20. // ClearReportChapterTicker 清空章节ticker
  21. func ClearReportChapterTicker(reportChapterId int) (err error) {
  22. sql := ` DELETE FROM report_chapter_ticker WHERE report_chapter_id = ? `
  23. err = global.DmSQL["rddp"].Exec(sql, reportChapterId).Error
  24. return
  25. }
  26. // DailyBaseColumn 基础列
  27. type DailyBaseColumn struct {
  28. BaseColumnId int `gorm:"column:base_column_id"` //`orm:"column(base_column_id)" description:"主键ID"`
  29. TableName string `gorm:"column:table_name"` //`description:"表名"`
  30. BaseColumnName string `gorm:"column:base_column_name"` // `description:"列名称"`
  31. BaseColumnChapterType string `gorm:"column:base_column_chapter_type"` // `description:"列类型"`
  32. BaseColumnTicker string `gorm:"column:base_column_ticker"` // `description:"指标"`
  33. Enabled int `gorm:"column:enabled"` // `description:"状态"`
  34. CreatedTime time.Time `gorm:"column:created_time"` //`description:"创建时间"`
  35. LastUpdatedTime time.Time `gorm:"column:last_updated_time"` //`description:"更新时间"`
  36. Freq string `gorm:"column:freq"` //`description:"频率 D-日度 W-周度 M-月度"`
  37. Catalog string `gorm:"column:catalog"` //`description:"分类名称"`
  38. ReportChapterTypeId int `gorm:"column:report_chapter_type_id"` //`description:"分类ID"`
  39. Selected int `gorm:"column:selected"` //`description:"选中状态 0-未选中 1-已选中"`
  40. }