user.go 1.6 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package gn
  2. import "eta_gn/eta_bridge/global"
  3. // OaDept OA部门
  4. type OaDept struct {
  5. DepartmentId string `json:"dept_id" description:"部门ID"`
  6. DepartmentName string `json:"deptname" description:"部门名称"`
  7. ParentDepartmentId string `json:"pdeptid" description:"上级部门名称"`
  8. }
  9. // OaUser OA用户
  10. type OaUser struct {
  11. AddrName string `gorm:"column:addr_name" json:"addr_name" description:"姓名"`
  12. AddrUserId string `gorm:"column:addr_Userid" json:"addr_Userid" description:"用户ID"`
  13. AddrOfficeTel string `gorm:"column:addr_OfficeTel" json:"addr_OfficeTel" description:"办公电话"`
  14. AddrMobilePhone string `gorm:"column:addr_MobilePhone" json:"addr_MobilePhone" description:"手机号"`
  15. AddrJobTitle string `gorm:"column:addr_JobTitle" json:"addr_JobTitle" description:"职位"`
  16. AddrEmployeeId string `gorm:"column:addr_EMPLOYEEID" json:"addr_EMPLOYEEID" description:""`
  17. AddrDepartmentFullName string `gorm:"column:addr_DepFullname" json:"addr_DepFullname" description:"部门全称, 格式:直属部门/上级部门/顶级部门, 层级不定"`
  18. OEmployeeNo string `gorm:"column:o_EMPLOYEENO" json:"o_EMPLOYEENO" description:"OA工号"`
  19. }
  20. // GetGnOaDepartment 获取OA部门
  21. func GetGnOaDepartment() (items []*OaDept, err error) {
  22. sql := `SELECT * FROM oa_dept `
  23. err = global.MYSQL["oa_user"].Raw(sql).Find(&items).Error
  24. return
  25. }
  26. // GetGnOaUser 获取OA用户
  27. func GetGnOaUser() (items []*OaUser, err error) {
  28. sql := `SELECT * FROM oa_user `
  29. err = global.MYSQL["oa_user"].Raw(sql).Find(&items).Error
  30. return
  31. }