variety.go 1.2 KB

123456789101112131415161718192021222324252627
  1. package supply_analysis
  2. import (
  3. "eta_gn/eta_index_lib/global"
  4. "time"
  5. )
  6. // Variety variety 品种表
  7. type Variety struct {
  8. VarietyId int `gorm:"primaryKey;autoIncrement;column:variety_id" description:"品种ID"`
  9. VarietyName string `gorm:"column:variety_name" description:"品种名称"`
  10. LastUpdateSysUserId int `gorm:"column:last_update_sys_user_id" description:"最后更新人id"`
  11. LastUpdateSysUserRealName string `gorm:"column:last_update_sys_user_real_name" description:"最后更新人名称"`
  12. ProductionDay int `gorm:"column:production_day" description:"生产天数"`
  13. SysUserId int `gorm:"column:sys_user_id" description:"创建人id"`
  14. SysUserRealName string `gorm:"column:sys_user_real_name" description:"创建人姓名"`
  15. ModifyTime time.Time `gorm:"column:modify_time" description:"修改时间"`
  16. CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
  17. }
  18. // GetVarietyById 根据品种id获取品种详情
  19. func GetVarietyById(id int) (item *Variety, err error) {
  20. sql := `SELECT * FROM variety WHERE variety_id = ?`
  21. err = global.DEFAULT_DmSQL.Raw(sql, id).First(&item).Error
  22. return
  23. }