table.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package models
  2. import (
  3. "eta_gn/eta_chart_lib/global"
  4. "time"
  5. )
  6. type TableInfo struct {
  7. TableInfoId int `gorm:"column:table_info_id;primaryKey" description:"表格ID" orm:"column(table_info_id);pk"`
  8. TableName string `gorm:"column:table_name" description:"表格名称"`
  9. UniqueCode string `gorm:"column:unique_code" description:"表格唯一编码"`
  10. TableClassifyId int `gorm:"column:table_classify_id" description:"表格分类ID"`
  11. SysUserId int `gorm:"column:sys_user_id" description:"操作人ID"`
  12. SysUserRealName string `gorm:"column:sys_user_real_name" description:"操作人真实姓名"`
  13. StartDate time.Time `gorm:"column:start_date" description:"开始日期"`
  14. EdbInfoIds string `gorm:"column:edb_info_ids" description:"指标ID"`
  15. TableType int `gorm:"column:table_type" description:"表格类型,1:指标+日期"`
  16. TableImage string `gorm:"column:table_image" description:"表格图片"`
  17. Sort int `gorm:"column:sort" description:"排序字段,数字越小越排前面"`
  18. EdbEndDate time.Time `gorm:"column:edb_end_date" description:"指标最后更新日期"`
  19. ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
  20. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  21. }
  22. func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) {
  23. o := global.DmSQL["data"]
  24. sql := ` SELECT * FROM table_info WHERE unique_code=? `
  25. err = o.Raw(sql, uniqueCode).First(&item).Error
  26. return
  27. }
  28. type TableInfoDetailResp struct {
  29. TableInfo *TableInfo
  30. TableDataList []*TableData
  31. }