excel_sheet.go 936 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package excel
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. // ExcelSheet excel表格详情表
  7. type ExcelSheet struct {
  8. ExcelSheetId int `orm:"column(excel_sheet_id);pk"`
  9. ExcelInfoId int `description:"excel的id"`
  10. SheetName string `description:"sheet名称"`
  11. order int `description:"排序"`
  12. ModifyTime time.Time `description:"最近修改日期"`
  13. CreateTime time.Time `description:"创建日期"`
  14. }
  15. // Update 更新 excel表格的sheet基础信息
  16. func (excelSheet *ExcelSheet) Update(cols []string) (err error) {
  17. o := orm.NewOrmUsingDB("data")
  18. _, err = o.Update(excelSheet, cols...)
  19. return
  20. }
  21. // AddExcelSheet 新增excel表格的sheet基础信息
  22. func AddExcelSheet(excelInfo *ExcelSheet) (err error) {
  23. o := orm.NewOrmUsingDB("data")
  24. // 表格信息入库
  25. lastId, err := o.Insert(excelInfo)
  26. if err != nil {
  27. return
  28. }
  29. excelInfo.ExcelInfoId = int(lastId)
  30. return
  31. }