package models

import (
	"github.com/beego/beego/v2/client/orm"
	"time"
)

// ClassifyMenuRelation 报告分类-子目录关联表
type ClassifyMenuRelation struct {
	Id         int       `orm:"column(id);pk"`
	MenuId     int       `description:"子目录ID"`
	ClassifyId int       `description:"二级分类ID"`
	CreateTime time.Time `description:"创建时间"`
}

// GetClassifyMenuRelationList 获取子目录关联列表
func GetClassifyMenuRelationList(condition string, pars []interface{}) (list []*ClassifyMenuRelation, err error) {
	o := orm.NewOrmUsingDB("rddp")
	sql := `SELECT * FROM classify_menu_relation WHERE 1 = 1 `
	sql += condition
	sql += ` ORDER BY create_time DESC`
	_, err = o.Raw(sql, pars).QueryRows(&list)
	return
}
