1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- package data_manage
- import (
- "eta_gn/eta_api/global"
- "fmt"
- )
- type Sci99Data struct {
- InputValue string `orm:"column(DATA_VALUE)" description:"日期"`
- DataTime string `orm:"column(DATA_DATE)" description:"值"`
- }
- func GetEdbDataSci99MaxOrMinDate(edbCode string) (minDate, maxDate string, err error) {
- sql := ` SELECT MIN(data_time) AS minDate,MAX(data_time) AS maxDate FROM edb_data_sci99 WHERE edb_code=? `
- var tmpDate SmmMaxOrMinDate
- err = global.DmSQL["data"].Raw(sql, edbCode).Scan(&tmpDate).Error
- if err != nil {
- return
- }
- minDate = tmpDate.MinDate
- maxDate = tmpDate.MaxDate
- return
- }
- type BaseFromSci99IndexItem struct {
- BaseFromSciIndexId int `orm:"column(base_from_sci99_index_id);pk" gorm:"primaryKey" `
- IndexCode string
- IndexName string
- ClassifyId int
- Unit string
- Frequency string
- Describe string
- CreateTime string
- ModifyTime string
- }
- func GetBaseInfoFromSci99ByIndexCode(indexCode string) (item *BaseFromSci99IndexItem, err error) {
- sql := `SELECT * FROM base_from_sci99_index WHERE index_code=? `
- sql = fmt.Sprintf(sql)
- err = global.DmSQL["data"].Raw(sql, indexCode).First(&item).Error
- return
- }
|