table.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type TableInfo struct {
  7. TableInfoId int `orm:"column(table_info_id);pk"`
  8. TableName string `description:"表格名称"`
  9. UniqueCode string `description:"表格唯一编码"`
  10. TableClassifyId int `description:"表格分类id"`
  11. SysUserId int `description:"操作人id"`
  12. SysUserRealName string `description:"操作人真实姓名"`
  13. StartDate time.Time `description:"开始日期"`
  14. EdbInfoIds string `description:"指标id"`
  15. TableType int `description:"表格类型,1:指标+日期"`
  16. TableImage string `description:"图表图片"`
  17. Sort int `description:"排序字段,数字越小越排前面"`
  18. EdbEndDate time.Time `description:"指标最后更新日期"`
  19. ModifyTime time.Time
  20. CreateTime time.Time
  21. }
  22. // GetTableInfoByUniqueCode 根据union_code 获取表格信息
  23. func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) {
  24. o := orm.NewOrmUsingDB("data")
  25. sql := ` SELECT * FROM table_info WHERE unique_code=? `
  26. err = o.Raw(sql, uniqueCode).QueryRow(&item)
  27. return
  28. }
  29. // TableInfoDetailResp 表格详情返回
  30. type TableInfoDetailResp struct {
  31. TableInfo *TableInfo
  32. TableDataList []*TableData
  33. }