1234567891011121314151617181920212223242526272829 |
- package data_manage
- import (
- "eta_gn/eta_task/global"
- "time"
- )
- // EdbDataCalculateZjpj 直接拼接数据结构体
- type EdbDataCalculateZjpj struct {
- EdbDataId int `gorm:"column:edb_data_id;primaryKey"` //`orm:"column(edb_data_id);pk"`
- EdbInfoId int
- EdbCode string
- DataTime string
- Value float64
- Status int
- CreateTime time.Time
- ModifyTime time.Time
- DataTimestamp int64
- }
- // GetAllEdbDataCalculateZjpjByEdbInfoId 根据指标id获取全部的数据
- func GetAllEdbDataCalculateZjpjByEdbInfoId(edbInfoId int) (items []*EdbDataCalculateZjpj, err error) {
- //o := orm.NewOrm()
- sql := ` SELECT * FROM edb_data_calculate_zjpj WHERE edb_info_id=? ORDER BY data_time DESC `
- //_, err = o.Raw(sql, edbInfoId).QueryRows(&items)
- err = global.DEFAULT_DmSQL.Raw(sql, edbInfoId).Find(&items).Error
- return
- }
|