user_data.go 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. package models
  2. import "time"
  3. // UserData 用户数据表
  4. type UserData struct {
  5. ID uint `gorm:"primarykey;autoIncrement" json:"id"`
  6. CreatedAt time.Time `gorm:"comment:创建时间" json:"created_at"`
  7. UpdatedAt time.Time `gorm:"comment:更新时间" json:"updated_at"`
  8. DeletedAt *time.Time `gorm:"comment:删除时间" json:"deleted_at"`
  9. IsDeleted int `gorm:"comment:是否删除 1:是 0:否" json:"is_deleted"`
  10. // 基本信息
  11. UserID string `gorm:"type:varchar(255);comment:用户ID" json:"user_id"`
  12. Name string `gorm:"type:varchar(255);comment:姓名" json:"name"`
  13. LogicDelete string `gorm:"type:varchar(50);comment:逻辑删除标记" json:"logic_delete"`
  14. // 组织信息
  15. OrgCode string `gorm:"type:varchar(255);comment:组织代码" json:"org_code"`
  16. OrgName string `gorm:"type:varchar(500);comment:组织名称" json:"org_name"`
  17. OrgPath string `gorm:"type:text;comment:组织路径" json:"org_path"`
  18. OrgPathCN string `gorm:"type:text;comment:组织路径中文" json:"org_path_cn"`
  19. OrgInfos string `gorm:"type:text;comment:组织信息" json:"org_infos"`
  20. // 用户详情
  21. UserCode string `gorm:"type:varchar(255);comment:用户代码" json:"user_code"`
  22. Sex string `gorm:"type:varchar(10);comment:性别" json:"sex"`
  23. Birthday string `gorm:"type:varchar(50);comment:生日" json:"birthday"`
  24. // 身份信息
  25. IdentificationNumber string `gorm:"type:varchar(50);comment:身份证号" json:"identification_number"`
  26. // 籍贯民族信息
  27. Nation string `gorm:"type:varchar(100);comment:民族" json:"nation"`
  28. NationCode string `gorm:"type:varchar(50);comment:民族代码" json:"nation_code"`
  29. NativePlace string `gorm:"type:varchar(255);comment:籍贯" json:"native_place"`
  30. // 教育信息
  31. EducationBackground string `gorm:"type:varchar(255);comment:教育背景" json:"education_background"`
  32. EducationBackgroundCode string `gorm:"type:varchar(50);comment:教育背景代码" json:"education_background_code"`
  33. // 专业技术职务
  34. ProfessionalAndTechnicalPositions string `gorm:"type:varchar(255);comment:专业技术职务" json:"professional_and_technical_positions"`
  35. ProfessionalAndTechnicalPositionsCode string `gorm:"type:varchar(50);comment:专业技术职务代码" json:"professional_and_technical_positions_code"`
  36. // 政治面貌
  37. PoliticCountenance string `gorm:"type:varchar(255);comment:政治面貌" json:"politic_countenance"`
  38. PoliticCountenanceCode string `gorm:"type:varchar(50);comment:政治面貌代码" json:"politic_countenance_code"`
  39. // 职位信息
  40. PositionName string `gorm:"type:varchar(255);comment:职位名称" json:"position_name"`
  41. PositoinCode string `gorm:"type:varchar(50);comment:职位代码" json:"positoin_code"` // 注意:原数据库拼写为 positoin
  42. // 入职信息
  43. OnBoardDay string `gorm:"type:varchar(50);comment:入职日期" json:"on_board_day"`
  44. // 联系方式
  45. ContactNumber string `gorm:"type:varchar(50);comment:联系电话" json:"contact_number"`
  46. Mobile string `gorm:"type:varchar(50);comment:手机号" json:"mobile"`
  47. // 其他字段
  48. UserStatus string `gorm:"type:varchar(50);comment:用户状态" json:"user_status"`
  49. FZJ string `gorm:"type:varchar(255);comment:分组" json:"fzj"`
  50. FZJDm string `gorm:"type:varchar(50);comment:分组代码" json:"fzj_dm"`
  51. HrRylb string `gorm:"type:varchar(255);comment:人力资源人员类别" json:"hr_rylb"`
  52. // 4A账号相关
  53. AccountID string `gorm:"type:varchar(100);comment:4A账号ID" json:"accountID"`
  54. // 系统字段(这些字段如果存在会与BaseModel冲突,注释掉保留作为备用)
  55. // DbCreatedAt string `gorm:"type:varchar(50);comment:数据库创建时间" json:"db_created_at"`
  56. // RowNumber int `gorm:"comment:行号" json:"row_number"`
  57. }
  58. // TableName 指定表名
  59. func (UserData) TableName() string {
  60. return "user_data"
  61. }