12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- package data_manage
- //type EdbDataPb struct {
- // EdbDataId int `orm:"column(edb_data_id);pk" gorm:"primaryKey"`
- // EdbInfoId int
- // EdbCode string
- // DataTime string
- // Value float64
- // Status int
- // CreateTime time.Time
- // ModifyTime time.Time
- // Ticker string
- // Field string
- // DataTimestamp int64
- //}
- //func AddEdbDataPb(items []*EdbDataPb) (err error) {
- // o := global.DbMap[utils.DbNameIndex]
- // err = o.CreateInBatches(items, utils.MultiAddNum).Error
- // return
- //}
- //func ModifyEdbDataPb(edbInfoId int64, edbCode, dataTime string, value float64) (err error) {
- // o := global.DbMap[utils.DbNameIndex]
- // sql := ` UPDATE edb_data_pb SET edb_info_id=?,value=?,status=1,modify_time=NOW() WHERE edb_code=? AND data_time=? `
- // err = o.Exec(sql, edbInfoId, value, edbCode, dataTime).Error
- // return
- //}
- //func ModifyEdbDataPbStatus(edbInfoId int64, edbCode string) (err error) {
- // o := global.DbMap[utils.DbNameIndex]
- // sql := ` UPDATE edb_data_pb SET edb_info_id=?, status=1,modify_time=NOW() WHERE edb_code=? `
- // err = o.Exec(sql, edbInfoId, edbCode).Error
- // return
- //}
- //func GetEdbDataPbCount(edbCode, dataTime string) (count int, err error) {
- // o := global.DbMap[utils.DbNameIndex]
- // sql := ` SELECT COUNT(1) AS count FROM edb_data_pb WHERE edb_code=? AND data_time=? `
- // err = o.Raw(sql, edbCode, dataTime).Scan(&count).Error
- // return
- //}
- //func GetEdbDataPbMaxOrMinDate(edbInfoId int) (min_date, max_date string, err error) {
- // o := global.DbMap[utils.DbNameIndex]
- // sql := ` SELECT MIN(data_time) AS min_date,MAX(data_time) AS max_date FROM edb_data_pb WHERE edb_info_id=? `
- // err = o.Raw(sql, edbInfoId).Row().Scan(&min_date, &max_date)
- // return
- //}
|