123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585 |
- package models
- import (
- "errors"
- "eta/eta_data_init/utils"
- "fmt"
- "github.com/beego/beego/v2/client/orm"
- "strings"
- "time"
- )
- type EdbClassifyItem struct {
- ClassifyID int64 `orm:"column(classify_id);pk"`
- ClassifyType uint32
- ClassifyName string
- ParentID int64
- HasData int32
- CreateTime time.Time
- ModifyTime time.Time
- SysUserID int64
- SysUserRealName string
- Level int64
- UniqueCode string
- Sort uint32
- RootID int64
- LastModifyUserID uint32
- LastModifyUserName string
- }
- // GetAllEdbClassifyListByCondition
- // @Description: 获取分类列表
- // @author: Roc
- // @datetime 2024-02-29 10:55:38
- // @param condition string
- // @param pars []interface{}
- // @return item []*EdbInfoUpdateLog
- // @return err error
- func GetAllEdbClassifyListByCondition(condition string, pars []interface{}) (item []*EdbClassifyItem, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT * FROM edb_classify WHERE 1=1 `
- if condition != "" {
- sql += condition
- }
- sql += ` ORDER BY classify_id ASC `
- _, err = o.Raw(sql, pars).QueryRows(&item)
- return
- }
- type EdbInfoItem struct {
- CalculateFormula string `json:"calculate_formula"`
- Calendar string `json:"calendar"`
- ChartImage string `json:"chart_image"`
- ClassifyId int `json:"classify_id"`
- CreateTime string `json:"create_time"`
- DataDateType string `json:"data_date_type"`
- DataUpdateTime string `json:"data_update_time"`
- EdbCode string `json:"edb_code"`
- EdbInfoId int `json:"edb_info_id"`
- EdbInfoType int `json:"edb_info_type"`
- EdbName string `json:"edb_name"`
- EdbNameEn string `json:"edb_name_en"`
- EdbNameSource string `json:"edb_name_source"`
- EdbType int `json:"edb_type"`
- EmptyType int `json:"empty_type"`
- EndDate string `json:"end_date"`
- EndValue float64 `json:"end_value"`
- ErDataUpdateDate string `json:"er_data_update_date"`
- Extra string `json:"extra"`
- Frequency string `json:"frequency"`
- IndicatorCode string `json:"indicator_code"`
- IsUpdate int `json:"is_update"`
- LatestDate string `json:"latest_date"`
- LatestValue float64 `json:"latest_value"`
- ManualSave int `json:"manual_save"`
- MaxEmptyType int `json:"max_empty_type"`
- MaxValue float64 `json:"max_value"`
- MinValue float64 `json:"min_value"`
- ModifyTime string `json:"modify_time"`
- MoveFrequency string `json:"move_frequency"`
- MoveType int `json:"move_type"`
- NoUpdate int `json:"no_update"`
- ServerUrl string `json:"server_url"`
- Sort int `json:"sort"`
- Source int `json:"source"`
- SourceIndexName string `json:"source_index_name"`
- SourceName string `json:"source_name"`
- StartDate string `json:"start_date"`
- StockCode string `json:"stock_code"`
- SubSource int `json:"sub_source"`
- SubSourceName string `json:"sub_source_name"`
- SysUserId int `json:"sys_user_id"`
- SysUserRealName string `json:"sys_user_real_name"`
- TerminalCode string `json:"terminal_code"`
- UniqueCode string `json:"unique_code"`
- Unit string `json:"unit"`
- UnitEn string `json:"unit_en"`
- }
- // GetAllEdbInfoListByCondition
- // @Description: 获取所有的指标
- // @author: Roc
- // @datetime 2024-02-29 10:55:38
- // @param condition string
- // @param pars []interface{}
- // @return item []*EdbInfoUpdateLog
- // @return err error
- func GetAllEdbInfoListByCondition(condition string, pars []interface{}) (item []*EdbInfoItem, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT * FROM edb_info WHERE 1=1 `
- if condition != "" {
- sql += condition
- }
- sql += ` ORDER BY edb_info_id ASC `
- _, err = o.Raw(sql, pars).QueryRows(&item)
- return
- }
- type EdbData struct {
- EdbDataId int32 `orm:"column(edb_data_id);pk" json:"edb_data_id"`
- EdbInfoId int32 `json:"edb_info_id"` // 指标id
- EdbCode string `json:"edb_code"` // 指标编码
- //DataTime time.Time `json:"data_time"` // 数据日期
- DataTime string `json:"data_time"` // 数据日期
- Value float64 `json:"value"` // 数据值
- //CreateTime time.Time `json:"create_time"` // 创建时间
- //ModifyTime time.Time `json:"modify_time"` // 修改时间
- CreateTime string `json:"create_time"` // 创建时间
- ModifyTime string `json:"modify_time"` // 修改时间
- DataTimestamp int64 `json:"data_timestamp"` // 数据日期时间戳
- }
- // GetAllEdbDataListByCondition
- // @Description: 根据指标id和表名获取指标数据
- // @author: Roc
- // @datetime 2024-03-14 13:22:01
- // @param tableName string
- // @param edbInfoId int
- // @return item []*EdbData
- // @return err error
- func GetAllEdbDataListByCondition(tableName string, edbInfoId int) (item []*EdbData, err error) {
- if tableName == `` {
- err = errors.New("错误的表名")
- return
- }
- o := orm.NewOrmUsingDB("data")
- sql := fmt.Sprintf(` SELECT * FROM %s WHERE 1=1 and edb_info_id = ? `, tableName)
- sql += ` ORDER BY edb_data_id ASC `
- _, err = o.Raw(sql, edbInfoId).QueryRows(&item)
- return
- }
- type BaseFromMysteelChemicalIndexItem struct {
- BaseFromMysteelChemicalIndexId int32 `json:"base_from_mysteel_chemical_index_id"`
- BaseFromMysteelChemicalClassifyId int32 `json:"base_from_mysteel_chemical_classify_id"` // 钢联化工指标分类id
- IndexCode string `json:"index_code"` // 指标编码
- IndexName string `json:"index_name"` // 指标名称
- Unit string `json:"unit"` // 单位
- Source string `json:"source"` // 数据来源
- Frequency string `json:"frequency"` // 频度
- StartDate string `json:"start_date"` // 开始日期
- EndDate string `json:"end_date"` // 结束日期
- Describe string `json:"describe"` // 指标描述
- UpdateWeek string `json:"update_week"` // 更新周期
- UpdateTime string `json:"update_time"` // 更新时间,多个时间点用英文,隔开
- UpdateTime2 string `json:"update_time2"` // 更新时间2
- SysUserId int32 `json:"sys_user_id"` // 创建人id
- SysUserRealName string `json:"sys_user_real_name"` // 创建人姓名
- CreateTime string `json:"create_time"` // 创建时间
- ModifyTime string `json:"modify_time"` // 修改时间
- FilePath string `json:"file_path"` // 文件存储路径
- Sort int32 `json:"sort"` // 排序
- MergeFilePath string `json:"merge_file_path"`
- FileIndex int32 `json:"file_index"`
- MergeUpdateWeek string `json:"merge_update_week"` // 合并文件的更新周
- MergeFilePathWeek string `json:"merge_file_path_week"` // 更新文件
- UpdateDate string `json:"update_date"` // 更新日期
- IsRefresh int32 `json:"is_refresh"` // 0:不需要及时刷新,1:需要及时刷新
- IsStop int32 `json:"is_stop"` // 是否停更:1:停更,0:未停更
- TerminalCode string `json:"terminal_code"` // 所属终端编码
- EndValue float64 `json:"end_value"` // 指标的最新值
- }
- // GetBaseFromMysteelChemicalIndexItemByCode
- // @Description: 根据指标编码获取钢联指标详情
- // @author: Roc
- // @datetime 2024-03-11 16:42:56
- // @param edbCode string
- // @return item *BaseFromMysteelChemicalIndexItem
- // @return err error
- func GetBaseFromMysteelChemicalIndexItemByCode(edbCode string) (item *BaseFromMysteelChemicalIndexItem, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT * FROM base_from_mysteel_chemical_index WHERE index_code = ?`
- err = o.Raw(sql, edbCode).QueryRow(&item)
- return
- }
- type BaseFromSmmIndexItem struct {
- BaseFromSmmIndexId int32 `json:"base_from_smm_index_id"`
- ClassifyId int32 `json:"classify_id"` // Smm原始数据指标分类id
- Interface string `json:"interface"`
- Name string `json:"name"`
- IndexCode string `json:"index_code"` // 指标编码
- IndexName string `json:"index_name"` // 指标名称
- Type1 string `json:"type_1"` // 类型1
- Type2 string `json:"type_2"` // 类型2
- Type3 string `json:"type_3"` // 类型3
- Frequency string `json:"frequency"` // 频度
- Unit string `json:"unit"` // 单位
- ApiStartTime string `json:"api_start_time"` // 接口开始日期
- ApiUpdateTime string `json:"api_update_time"` // 接口更新日期
- StartTime string `json:"start_time"` // 开始日期
- FinishTime string `json:"finish_time"` // 完成日期
- CreateTime string `json:"create_time"`
- ModifyTime string `json:"modify_time"`
- StartDate string `json:"start_date"`
- EndDate string `json:"end_date"`
- IsGet int32 `json:"is_get"` // 0:未获取数据,1:已获取数据
- Sort int32 `json:"sort"` // 排序
- BaseFileName string `json:"base_file_name"` // 文件目录
- RenameFileName string `json:"rename_file_name"` // 重命名文件目录
- TerminalCode string `json:"terminal_code"` // 所属终端编码
- DataState string `json:"data_state"` // 指标数据状态 normal/空白-正常更新 ceased-已停更irregular-更新依赖外部会有不定期延迟
- ReleaseTime string `json:"release_time"` // 预计发布时间
- IsStop int32 `json:"is_stop"` // 是否停更:1:停更,0:未停更
- EndValue float64 `json:"end_value"` // 指标的最新值
- }
- // GetBaseFromSmmIndexItemItemByCode
- // @Description: 根据指标编码获取指标信息
- // @author: Roc
- // @datetime 2024-03-11 16:41:02
- // @param source int
- // @param edbCode string
- // @return item *BaseFromSmmIndexItem
- // @return err error
- func GetBaseFromSmmIndexItemItemByCode(edbCode string) (item *BaseFromSmmIndexItem, err error) {
- o := orm.NewOrmUsingDB("data")
- sql := ` SELECT * FROM base_from_smm_index WHERE index_code=? `
- err = o.Raw(sql, edbCode).QueryRow(&item)
- return
- }
- // GetEdbDataTableName 指标数据->存储表
- func GetEdbDataTableName(source, subSource int) (tableName string) {
- switch source {
- case utils.DATA_SOURCE_THS:
- tableName = "edb_data_ths"
- if subSource == utils.DATA_SUB_SOURCE_DATE {
- tableName = "edb_data_ths_ds"
- } else {
- tableName = "edb_data_ths"
- }
- case utils.DATA_SOURCE_WIND:
- if subSource == utils.DATA_SUB_SOURCE_DATE {
- tableName = "edb_data_wind_wsd"
- } else {
- tableName = "edb_data_wind"
- }
- case utils.DATA_SOURCE_PB, utils.DATA_SOURCE_PB_FINANCE: //彭博经济数据、彭博财务数据
- tableName = "edb_data_pb"
- case utils.DATA_SOURCE_CALCULATE:
- tableName = "edb_data_calculate"
- case utils.DATA_SOURCE_CALCULATE_LJZZY:
- tableName = "edb_data_calculate_ljzzy"
- case utils.DATA_SOURCE_CALCULATE_TBZ:
- tableName = "edb_data_calculate_tbz"
- case utils.DATA_SOURCE_CALCULATE_TCZ:
- tableName = "edb_data_calculate_tcz"
- case utils.DATA_SOURCE_CALCULATE_NSZYDPJJS:
- tableName = "edb_data_calculate_nszydpjjs"
- case utils.DATA_SOURCE_MANUAL:
- tableName = "edb_data_manual"
- case utils.DATA_SOURCE_LZ:
- tableName = "edb_data_lz"
- case utils.DATA_SOURCE_YS:
- tableName = "edb_data_ys"
- case utils.DATA_SOURCE_CALCULATE_HBZ:
- tableName = "edb_data_calculate_hbz"
- case utils.DATA_SOURCE_CALCULATE_HCZ:
- tableName = "edb_data_calculate_hcz"
- case utils.DATA_SOURCE_CALCULATE_BP:
- tableName = "edb_data_calculate_bp"
- case utils.DATA_SOURCE_GL:
- tableName = "edb_data_gl"
- case utils.DATA_SOURCE_ZZ:
- tableName = "edb_data_zz"
- case utils.DATA_SOURCE_DL:
- tableName = "edb_data_dl"
- case utils.DATA_SOURCE_SH:
- tableName = "edb_data_sh"
- case utils.DATA_SOURCE_CFFEX:
- tableName = "edb_data_cffex"
- case utils.DATA_SOURCE_SHFE:
- tableName = "edb_data_ine"
- case utils.DATA_SOURCE_GIE:
- tableName = "edb_data_gie"
- case utils.DATA_SOURCE_CALCULATE_ZJPJ:
- tableName = "edb_data_calculate_zjpj"
- case utils.DATA_SOURCE_CALCULATE_TIME_SHIFT:
- tableName = "edb_data_calculate_time_shift"
- case utils.DATA_SOURCE_CALCULATE_LJZTBPJ:
- tableName = "edb_data_calculate_ljztbpj"
- case utils.DATA_SOURCE_LT:
- tableName = "edb_data_lt"
- case utils.DATA_SOURCE_COAL:
- tableName = "edb_data_coal"
- case utils.DATA_SOURCE_PYTHON:
- tableName = "edb_data_python"
- case utils.DATA_SOURCE_GOOGLE_TRAVEL:
- tableName = "edb_data_google_travel"
- case utils.DATA_SOURCE_PREDICT_CALCULATE:
- tableName = "edb_data_predict_calculate"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_TBZ:
- tableName = "edb_data_predict_calculate_tbz"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_TCZ:
- tableName = "edb_data_predict_calculate_tcz"
- case utils.DATA_SOURCE_MYSTEEL_CHEMICAL:
- tableName = "edb_data_mysteel_chemical"
- case utils.DATA_SOURCE_CALCULATE_CJJX:
- tableName = "edb_data_calculate_cjjx"
- case utils.DATA_SOURCE_EIA_STEO:
- tableName = "edb_data_eia_steo"
- case utils.DATA_SOURCE_CALCULATE_NHCC:
- tableName = "edb_data_calculate_nhcc"
- case utils.DATA_SOURCE_COM_TRADE:
- tableName = "edb_data_com_trade"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_NSZYDPJJS:
- tableName = "edb_data_predict_calculate_nszydpjjs"
- case utils.DATA_SOURCE_CALCULATE_ADJUST:
- tableName = "edb_data_calculate_adjust"
- case utils.DATA_SOURCE_SCI:
- tableName = "edb_data_sci"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZY:
- tableName = "edb_data_predict_calculate_ljzzy"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_TIME_SHIFT:
- tableName = "edb_data_predict_calculate_time_shift"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_ZJPJ:
- tableName = "edb_data_predict_calculate_zjpj"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZTBPJ:
- tableName = "edb_data_predict_calculate_ljztbpj"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_NHCC:
- tableName = "edb_data_predict_calculate_nhcc"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_CJJX:
- tableName = "edb_data_predict_calculate_cjjx"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_HBZ:
- tableName = "edb_data_predict_calculate_hbz"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_HCZ:
- tableName = "edb_data_predict_calculate_hcz"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_BP:
- tableName = "edb_data_predict_calculate_bp"
- case utils.DATA_SOURCE_CALCULATE_JP:
- tableName = "edb_data_calculate_jp"
- case utils.DATA_SOURCE_CALCULATE_NH:
- tableName = "edb_data_calculate_nh"
- case utils.DATA_SOURCE_CALCULATE_KSZS:
- tableName = "edb_data_calculate_kszs"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_JP:
- tableName = "edb_data_predict_calculate_jp"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_NH:
- tableName = "edb_data_predict_calculate_nh"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_KSZS:
- tableName = "edb_data_predict_calculate_kszs"
- case utils.DATA_SOURCE_BAIINFO:
- tableName = "edb_data_baiinfo"
- case utils.DATA_SOURCE_STOCK_PLANT:
- tableName = "edb_data_stock_plant"
- case utils.DATA_SOURCE_CALCULATE_CORRELATION:
- tableName = "edb_data_calculate_correlation"
- case utils.DATA_SOURCE_NATIONAL_STATISTICS:
- tableName = "edb_data_national_statistics"
- case utils.DATA_SOURCE_CALCULATE_LJZZJ: //累计值转季 -> 61
- tableName = "edb_data_calculate_ljzzj"
- case utils.DATA_SOURCE_CALCULATE_LJZ: //累计值 -> 62
- tableName = "edb_data_calculate_ljz"
- case utils.DATA_SOURCE_CALCULATE_LJZNCZJ: //累计值(年初至今) -> 63
- tableName = "edb_data_calculate_ljznczj"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZJ: // 预测指标 - 累计值 -> 65
- tableName = "edb_data_predict_calculate_ljzzj"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZ: //预测指标 - 累计值转季->64
- tableName = "edb_data_predict_calculate_ljz"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ: //预测指标 - 累计值(年初至今) -> 66
- tableName = "edb_data_predict_calculate_ljznczj"
- case utils.DATA_SOURCE_CALCULATE_STANDARD_DEVIATION: //标准差->67
- tableName = "edb_data_calculate_standard_deviation"
- case utils.DATA_SOURCE_CALCULATE_PERCENTILE: //百分位->68
- tableName = "edb_data_calculate_percentile"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_STANDARD_DEVIATION: //预测标准差->69
- tableName = "edb_data_predict_ccalculate_standard_deviation"
- case utils.DATA_SOURCE_PREDICT_CALCULATE_PERCENTILE: //预测百分位->70
- tableName = "edb_data_predict_ccalculate_percentile"
- case utils.DATA_SOURCE_FUBAO: //富宝-71
- tableName = "edb_data_fubao"
- case utils.DATA_SOURCE_CALCULATE_ZSXY:
- tableName = "edb_data_calculate_zsxy" // 指数修匀->72
- case utils.DATA_SOURCE_PREDICT_CALCULATE_ZSXY:
- tableName = "edb_data_predict_calculate_zsxy" // 预测指数修匀->73
- case utils.DATA_SOURCE_CALCULATE_ZDYFX:
- tableName = "edb_data_calculate_zdyfx" // 自定义分析->74
- case utils.DATA_SOURCE_CALCULATE_RJZ: //日均值->75
- tableName = "edb_data_calculate_rjz"
- case utils.DATA_SOURCE_GFEX: //广州期货交易所->78
- tableName = "edb_data_gz"
- case utils.DATA_SOURCE_ICPI: //ICPI消费价格指数->79
- tableName = "edb_data_icpi"
- default:
- edbSource := EdbSourceIdMap[source]
- if edbSource != nil {
- tableName = edbSource.TableName
- }
- }
- return
- }
- // GetSourceAndSubSourceTableName 存储表->指标数据
- func GetSourceAndSubSourceTableName(tableName, edbCode string) (source, subSource int) {
- switch tableName {
- case "edb_data_ths":
- source = utils.DATA_SOURCE_THS
- case "edb_data_ths_ds":
- source = utils.DATA_SOURCE_THS
- subSource = utils.DATA_SUB_SOURCE_DATE
- case "edb_data_wind":
- source = utils.DATA_SOURCE_WIND
- case "edb_data_wind_wsd":
- source = utils.DATA_SOURCE_WIND
- subSource = utils.DATA_SUB_SOURCE_DATE
- case "edb_data_pb":
- source = utils.DATA_SOURCE_PB
- // 彭博财务
- if strings.Contains(edbCode, "&&") {
- source = utils.DATA_SOURCE_PB_FINANCE
- }
- case "edb_data_calculate":
- source = utils.DATA_SOURCE_CALCULATE
- case "edb_data_calculate_ljzzy":
- source = utils.DATA_SOURCE_CALCULATE_LJZZY
- case "edb_data_calculate_tbz":
- source = utils.DATA_SOURCE_CALCULATE_TBZ
- case "edb_data_calculate_tcz":
- source = utils.DATA_SOURCE_CALCULATE_TCZ
- case "edb_data_calculate_nszydpjjs":
- source = utils.DATA_SOURCE_CALCULATE_NSZYDPJJS
- case "edb_data_manual":
- source = utils.DATA_SOURCE_MANUAL
- case "edb_data_lz":
- source = utils.DATA_SOURCE_LZ
- case "edb_data_ys":
- source = utils.DATA_SOURCE_YS
- case "edb_data_calculate_hbz":
- source = utils.DATA_SOURCE_CALCULATE_HBZ
- case "edb_data_calculate_hcz":
- source = utils.DATA_SOURCE_CALCULATE_HCZ
- case "edb_data_calculate_bp":
- source = utils.DATA_SOURCE_CALCULATE_BP
- case "edb_data_gl":
- source = utils.DATA_SOURCE_GL
- case "edb_data_zz":
- source = utils.DATA_SOURCE_ZZ
- case "edb_data_dl":
- source = utils.DATA_SOURCE_DL
- case "edb_data_sh":
- source = utils.DATA_SOURCE_SH
- case "edb_data_cffex":
- source = utils.DATA_SOURCE_CFFEX
- case "edb_data_ine":
- source = utils.DATA_SOURCE_SHFE
- case "edb_data_gie":
- source = utils.DATA_SOURCE_GIE
- case "edb_data_calculate_zjpj":
- source = utils.DATA_SOURCE_CALCULATE_ZJPJ
- case "edb_data_calculate_time_shift":
- source = utils.DATA_SOURCE_CALCULATE_TIME_SHIFT
- case "edb_data_calculate_ljztbpj":
- source = utils.DATA_SOURCE_CALCULATE_LJZTBPJ
- case "edb_data_lt":
- source = utils.DATA_SOURCE_LT
- case "edb_data_coal":
- source = utils.DATA_SOURCE_COAL
- case "edb_data_python":
- source = utils.DATA_SOURCE_PYTHON
- case "edb_data_google_travel":
- source = utils.DATA_SOURCE_GOOGLE_TRAVEL
- case "edb_data_predict_calculate":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE
- case "edb_data_predict_calculate_tbz":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_TBZ
- case "edb_data_predict_calculate_tcz":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_TCZ
- case "edb_data_mysteel_chemical":
- source = utils.DATA_SOURCE_MYSTEEL_CHEMICAL
- case "edb_data_calculate_cjjx":
- source = utils.DATA_SOURCE_CALCULATE_CJJX
- case "edb_data_eia_steo":
- source = utils.DATA_SOURCE_EIA_STEO
- case "edb_data_calculate_nhcc":
- source = utils.DATA_SOURCE_CALCULATE_NHCC
- case "edb_data_com_trade":
- source = utils.DATA_SOURCE_COM_TRADE
- case "edb_data_predict_calculate_nszydpjjs":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_NSZYDPJJS
- case "edb_data_calculate_adjust":
- source = utils.DATA_SOURCE_CALCULATE_ADJUST
- case "edb_data_sci":
- source = utils.DATA_SOURCE_SCI
- case "edb_data_predict_calculate_ljzzy":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZY
- case "edb_data_predict_calculate_time_shift":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_TIME_SHIFT
- case "edb_data_predict_calculate_zjpj":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_ZJPJ
- case "edb_data_predict_calculate_ljztbpj":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_LJZTBPJ
- case "edb_data_predict_calculate_nhcc":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_NHCC
- case "edb_data_predict_calculate_cjjx":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_CJJX
- case "edb_data_predict_calculate_hbz":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_HBZ
- case "edb_data_predict_calculate_hcz":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_HCZ
- case "edb_data_predict_calculate_bp":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_BP
- case "edb_data_calculate_jp":
- source = utils.DATA_SOURCE_CALCULATE_JP
- case "edb_data_calculate_nh":
- source = utils.DATA_SOURCE_CALCULATE_NH
- case "edb_data_calculate_kszs":
- source = utils.DATA_SOURCE_CALCULATE_KSZS
- case "edb_data_predict_calculate_jp":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_JP
- case "edb_data_predict_calculate_nh":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_NH
- case "edb_data_predict_calculate_kszs":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_KSZS
- case "edb_data_baiinfo":
- source = utils.DATA_SOURCE_BAIINFO
- case "edb_data_stock_plant":
- source = utils.DATA_SOURCE_STOCK_PLANT
- case "edb_data_calculate_correlation":
- source = utils.DATA_SOURCE_CALCULATE_CORRELATION
- case "edb_data_national_statistics":
- source = utils.DATA_SOURCE_NATIONAL_STATISTICS
- case "edb_data_calculate_ljzzj": //累计值转季 -> 61
- source = utils.DATA_SOURCE_CALCULATE_LJZZJ
- case "edb_data_calculate_ljz": //累计值 -> 62
- source = utils.DATA_SOURCE_CALCULATE_LJZ
- case "edb_data_calculate_ljznczj": //累计值(年初至今) -> 63
- source = utils.DATA_SOURCE_CALCULATE_LJZNCZJ
- case "edb_data_predict_calculate_ljzzj": // 预测指标 - 累计值 -> 65
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_LJZZJ
- case "edb_data_predict_calculate_ljz": //预测指标 - 累计值转季->64
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_LJZ
- case "edb_data_predict_calculate_ljznczj": //预测指标 - 累计值(年初至今) -> 66
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_LJZNCZJ
- case "edb_data_calculate_standard_deviation": //标准差->67
- source = utils.DATA_SOURCE_CALCULATE_STANDARD_DEVIATION
- case "edb_data_calculate_percentile": //百分位->68
- source = utils.DATA_SOURCE_CALCULATE_PERCENTILE
- case "edb_data_predict_ccalculate_standard_deviation": //预测标准差->69
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_STANDARD_DEVIATION
- case "edb_data_predict_ccalculate_percentile": //预测百分位->70
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_PERCENTILE
- case "edb_data_fubao":
- source = utils.DATA_SOURCE_FUBAO
- case "edb_data_calculate_zsxy":
- source = utils.DATA_SOURCE_CALCULATE_ZSXY // 指数修匀->72
- case "edb_data_predict_calculate_zsxy":
- source = utils.DATA_SOURCE_PREDICT_CALCULATE_ZSXY // 预测指数修匀->73
- case "edb_data_calculate_zdyfx":
- source = utils.DATA_SOURCE_CALCULATE_ZDYFX // 自定义分析->74
- case "edb_data_calculate_rjz": //日均值75
- source = utils.DATA_SOURCE_CALCULATE_RJZ
- default:
- edbSource := EdbTableNameSourceMap[tableName]
- if edbSource != nil {
- source = edbSource.EdbSourceId
- }
- }
- return
- }
|