|
@@ -17,10 +17,6 @@ type BaseFromClarksonsIndex struct {
|
|
|
StartDate string `description:"开始日期"`
|
|
|
EndDate string `description:"结束日期"`
|
|
|
Sort int `description:"排序"`
|
|
|
- LatestValue float64 `description:"最新值"`
|
|
|
- LatestDate time.Time `description:"最后更新时间"`
|
|
|
- TerminalCode string
|
|
|
- FilePath string `json:"-"`
|
|
|
CreateTime time.Time
|
|
|
ModifyTime time.Time
|
|
|
}
|
|
@@ -37,7 +33,6 @@ type BaseFromClarksonsIndexView struct {
|
|
|
StartDate string `description:"开始日期"`
|
|
|
EndDate string `description:"结束日期"`
|
|
|
Sort int `description:"排序"`
|
|
|
- LatestValue float64 `description:"最新值"`
|
|
|
LatestDate string `description:"最后更新时间"`
|
|
|
EdbExist int `description:"edb是否存在"`
|
|
|
ModifyTime string
|
|
@@ -49,7 +44,7 @@ func (b *BaseFromClarksonsIndex) Update(cols []string) (err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexByCondition 根据条件获取卓创红期指标列表
|
|
|
+// GetClarksonsIndexByCondition 根据条件获取克拉克森指标列表
|
|
|
func GetClarksonsIndexByCondition(condition string, pars []interface{}) (items []*BaseFromClarksonsIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT * FROM base_from_clarksons_index WHERE 1=1 `
|
|
@@ -62,7 +57,7 @@ func GetClarksonsIndexByCondition(condition string, pars []interface{}) (items [
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexByCondition 根据条件获取卓创红期指标列表
|
|
|
+// GetClarksonsIndexByCondition 根据条件获取克拉克森指标列表
|
|
|
func GetClarksonsIndexByConditionAndFrequency(condition, frequency string, pars []interface{}) (items []*BaseFromClarksonsIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT * FROM base_from_clarksons_index WHERE 1=1 `
|
|
@@ -88,7 +83,7 @@ func GetClarksonsIndexCountByCondition(condition string, pars []interface{}) (co
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexAndEdbInfoByCondition 根据条件获取卓创红期index和指标库的信息
|
|
|
+// GetClarksonsIndexAndEdbInfoByCondition 根据条件获取克拉克森index和指标库的信息
|
|
|
func GetClarksonsIndexAndEdbInfoByCondition(condition string, pars []interface{}) (items []*BaseFromClarksonsIndexView, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT b.*, e.edb_info_id FROM base_from_clarksons_index AS b LEFT JOIN edb_info AS e ON b.index_code=e.edb_code AND e.source=? WHERE 1=1 `
|
|
@@ -140,7 +135,7 @@ func GetClarksonsIndexCountByClassifyIds(classifyIds []int) (count int, err erro
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexByClassifyId 根据分类id获取卓创红期指标列表
|
|
|
+// GetClarksonsIndexByClassifyId 根据分类id获取克拉克森指标列表
|
|
|
func GetClarksonsIndexByClassifyId(classifyIds []int, startSize, pageSize int) (items []*BaseFromClarksonsIndexView, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT b.*, e.edb_info_id,
|
|
@@ -152,7 +147,7 @@ func GetClarksonsIndexByClassifyId(classifyIds []int, startSize, pageSize int) (
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexCountByClassifyId 根据分类id获取卓创红期指标数量
|
|
|
+// GetClarksonsIndexCountByClassifyId 根据分类id获取克拉克森指标数量
|
|
|
func GetClarksonsIndexCountByClassifyId(classifyIds []int) (count int, err error) {
|
|
|
if len(classifyIds) == 0 {
|
|
|
return
|
|
@@ -163,7 +158,7 @@ func GetClarksonsIndexCountByClassifyId(classifyIds []int) (count int, err error
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexCount 获取卓创红期指标数量
|
|
|
+// GetClarksonsIndexCount 获取克拉克森指标数量
|
|
|
func GetClarksonsIndexCount() (count int, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT COUNT(*) AS count FROM base_from_clarksons_index `
|
|
@@ -182,7 +177,7 @@ func GetClarksonsIndexByPage(startSize, pageSize int) (items []*BaseFromClarkson
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexBaseInfoByClassifyId 根据分类id获取卓创红期指标列表
|
|
|
+// GetClarksonsIndexBaseInfoByClassifyId 根据分类id获取克拉克森指标列表
|
|
|
func GetClarksonsIndexBaseInfoByClassifyId(classifyId int) (items []*BaseFromClarksonsIndexView, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT base_from_clarksons_index_id, classify_id, index_code, index_name, CONCAT(classify_id, '_', base_from_clarksons_index_id) AS unique_code FROM base_from_clarksons_index WHERE classify_id = ? ORDER BY sort ASC `
|
|
@@ -190,7 +185,7 @@ func GetClarksonsIndexBaseInfoByClassifyId(classifyId int) (items []*BaseFromCla
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-// GetClarksonsIndexBaseInfoByClassifyId 根据分类id获取卓创红期指标列表
|
|
|
+// GetClarksonsIndexBaseInfoByClassifyId 根据分类id获取克拉克森指标列表
|
|
|
func GetClarksonsIndexBaseInfoByCondition(condition string, pars []interface{}) (items []*BaseFromClarksonsIndex, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := ` SELECT base_from_clarksons_index_id, index_code, index_name FROM base_from_clarksons_index WHERE 1=1 `
|
|
@@ -252,11 +247,11 @@ func GetClarksonsClassifyMaxSortByClassifyIds(classifyIds []int) (items []*BaseF
|
|
|
return
|
|
|
}
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := `SELECT bc.classify_id, COALESCE(MAX(bi.sort), 0) AS max_sort FROM base_from_clarksons_classify AS bc
|
|
|
+ sql := `SELECT bc.base_from_clarksons_classify_id, COALESCE(MAX(bi.sort), 0) AS max_sort FROM base_from_clarksons_classify AS bc
|
|
|
LEFT JOIN base_from_clarksons_index AS bi
|
|
|
- ON bc.classify_id=bi.classify_id
|
|
|
- WHERE bc.classify_id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `)
|
|
|
- GROUP BY bc.classify_id
|
|
|
+ ON bc.base_from_clarksons_classify_id=bi.classify_id
|
|
|
+ WHERE bc.base_from_clarksons_classify_id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `)
|
|
|
+ GROUP BY bc.base_from_clarksons_classify_id
|
|
|
`
|
|
|
// sql = ` SELECT classify_id, MAX(sort) AS max_sort FROM base_from_clarksons_index WHERE classify_id IN (` + utils.GetOrmInReplace(len(classifyIds)) + `) GROUP BY classify_id `
|
|
|
_, err = o.Raw(sql, classifyIds).QueryRows(&items)
|