123456789101112131415161718192021 |
- package data_manage
- import (
- "github.com/beego/beego/v2/client/orm"
- )
- // GetEdbDataMysteelChemicalMaxOrMinDate 根据上海钢联指标code获取最大、最小日期
- func GetEdbDataMysteelChemicalMaxOrMinDate(edbCode string) (minDate, maxDate string, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT MIN(data_time) AS minDate,MAX(data_time) AS maxDate FROM edb_data_mysteel_chemical WHERE edb_code=? `
- err = o.Raw(sql, edbCode).QueryRow(&minDate, &maxDate)
- return
- }
- // 更新上海钢联指标的刷新状态
- func UpdateMysteelChemicalRefreshStatus(edbCode string, isStop int) (err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` UPDATE base_from_mysteel_chemical_index SET is_stop = ? WHERE index_code =? and is_stop=1`
- _, err = o.Raw(sql, isStop, edbCode).Exec()
- return
- }
|