Açıklama Yok
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

dim_store_group.go 1.7KB

12345678910111213141516171819202122232425262728293031323334
  1. package tables
  2. import (
  3. "time"
  4. "git.x2erp.com/qdy/go-db/sqldef"
  5. )
  6. func init() {
  7. sqldef.AddRegistration(func(r *sqldef.Registry) {
  8. tb := sqldef.NewTable("dim_store_group", "店铺组档案表").
  9. ID("group_id", 32).Comment("店铺组ID,主键").End().
  10. String("group_code", 32).NotNull().Unique().Comment("店铺组编码").End().
  11. String("group_name", 64).NotNull().Comment("店铺组名称(如:华东A类店)").End().
  12. String("group_type", 32).NotNull().Comment("分组类型(区域/城市等级/渠道/店铺等级)").End().
  13. String("description", 255).Comment("分组描述").End().
  14. String("creator", 32).NotNull().Comment("创建人").End().
  15. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
  16. r.RegisterTable(tb.Build())
  17. })
  18. }
  19. type DimStoreGroup struct {
  20. GroupID string `gorm:"column:group_id;type:varchar(32);primaryKey;not null;comment:店铺组ID,主键"`
  21. GroupCode string `gorm:"column:group_code;type:varchar(32);not null;unique;comment:店铺组编码"`
  22. GroupName string `gorm:"column:group_name;type:varchar(64);not null;comment:店铺组名称(如:华东A类店)"`
  23. GroupType string `gorm:"column:group_type;type:varchar(32);not null;comment:分组类型(区域/城市等级/渠道/店铺等级)"`
  24. Description string `gorm:"column:description;type:varchar(255);comment:分组描述"`
  25. Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
  26. CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  27. TenantId string `gorm:"column:tenant_id;type:varchar(8);comment:租户ID"`
  28. }
  29. func (DimStoreGroup) TableName() string { return "dim_store_group" }