package models import ( "github.com/beego/beego/v2/client/orm" "time" ) type TableInfo struct { TableInfoId int `orm:"column(table_info_id);pk"` TableName string `description:"表格名称"` UniqueCode string `description:"表格唯一编码"` TableClassifyId int `description:"表格分类id"` SysUserId int `description:"操作人id"` SysUserRealName string `description:"操作人真实姓名"` StartDate time.Time `description:"开始日期"` EdbInfoIds string `description:"指标id"` TableType int `description:"表格类型,1:指标+日期"` TableImage string `description:"图表图片"` Sort int `description:"排序字段,数字越小越排前面"` EdbEndDate time.Time `description:"指标最后更新日期"` ModifyTime time.Time CreateTime time.Time } // GetTableInfoByUniqueCode 根据union_code 获取表格信息 func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT * FROM table_info WHERE unique_code=? ` err = o.Raw(sql, uniqueCode).QueryRow(&item) return } // TableInfoDetailResp 表格详情返回 type TableInfoDetailResp struct { TableInfo *TableInfo TableDataList []*TableData }