excel_chart_data.go 925 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package excel
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type ExcelChartData struct {
  7. ExcelChartDataId int `orm:"column(excel_chart_data_id);pk"`
  8. ExcelInfoId int `description:"表格id"`
  9. ExcelChartEdbId int `description:"指标ID"`
  10. DataTime string
  11. Value float64
  12. ModifyTime time.Time `description:"修改时间"`
  13. CreateTime time.Time `description:"创建时间"`
  14. DataTimestamp int64
  15. }
  16. func (e *ExcelChartData) TableName() string {
  17. return "excel_chart_data"
  18. }
  19. // 新增
  20. func (e *ExcelChartData) Add() (err error) {
  21. o := orm.NewOrmUsingDB("data")
  22. _, err = o.Insert(e)
  23. return
  24. }
  25. // 修改
  26. func (e *ExcelChartData) Update(cols []string) (err error) {
  27. o := orm.NewOrmUsingDB("data")
  28. _, err = o.Update(e, cols...)
  29. return
  30. }
  31. // 删除
  32. func (e *ExcelChartData) Delete() (err error) {
  33. o := orm.NewOrmUsingDB("data")
  34. _, err = o.Delete(e)
  35. return
  36. }
  37. // 查询