Ingen beskrivning
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 1.9KB

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