|
@@ -11,7 +11,6 @@ type EdbClassify struct {
|
|
|
ClassifyType uint8 `description:"分类类型,0:普通指标分类,1:预测指标分类"`
|
|
|
ClassifyName string `description:"分类名称"`
|
|
|
ParentId int `description:"父级id"`
|
|
|
- ParentIdTwo int `description:"三级id"`
|
|
|
HasData int `description:"是否含有指标数据"`
|
|
|
CreateTime time.Time `description:"创建时间"`
|
|
|
ModifyTime time.Time `description:"修改时间"`
|
|
@@ -138,7 +137,6 @@ type EdbClassifyItems struct {
|
|
|
ClassifyName string
|
|
|
ClassifyNameEn string
|
|
|
ParentId int
|
|
|
- ParentIdTwo int
|
|
|
Level int `description:"层级"`
|
|
|
Sort int `description:"排序字段,越小越靠前,默认值:10"`
|
|
|
UniqueCode string `description:"唯一编码"`
|
|
@@ -272,30 +270,29 @@ type ClassifyEdbInfoListResp struct {
|
|
|
// GetEdbClassifyAllV2 获取普通指标的分类列表
|
|
|
func GetEdbClassifyAllV2() (items []*EdbClassifyItems, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` SELECT * FROM edb_classify WHERE parent_id_two <>0 AND classify_type = 0 order by sort asc,classify_id asc`
|
|
|
+ sql := ` SELECT * FROM edb_classify WHERE parent_id <>0 AND classify_type = 0 order by sort asc,classify_id asc`
|
|
|
_, err = o.Raw(sql).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetEdbClassifyByParentIdTwo(parentIdTwo int, classifyType int8) (items []*EdbClassifyItems, err error) {
|
|
|
+func GetEdbClassifyByParentIdTwo(classifyType int8) (items []*EdbClassifyItems, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
- sql := ` SELECT * FROM edb_classify WHERE parent_id_two=? AND classify_type = ? order by sort asc,classify_id asc`
|
|
|
- _, err = o.Raw(sql, parentIdTwo, classifyType).QueryRows(&items)
|
|
|
+ sql := ` SELECT * FROM edb_classify WHERE level=2 AND classify_type = ? order by sort asc,classify_id asc`
|
|
|
+ _, err = o.Raw(sql, classifyType).QueryRows(&items)
|
|
|
return
|
|
|
}
|
|
|
|
|
|
type AddEdbClassifyReqV2 struct {
|
|
|
ClassifyName string `description:"分类名称"`
|
|
|
ParentId int `description:"父级id,第一级传0"`
|
|
|
- ParentIdTwo int `description:"二级id,第一级传0"`
|
|
|
Level int `description:"层级,第一级传0,其余传上一级的层级"`
|
|
|
ClassifyType uint8 `description:"分类类型,0:普通指标分类,1:预测指标分类"`
|
|
|
}
|
|
|
|
|
|
// GetEdbClassifyMaxSortV2 获取分类下最大的排序数
|
|
|
-func GetEdbClassifyMaxSortV2(parentId,parentIdTwo int, classifyType uint8) (sort int, err error) {
|
|
|
+func GetEdbClassifyMaxSortV2(parentId int, classifyType uint8) (sort int, err error) {
|
|
|
o := orm.NewOrmUsingDB("data")
|
|
|
sql := `SELECT Max(sort) AS sort FROM edb_classify WHERE parent_id=? AND parent_id_two=? AND classify_type=? `
|
|
|
- err = o.Raw(sql, parentId,parentIdTwo, classifyType).QueryRow(&sort)
|
|
|
+ err = o.Raw(sql, parentId, classifyType).QueryRow(&sort)
|
|
|
return
|
|
|
}
|