123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- package models
- import (
- "eta_gn/eta_chart_lib/global"
- "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
- // }
- type TableInfo struct {
- TableInfoId int `gorm:"column:table_info_id;primaryKey" description:"表格ID" orm:"column(table_info_id);pk"`
- TableName string `gorm:"column:table_name" description:"表格名称"`
- UniqueCode string `gorm:"column:unique_code" description:"表格唯一编码"`
- TableClassifyId int `gorm:"column:table_classify_id" description:"表格分类ID"`
- SysUserId int `gorm:"column:sys_user_id" description:"操作人ID"`
- SysUserRealName string `gorm:"column:sys_user_real_name" description:"操作人真实姓名"`
- StartDate time.Time `gorm:"column:start_date" description:"开始日期"`
- EdbInfoIds string `gorm:"column:edb_info_ids" description:"指标ID"`
- TableType int `gorm:"column:table_type" description:"表格类型,1:指标+日期"`
- TableImage string `gorm:"column:table_image" description:"表格图片"`
- Sort int `gorm:"column:sort" description:"排序字段,数字越小越排前面"`
- EdbEndDate time.Time `gorm:"column:edb_end_date" description:"指标最后更新日期"`
- ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
- CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
- }
- // GetTableInfoByUniqueCode 根据union_code 获取表格信息
- func GetTableInfoByUniqueCode(uniqueCode string) (item *TableInfo, err error) {
- o := global.DmSQL["data"]
- sql := ` SELECT * FROM table_info WHERE unique_code=? `
- err = o.Raw(sql, uniqueCode).First(&item).Error
- return
- }
- // 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
- }
|