package residual_analysis_model import ( "github.com/beego/beego/v2/client/orm" "time" ) type edbDataResidualAnalysis struct { EdbDataId int `orm:"column(edb_data_id);pk;auto" description:"自增id"` EdbInfoId int `orm:"column(edb_info_id)" description:"指标id"` EdbCode string `orm:"column(edb_code)" description:"指标编码"` DataTime string `orm:"column(data_time)" description:"数据日期"` Value float64 `orm:"column(value)" description:"数据值"` CreateTime time.Time `orm:"column(create_time)" description:"创建时间"` ModifyTime time.Time `orm:"column(modify_time)" description:"修改时间"` DataTimeStamp int64 `orm:"column(data_timestamp)"` } func init() { orm.RegisterModel(new(edbDataResidualAnalysis)) } // DeleteResidualAnalysisDataByEdbCode 根据指标编码删除数据 func DeleteResidualAnalysisDataByEdbCode(edbCode string) error { o := orm.NewOrmUsingDB("data") sql := `delete from edb_data_residual_analysis where edb_code = ?` _, err := o.Raw(sql, edbCode).Exec() return err } // AddResidualAnalysisData 新增指标数据 func AddResidualAnalysisData(dataList []edbDataResidualAnalysis) (num int64, err error) { o := orm.NewOrmUsingDB("data") num, err = o.InsertMulti(len(dataList), dataList) if err != nil { return 0, err } return num, nil }