entity.go 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package research_group
  2. import "time"
  3. // ResearchGroup 研究方向分组表
  4. type ResearchGroup struct {
  5. ResearchGroupID int `gorm:"primaryKey;column:research_group_id;type:int(10) unsigned;not null" json:"-"` // 研究方向分组ID
  6. ResearchGroupName string `gorm:"column:research_group_name;type:varchar(100);not null;default:''" json:"researchGroupName"` // 研究方向分组名称
  7. ParentID int `gorm:"column:parent_id;type:int(10) unsigned;not null;default:0" json:"parentId"` // 父类ID
  8. ChartPermissionID int `gorm:"column:chart_permission_id;type:int(10) unsigned;not null;default:0" json:"chartPermissionId"` // 品种权限ID
  9. Sort int `gorm:"column:sort;type:int(10) unsigned;not null;default:0" json:"sort"` // 排序
  10. State int `gorm:"column:state;type:tinyint(4) unsigned;not null;default:1" json:"state"` // 显示状态 0-不显示 1-显示
  11. CreateTime time.Time `gorm:"column:create_time;type:datetime;default:CURRENT_TIMESTAMP" json:"createTime"` // 创建时间
  12. ModifyTime time.Time `gorm:"column:modify_time;type:datetime;default:CURRENT_TIMESTAMP" json:"modifyTime"` // 更新时间
  13. }
  14. // TableName get sql table name.获取数据库表名
  15. func (m *ResearchGroup) TableName() string {
  16. return "research_group"
  17. }
  18. // ResearchGroupColumns get sql column name.获取数据库列名
  19. var ResearchGroupColumns = struct {
  20. ResearchGroupID string
  21. ResearchGroupName string
  22. ParentID string
  23. ChartPermissionID string
  24. Sort string
  25. State string
  26. CreateTime string
  27. ModifyTime string
  28. }{
  29. ResearchGroupID: "research_group_id",
  30. ResearchGroupName: "research_group_name",
  31. ParentID: "parent_id",
  32. ChartPermissionID: "chart_permission_id",
  33. Sort: "sort",
  34. State: "state",
  35. CreateTime: "create_time",
  36. ModifyTime: "modify_time",
  37. }