12345678910111213141516171819202122232425 |
- package models
- import "github.com/beego/beego/v2/client/orm"
- type SysDepartment struct {
- SysDepartmentId int `json:"sysDepartmentId"`
- SysDepartmentName string `json:"sysDepartmentName"`
- ParentId int `json:"sysDepartmentParentId"`
- Sort int `json:"sysDepartmentSort"`
- Level int `json:"level"`
- }
- func GetSysDepartmentByName(sysDepartmentName string) (item *SysDepartment, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM sys_department WHERE sys_department_name = ?`
- err = o.Raw(sql, sysDepartmentName).QueryRow(&item)
- return
- }
- func GetSysDepartmentById(sysDepartmentId int) (item *SysDepartment, err error) {
- o := orm.NewOrm()
- sql := `SELECT * FROM sys_department WHERE sys_department_Id = ?`
- err = o.Raw(sql, sysDepartmentId).QueryRow(&item)
- return
- }
|