package data_stat import ( "github.com/beego/beego/v2/client/orm" "github.com/rdlucklib/rdluck_tools/paging" ) // EdbInfoDeleteLog 指标删除日志表 type EdbInfoDeleteLog struct { Id uint64 `orm:"column(id);pk"` EdbInfoId int `description:"指标ID"` EdbInfoType int `description:"指标类型,0:普通指标,1:预测指标"` SourceName string `description:"来源名称"` Source int `description:"来源id"` EdbCode string `description:"指标编码"` EdbName string `description:"指标名称"` EdbNameEn string `description:"英文指标名称"` EdbNameSource string `description:"指标名称来源"` Frequency string `description:"频率"` Unit string `description:"单位"` UnitEn string `description:"英文单位"` StartDate string `description:"起始日期"` EndDate string `description:"终止日期"` SysUserId int `description:"创建人ID"` SysUserRealName string `description:"创建人姓名"` UniqueCode string `description:"指标唯一编码"` EdbCreateTime string `description:"指标创建时间"` EdbModifyTime string `description:"指标修改时间"` CreateTime string `description:"创建时间即删除时间"` MinValue float64 `description:"指标最小值"` MaxValue float64 `description:"指标最大值"` CalculateFormula string `description:"计算公式"` EdbType int `description:"指标类型:1:基础指标,2:计算指标"` LatestDate string `description:"数据最新日期"` LatestValue float64 `description:"数据最新值"` MoveType int `description:"移动方式:1:领先(默认),2:滞后"` MoveFrequency string `description:"移动频度"` NoUpdate int8 `description:"是否停止更新,0:继续更新;1:停止更新"` ChartImage string `description:"图表图片"` Calendar string `description:"公历/农历" orm:"default(公历);"` DataDateType string `orm:"column(data_date_type);size(255);null;default(交易日)"` ManualSave int `description:"是否有手动保存过上下限: 0-否; 1-是"` TerminalCode string `description:"终端编码,用于配置在机器上"` DelSysUserId int `description:"删除人ID"` DelSysUserRealName string `description:"删除人姓名"` DataUpdateTime string `description:"最近一次数据发生变化的时间"` ErDataUpdateDate string `description:"本次更新,数据发生变化的最早日期"` } type EdbInfoDeleteLogItem struct { Id uint64 `orm:"column(id);"` EdbInfoId int `description:"指标ID"` EdbInfoType int `description:"指标类型,0:普通指标,1:预测指标"` SourceName string `description:"来源名称"` Source int `description:"来源id"` EdbCode string `description:"指标编码"` EdbName string `description:"指标名称"` EdbNameEn string `description:"英文指标名称"` EdbNameSource string `description:"指标名称来源"` Frequency string `description:"频率"` Unit string `description:"单位"` StartDate string `description:"起始日期"` EndDate string `description:"终止日期"` SysUserId int `description:"创建人ID"` SysUserRealName string `description:"创建人姓名"` EdbCreateTime string `description:"指标创建时间"` CreateTime string `description:"创建时间即删除时间"` LatestDate string `description:"数据最新日期"` LatestValue float64 `description:"数据最新值"` TerminalCode string `description:"终端编码,用于配置在机器上"` DelSysUserId int `description:"删除人ID"` DelSysUserRealName string `description:"删除人姓名"` DataUpdateTime string `description:"最近一次数据发生变化的时间"` ErDataUpdateDate string `description:"本次更新,数据发生变化的最早日期"` } func AddEdbDeleteLog(item *EdbInfoDeleteLog) (lastId int64, err error) { o := orm.NewOrmUsingDB("data") lastId, err = o.Insert(item) return } type GetEdbDeleteLogResp struct { List []*EdbInfoDeleteLogItem Paging *paging.PagingItem } func GetEdbDeleteLogByCondition(condition string, pars []interface{}, orderStr string, pageSize, startSize int) (item []*EdbInfoDeleteLog, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT * FROM edb_info_delete_log WHERE 1=1 ` if condition != "" { sql += condition } if orderStr != "" { sql += orderStr } else { sql += ` ORDER BY create_time DESC, id DESC ` } sql += ` LIMIT ?,? ` _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&item) return } // GetEdbDeleteLogCount func GetEdbDeleteLogCount(condition string, pars []interface{}) (count int, err error) { o := orm.NewOrmUsingDB("data") sql := ` SELECT count(*) FROM edb_info_delete_log WHERE 1=1 ` if condition != "" { sql += condition } err = o.Raw(sql, pars).QueryRow(&count) return }