|
@@ -33,7 +33,7 @@ func GetMysteelChemicalDataByCondition(condition string, pars []interface{}) (it
|
|
|
}
|
|
|
sql := `select * from (` + sql1 + ` having 1 order by modify_time DESC ) tmp GROUP BY data_time ORDER BY data_time DESC `
|
|
|
//_, err = o.Raw(sql, pars).QueryRows(&item)
|
|
|
- err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&item).Error
|
|
|
+ err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&item).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -267,6 +267,7 @@ type BaseFromMysteelChemicalIndex struct {
|
|
|
TerminalCode string `gorm:"column:terminal_code" description:"终端编码"`
|
|
|
IsSupplierStop int `gorm:"column:is_supplier_stop" description:"是否供应商停更:1:停更,0:未停更"`
|
|
|
}
|
|
|
+
|
|
|
// tableName
|
|
|
func (m *BaseFromMysteelChemicalIndex) TableName() string {
|
|
|
return "base_from_mysteel_chemical_index"
|
|
@@ -492,23 +493,24 @@ type HandleMysteelIndexResp struct {
|
|
|
}
|
|
|
|
|
|
// 钢联化工指标数据
|
|
|
-//type BaseFromMysteelChemicalData struct {
|
|
|
-// BaseFromMysteelChemicalDataId int64 `orm:"column(base_from_mysteel_chemical_data_id);pk"`
|
|
|
-// BaseFromMysteelChemicalIndexId int64
|
|
|
-// IndexCode string
|
|
|
-// DataTime time.Time
|
|
|
-// Value string
|
|
|
-// UpdateDate string
|
|
|
-// CreateTime time.Time `description:"创建时间"`
|
|
|
-// ModifyTime time.Time `description:"修改时间"`
|
|
|
-//}
|
|
|
+//
|
|
|
+// type BaseFromMysteelChemicalData struct {
|
|
|
+// BaseFromMysteelChemicalDataId int64 `orm:"column(base_from_mysteel_chemical_data_id);pk"`
|
|
|
+// BaseFromMysteelChemicalIndexId int64
|
|
|
+// IndexCode string
|
|
|
+// DataTime time.Time
|
|
|
+// Value string
|
|
|
+// UpdateDate string
|
|
|
+// CreateTime time.Time `description:"创建时间"`
|
|
|
+// ModifyTime time.Time `description:"修改时间"`
|
|
|
+// }
|
|
|
type BaseFromMysteelChemicalData struct {
|
|
|
- BaseFromMysteelChemicalDataId int64 `gorm:"column:base_from_mysteel_chemical_data_id;primaryKey" description:"数据ID"`
|
|
|
- BaseFromMysteelChemicalIndexId int64 `gorm:"column:base_from_mysteel_chemical_index_id" description:"指标ID"`
|
|
|
- IndexCode string `gorm:"column:index_code" description:"指标编码"`
|
|
|
+ BaseFromMysteelChemicalDataId int64 `gorm:"column:base_from_mysteel_chemical_data_id;primaryKey" description:"数据ID"`
|
|
|
+ BaseFromMysteelChemicalIndexId int64 `gorm:"column:base_from_mysteel_chemical_index_id" description:"指标ID"`
|
|
|
+ IndexCode string `gorm:"column:index_code" description:"指标编码"`
|
|
|
DataTime time.Time `gorm:"column:data_time" description:"数据时间"`
|
|
|
- Value string `gorm:"column:value" description:"数据值"`
|
|
|
- UpdateDate string `gorm:"column:update_date" description:"更新日期"`
|
|
|
+ Value string `gorm:"column:value" description:"数据值"`
|
|
|
+ UpdateDate string `gorm:"column:update_date" description:"更新日期"`
|
|
|
CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
|
|
|
ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
|
|
|
}
|
|
@@ -574,7 +576,7 @@ func (m *BaseFromMysteelChemicalIndex) GetIndexCountByFrequency(condition string
|
|
|
sql += condition
|
|
|
}
|
|
|
//err = o.Raw(sql, pars).QueryRow(&total)
|
|
|
- err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&total).Error
|
|
|
+ err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&total).Error
|
|
|
|
|
|
return
|
|
|
}
|
|
@@ -648,23 +650,23 @@ func (m *BaseFromMysteelChemicalIndex) GetIndexByCondition(condition string, par
|
|
|
sql += condition
|
|
|
}
|
|
|
//_, err = o.Raw(sql, pars).QueryRows(&items)
|
|
|
- err = global.DEFAULT_DmSQL.Raw(sql, pars).Scan(&items).Error
|
|
|
+ err = global.DEFAULT_DmSQL.Raw(sql, pars...).Scan(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-//type BaseFromMysteelChemicalRecord struct {
|
|
|
-// BaseFromMysteelChemicalRecordId int64 `orm:"column(base_from_mysteel_chemical_record_id);pk"`
|
|
|
-// BaseFromMysteelChemicalIndexId int64
|
|
|
-// OldIndexName string `description:"原始名称"`
|
|
|
-// NewIndexName string `description:"新的名称"`
|
|
|
-// CreateTime time.Time `description:"记录创建时间"`
|
|
|
-// Timestamp int64 `description:"记录创建时间戳"`
|
|
|
-//}
|
|
|
+// type BaseFromMysteelChemicalRecord struct {
|
|
|
+// BaseFromMysteelChemicalRecordId int64 `orm:"column(base_from_mysteel_chemical_record_id);pk"`
|
|
|
+// BaseFromMysteelChemicalIndexId int64
|
|
|
+// OldIndexName string `description:"原始名称"`
|
|
|
+// NewIndexName string `description:"新的名称"`
|
|
|
+// CreateTime time.Time `description:"记录创建时间"`
|
|
|
+// Timestamp int64 `description:"记录创建时间戳"`
|
|
|
+// }
|
|
|
type BaseFromMysteelChemicalRecord struct {
|
|
|
- BaseFromMysteelChemicalRecordId int64 `gorm:"column:base_from_mysteel_chemical_record_id;primaryKey" description:"记录ID"`
|
|
|
- BaseFromMysteelChemicalIndexId int64 `gorm:"column:base_from_mysteel_chemical_index_id" description:"指标ID"`
|
|
|
- OldIndexName string `gorm:"column:old_index_name" description:"原始名称"`
|
|
|
- NewIndexName string `gorm:"column:new_index_name" description:"新的名称"`
|
|
|
+ BaseFromMysteelChemicalRecordId int64 `gorm:"column:base_from_mysteel_chemical_record_id;primaryKey" description:"记录ID"`
|
|
|
+ BaseFromMysteelChemicalIndexId int64 `gorm:"column:base_from_mysteel_chemical_index_id" description:"指标ID"`
|
|
|
+ OldIndexName string `gorm:"column:old_index_name" description:"原始名称"`
|
|
|
+ NewIndexName string `gorm:"column:new_index_name" description:"新的名称"`
|
|
|
CreateTime time.Time `gorm:"column:create_time" description:"记录创建时间"`
|
|
|
Timestamp int64 `gorm:"column:timestamp" description:"记录创建时间戳"`
|
|
|
}
|