package models import ( "github.com/beego/beego/v2/client/orm" "time" ) // ClassifyMenu 报告分类-子目录表 type ClassifyMenu struct { MenuId int `orm:"column(menu_id);pk"` MenuName string `description:"子目录名称"` ClassifyId int `description:"一级分类ID"` Sort int `description:"排序"` CreateTime time.Time `json:"-" description:"创建时间"` ModifyTime time.Time `json:"-" description:"更新时间"` } // GetClassifyMenuList 获取子目录列表 func GetClassifyMenuList(condition string, pars []interface{}) (list []*ClassifyMenu, err error) { o := orm.NewOrmUsingDB("rddp") sql := `SELECT * FROM classify_menu WHERE 1 = 1 ` sql += condition sql += ` ORDER BY sort ASC, create_time ASC` _, err = o.Raw(sql, pars).QueryRows(&list) return }