edb_data_base.go 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. package models
  2. import (
  3. "hongze/hongze_edb_lib/utils"
  4. "time"
  5. )
  6. //指标检索数据
  7. type EdbDataItem struct {
  8. EdbCode string `description:"指标编码"`
  9. StartDate string `description:"起始日期"`
  10. EndDate string `description:"终止日期"`
  11. EdbName string `description:"指标名称"`
  12. Unit string `description:"单位"`
  13. Frequency string `description:"频率"`
  14. DataList []*EdbData
  15. }
  16. type EdbData struct {
  17. EdbDataId int `orm:"column(edb_data_id);pk"`
  18. EdbInfoId int
  19. EdbCode string
  20. DataTime string
  21. Value string
  22. Status int
  23. CreateTime time.Time
  24. ModifyTime time.Time
  25. DataTimestamp int64
  26. }
  27. func GetAddSql(edbInfoId, edbCode, dataTime, timestampStr string, value string) (addSql string) {
  28. nowStr := time.Now().Format(utils.FormatDateTime)
  29. addSql += "("
  30. addSql += edbInfoId + "," + "'" + edbCode + "'" + "," + "'" + dataTime + "'" + "," + value + "," + "'" + nowStr + "'" +
  31. "," + "'" + nowStr + "'" + "," + "1"
  32. addSql += "," + "'" + timestampStr + "'"
  33. addSql += "),"
  34. return
  35. }
  36. type AddEdbInfoReq struct {
  37. EdbCode string `description:"指标编码"`
  38. }