설명 없음
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_season.go 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  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_season", "季节波段档案表").
  9. ID("season_id", 32).Comment("季节波段ID,主键").End().
  10. String("season_code", 32).NotNull().Unique().Comment("季节编码(如:2024FA)").End().
  11. String("season_name", 64).NotNull().Comment("季节名称(如:2024秋冬)").End().
  12. Int("year").NotNull().Comment("年份").End().
  13. String("phase", 32).NotNull().Comment("季节(春/夏/秋/冬)").End().
  14. DateTime("plan_start").NotNull().Comment("季节计划开始日期").End().
  15. DateTime("plan_end").NotNull().Comment("季节计划结束日期").End().
  16. String("creator", 32).NotNull().Comment("创建人").End().
  17. String("tenant_id", 8).NotNull().Comment("租户ID").End().
  18. DateTime("created_at").NotNull().Default("CURRENT_TIMESTAMP").Comment("创建时间").End()
  19. r.RegisterTable(tb.Build())
  20. })
  21. }
  22. type DimSeason struct {
  23. SeasonID string `gorm:"column:season_id;type:varchar(32);primaryKey;not null;comment:季节波段ID,主键"`
  24. SeasonCode string `gorm:"column:season_code;type:varchar(32);not null;unique;comment:季节编码(如:2024FA)"`
  25. SeasonName string `gorm:"column:season_name;type:varchar(64);not null;comment:季节名称(如:2024秋冬)"`
  26. Year int `gorm:"column:year;not null;comment:年份"`
  27. Phase string `gorm:"column:phase;type:varchar(32);not null;comment:季节(春/夏/秋/冬)"`
  28. PlanStart time.Time `gorm:"column:plan_start;not null;comment:季节计划开始日期"`
  29. PlanEnd time.Time `gorm:"column:plan_end;not null;comment:季节计划结束日期"`
  30. Creator string `gorm:"column:creator;type:varchar(32);not null;comment:创建人"`
  31. CreatedAt time.Time `gorm:"column:created_at;not null;default:CURRENT_TIMESTAMP;comment:创建时间"`
  32. TenantId string `gorm:"column:tenant_id;type:varchar(8);comment:租户ID"`
  33. }
  34. func (DimSeason) TableName() string { return "dim_season" }