classify_menu_relation.go 743 B

123456789101112131415161718192021222324
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ClassifyMenuRelation 报告分类-子目录关联表
  7. type ClassifyMenuRelation struct {
  8. Id int `orm:"column(id);pk"`
  9. MenuId int `description:"子目录ID"`
  10. ClassifyId int `description:"二级分类ID"`
  11. CreateTime time.Time `description:"创建时间"`
  12. }
  13. // GetClassifyMenuRelationList 获取子目录关联列表
  14. func GetClassifyMenuRelationList(condition string, pars []interface{}) (list []*ClassifyMenuRelation, err error) {
  15. o := orm.NewOrmUsingDB("rddp")
  16. sql := `SELECT * FROM classify_menu_relation WHERE 1 = 1 `
  17. sql += condition
  18. sql += ` ORDER BY create_time DESC`
  19. _, err = o.Raw(sql, pars).QueryRows(&list)
  20. return
  21. }