|
@@ -14,39 +14,39 @@ import (
|
|
|
|
|
|
type BaseFromPurangIndex struct {
|
|
|
BaseFromPurangIndexId int `orm:"column(base_from_purang_index_id);pk"`
|
|
|
- ClassifyId int
|
|
|
- IndexCode string
|
|
|
- IndexName string
|
|
|
- Frequency string
|
|
|
- Unit string
|
|
|
- Sort int
|
|
|
- StartDate time.Time `description:"开始日期"`
|
|
|
- EndDate time.Time `description:"结束日期"`
|
|
|
- EndValue float64
|
|
|
- CreateTime time.Time
|
|
|
- ModifyTime time.Time
|
|
|
+ ClassifyId int
|
|
|
+ IndexCode string
|
|
|
+ IndexName string
|
|
|
+ Frequency string
|
|
|
+ Unit string
|
|
|
+ Sort int
|
|
|
+ StartDate time.Time `description:"开始日期"`
|
|
|
+ EndDate time.Time `description:"结束日期"`
|
|
|
+ EndValue float64
|
|
|
+ CreateTime time.Time
|
|
|
+ ModifyTime time.Time
|
|
|
}
|
|
|
|
|
|
type BaseFromPurangIndexList struct {
|
|
|
BaseFromPurangIndexId int `orm:"column(base_from_purang_index_id);pk"`
|
|
|
- ClassifyId int
|
|
|
- Interface string
|
|
|
- EdbInfoId int
|
|
|
- EdbUniqueCode string `description:"指标库唯一编码"`
|
|
|
- EdbClassifyId int `description:"指标库分类ID"`
|
|
|
- StartDate string
|
|
|
- EndDate string
|
|
|
- EndValue float64
|
|
|
- IndexCode string
|
|
|
- IndexName string
|
|
|
- Frequency string
|
|
|
- Unit string
|
|
|
- Sort int
|
|
|
- CreateTime string
|
|
|
- ModifyTime string
|
|
|
- EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
- DataList []*BaseFromPurangData `gorm:"-"`
|
|
|
- Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
+ ClassifyId int
|
|
|
+ Interface string
|
|
|
+ EdbInfoId int
|
|
|
+ EdbUniqueCode string `description:"指标库唯一编码"`
|
|
|
+ EdbClassifyId int `description:"指标库分类ID"`
|
|
|
+ StartDate string
|
|
|
+ EndDate string
|
|
|
+ EndValue float64
|
|
|
+ IndexCode string
|
|
|
+ IndexName string
|
|
|
+ Frequency string
|
|
|
+ Unit string
|
|
|
+ Sort int
|
|
|
+ CreateTime string
|
|
|
+ ModifyTime string
|
|
|
+ EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
+ DataList []*BaseFromPurangData `gorm:"-"`
|
|
|
+ Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
}
|
|
|
|
|
|
func (baseFromPurangIndexList *BaseFromPurangIndexList) AfterFind(tx *gorm.DB) (err error) {
|
|
@@ -64,18 +64,18 @@ type BaseFromPurangIndexSearchList struct {
|
|
|
|
|
|
type PurangSingleDataResp struct {
|
|
|
BaseFromPurangIndexId int
|
|
|
- ClassifyId int
|
|
|
- EdbInfoId int
|
|
|
- IndexCode string
|
|
|
- IndexName string
|
|
|
- Frequency string
|
|
|
- Unit string
|
|
|
- StartTime string
|
|
|
- CreateTime string
|
|
|
- ModifyTime string
|
|
|
- EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
- Data []*PurangSingleData `gorm:"-"`
|
|
|
- Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
+ ClassifyId int
|
|
|
+ EdbInfoId int
|
|
|
+ IndexCode string
|
|
|
+ IndexName string
|
|
|
+ Frequency string
|
|
|
+ Unit string
|
|
|
+ StartTime string
|
|
|
+ CreateTime string
|
|
|
+ ModifyTime string
|
|
|
+ EdbExist int `description:"指标库是否已添加:0-否;1-是"`
|
|
|
+ Data []*PurangSingleData `gorm:"-"`
|
|
|
+ Paging *paging.PagingItem `description:"分页数据" gorm:"-"`
|
|
|
}
|
|
|
|
|
|
type PurangSingleData struct {
|
|
@@ -191,12 +191,12 @@ func GetPurangDataDataTimeByIndexId(indexIdList []int) (items []string, err erro
|
|
|
type BaseFromPurangData struct {
|
|
|
BaseFromPurangDataId int `orm:"column(base_from_purang_data_id);pk"`
|
|
|
BaseFromPurangIndexId int
|
|
|
- IndexCode string
|
|
|
- DataTime string
|
|
|
- Value string
|
|
|
- CreateTime string
|
|
|
- ModifyTime string
|
|
|
- DataTimestamp int64
|
|
|
+ IndexCode string
|
|
|
+ DataTime string
|
|
|
+ Value string
|
|
|
+ CreateTime string
|
|
|
+ ModifyTime string
|
|
|
+ DataTimestamp int64
|
|
|
}
|
|
|
|
|
|
func (baseFromPurangData *BaseFromPurangData) AfterFind(tx *gorm.DB) (err error) {
|
|
@@ -208,10 +208,10 @@ func (baseFromPurangData *BaseFromPurangData) AfterFind(tx *gorm.DB) (err error)
|
|
|
|
|
|
type BaseFromPurangIndexSearchItem struct {
|
|
|
BaseFromPurangIndexId int `orm:"column(base_from_purang_index_id);pk"`
|
|
|
- ClassifyId int
|
|
|
- ParentClassifyId int
|
|
|
- IndexCode string
|
|
|
- IndexName string
|
|
|
+ ClassifyId int
|
|
|
+ ParentClassifyId int
|
|
|
+ IndexCode string
|
|
|
+ IndexName string
|
|
|
}
|
|
|
|
|
|
// BatchCheckPurangEdbReq 指标数据结构体
|
|
@@ -224,12 +224,12 @@ type BatchCheckPurangEdbReq struct {
|
|
|
}
|
|
|
|
|
|
// GetPurangItemList 模糊查询Purang数据库指标列表
|
|
|
-func GetPurangItemList(condition string) (items []*BaseFromPurangIndexSearchItem, err error) {
|
|
|
+func GetPurangItemList(condition string, pars []interface{}) (items []*BaseFromPurangIndexSearchItem, err error) {
|
|
|
sql := "SELECT * FROM base_from_purang_index WHERE 1=1"
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|
|
|
- err = global.DbMap[utils.DbNameIndex].Raw(sql).Find(&items).Error
|
|
|
+ err = global.DbMap[utils.DbNameIndex].Raw(sql, pars).Find(&items).Error
|
|
|
return
|
|
|
}
|
|
|
|
|
@@ -271,7 +271,7 @@ func (item *BaseFromPurangIndex) Update(cols []string) (err error) {
|
|
|
// EditPurangIndexInfoResp 新增指标的返回
|
|
|
type EditPurangIndexInfoResp struct {
|
|
|
BaseFromPurangIndexId int `description:"指标ID"`
|
|
|
- IndexCode string `description:"指标code"`
|
|
|
+ IndexCode string `description:"指标code"`
|
|
|
}
|
|
|
|
|
|
type PurangIndexSource2EdbReq struct {
|
|
@@ -289,4 +289,4 @@ func GetPurangFrequencyByClassifyId(classifyId int) (items []*GlFrequency, err e
|
|
|
sql += ` GROUP BY frequency ORDER BY frequency ASC `
|
|
|
err = global.DbMap[utils.DbNameIndex].Raw(sql, classifyId).Find(&items).Error
|
|
|
return
|
|
|
-}
|
|
|
+}
|