|
@@ -0,0 +1,38 @@
|
|
|
+package models
|
|
|
+
|
|
|
+import (
|
|
|
+ "github.com/beego/beego/v2/client/orm"
|
|
|
+ "time"
|
|
|
+)
|
|
|
+
|
|
|
+type EdbInfoCalculateItemReq struct {
|
|
|
+ EdbCode string `description:"指标编码"`
|
|
|
+ Source int `description:"来源id"`
|
|
|
+}
|
|
|
+
|
|
|
+type EdbInfoCalculateMapping struct {
|
|
|
+ EdbInfoCalculateMappingId int `orm:"column(edb_info_calculate_mapping_id);pk"`
|
|
|
+ EdbInfoId int `description:"计算指标id"`
|
|
|
+ Source int `description:"计算指标来源"`
|
|
|
+ SourceName string `description:"计算指标来源名称"`
|
|
|
+ EdbCode string `description:"计算指标编码"`
|
|
|
+ FromEdbInfoId int `description:"基础指标id"`
|
|
|
+ FromEdbCode string `description:"基础指标编码"`
|
|
|
+ FromEdbName string `description:"基础指标名称"`
|
|
|
+ FromSource int `description:"基础指标来源"`
|
|
|
+ FromSourceName string `description:"基础指标来源名称"`
|
|
|
+ FromTag string `description:"来源指标标签"`
|
|
|
+ MoveValue int `description:"移动的值,小于0是提前,0是不变,大于0是滞后"`
|
|
|
+ Sort int `description:"计算指标名称排序"`
|
|
|
+ CreateTime time.Time `description:"创建时间"`
|
|
|
+ ModifyTime time.Time `description:"修改时间"`
|
|
|
+}
|
|
|
+
|
|
|
+func GetEdbInfoCalculateMappingByEdbCode(edbCode string) (list []*EdbInfoCalculateMapping, err error) {
|
|
|
+ o := orm.NewOrm()
|
|
|
+ sql := ` SELECT edb_code FROM edb_info_calculate_mapping AS a
|
|
|
+ WHERE a.edb_code=?
|
|
|
+ ORDER BY a.edb_info_calculate_mapping_id ASC `
|
|
|
+ _, err = o.Raw(sql, edbCode).QueryRows(&list)
|
|
|
+ return
|
|
|
+}
|