organization.go 939 B

123456789101112131415161718192021
  1. // 自动生成模板Organization
  2. package autocode
  3. import "gorm.io/gorm"
  4. // Organization 结构体
  5. // 如果含有time.Time 请自行import time包
  6. type Organization struct {
  7. CODE string `json:"code" form:"code" gorm:"column:CODE;comment:;type:varchar(20);"`
  8. NAME string `json:"name" form:"name" gorm:"column:NAME;comment:;type:varchar(50);"`
  9. PARENTCODE string `json:"parentcode" form:"parentcode" gorm:"column:PARENT_CODE;comment:;type:varchar(20);"`
  10. Optimistic *int `json:"optimistic" form:"optimistic" gorm:"column:optimistic;comment:;type:int"`
  11. Postition string `json:"postition" form:"postition" gorm:"column:postition;comment:;type:varchar(225);"`
  12. Children []Organization `json:"children" gorm:"-"`
  13. DeletedAt gorm.DeletedAt `gorm:"index" json:"-"` // 删除时间
  14. }
  15. // TableName Organization 表名
  16. func (Organization) TableName() string {
  17. return "organization"
  18. }