1234567891011121314151617181920212223242526272829 |
- package excel
- import (
- "eta_gn/eta_chart_lib/global"
- "time"
- )
- type ExcelDraft struct {
- ExcelDraftId int `gorm:"column:excel_draft_id;primaryKey" description:"excel表格草稿记录id"`
- ExcelId int `gorm:"column:excel_id" description:"excel表格id"`
- Name string `gorm:"column:name" description:"excel表格名称"`
- Content string `gorm:"column:content" description:"excel数据"`
- OpUserId int `gorm:"column:op_user_id" description:"最近一次编辑操作的用户id"`
- OpUserName string `gorm:"column:op_user_name" description:"最近一次编辑的用户名称(冗余字段,避免查表)"`
- CreateTime time.Time `gorm:"column:create_time" description:"创建时间"`
- }
- func AddExcelDraft(excelDraft *ExcelDraft) (err error) {
- o := global.DmSQL["data"]
- err = o.Create(excelDraft).Error
- return
- }
- func GetLastExcelDraftById(excelId int) (excelDraft *ExcelDraft, err error) {
- o := global.DmSQL["data"]
- sql := `select * from excel_draft where excel_id = ? order by excel_draft_id desc `
- err = o.Raw(sql, excelId).First(&excelDraft).Error
- return
- }
|