package data_manage import ( "github.com/beego/beego/v2/client/orm" "time" ) type EdbInfoUpdateLog struct { Id int `orm:"column(id);pk"` EdbInfoId int `description:"指标id"` SourceName string `description:"来源名称"` Source int `description:"来源id"` EdbCode string `description:"指标编码"` EdbName string `description:"指标名称"` EdbNameSource string `description:"指标名称来源"` Frequency string `description:"频率"` Unit string `description:"单位"` StartDate string `description:"起始日期"` EndDate string `description:"终止日期"` ClassifyId int `description:"分类id"` SysUserId int `description:"创建人"` SysUserRealName string `description:"创建人名称"` UpdateSysUserId int `description:"变更人"` UpdateSysUserRealName string `description:"变更人名称"` EdbModifyTime string `description:"指标修改时间"` UniqueCode string `description:"唯一编码"` LatestDate string `description:"数据最新日期"` LatestValue float64 `description:"数据最新值"` TerminalCode string `gorm:"column:terminal_code;default:'';comment:'终端编码,用于配置在机器上'"` CreateTime time.Time `gorm:"column:create_time;default:null;comment:'创建时间,即指标刷新/更新操作时间点'"` DataUpdateTime time.Time `gorm:"column:data_update_time;default:null;comment:'最近一次数据发生变化的时间'"` ErDataUpdateDate time.Time `gorm:"column:er_data_update_date;default:null;comment:'本次更新,数据发生变化的最早日期'"` UpdateResult int32 `gorm:"column:update_result;default:null;comment:'本次刷新操作结果:1成功,2失败'"` UpdateFailedReason string `gorm:"column:update_failed_reason;default:null;comment:'刷新失败原因'"` DataUpdateResult int32 `gorm:"column:data_update_result;not null;default:0;comment:'数据更新结果:1成功,2失败'"` DataUpdateFailedReason string `description:"数据未正常更新原因"` IsSourceRefresh int `description:"终端刷新到数据源的刷新操作:0否,1是"` UpdateType int `description:"变更类型,0:数据明细变更,1:基础信息变更, 2:新增指标"` } func GetEdbInfoUpdateLogByCondition(condition string, pars []interface{}) (item []*EdbInfoUpdateLog, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT * FROM edb_info_update_log WHERE 1=1 ` if condition != "" { sql += condition } sql += `ORDER BY id ASC limit 0,10 ` _, err = o.Raw(sql, pars).QueryRows(&item) return }