123456789101112131415161718192021222324 |
- package models
- import (
- "github.com/beego/beego/v2/client/orm"
- "time"
- )
- type SysDepartmentAddReq struct {
- DepartmentName string `description:"部门名称"`
- }
- type SysDepartment struct {
- DepartmentId int `orm:"column(department_id);pk" description:"部门Id"`
- DepartmentName string `description:"部门名称"`
- Sort int `description:"排序"`
- CreateTime time.Time `description:"创建时间"`
- }
- func GetSysDepartmentAll() (items []*SysDepartment, err error) {
- sql := `SELECT * FROM sys_department `
- o := orm.NewOrm()
- _, err = o.Raw(sql).QueryRows(&items)
- return
- }
|