package data_manage import "github.com/beego/beego/v2/client/orm" type ManualSysUser struct { ItemId int `description:"部门/组/用户 id"` ItemName string `description:"部门/组/用户 名称"` Children []*ManualSysUser } type ManualClassifyEdbInfoCount struct { ClassifyId int Total int } func GetManualClassifyEdbInfoCount() (items []*ManualClassifyEdbInfoCount, err error) { sql := ` SELECT a.classify_id,COUNT(1) AS total FROM edbdata_classify AS a INNER JOIN edbinfo AS b ON a.classify_id=b.classify_id WHERE a.is_show=1 GROUP BY a.classify_id ` o := orm.NewOrmUsingDB("edb") _, err = o.Raw(sql).QueryRows(&items) return } // GetManualEdbInfoCountByClassifyId 根据手工指标分类id获取指标数 func GetManualEdbInfoCountByClassifyId(classifyId int) (total int, err error) { sql := ` SELECT COUNT(1) AS total FROM edbdata_classify AS a INNER JOIN edbinfo AS b ON a.classify_id=b.classify_id WHERE a.is_show=1 AND b.classify_id = ?` o := orm.NewOrmUsingDB("edb") err = o.Raw(sql, classifyId).QueryRow(&total) return }