meeting_probabilities.go 1.4 KB

1234567891011121314151617181920212223242526272829
  1. package models
  2. import (
  3. "eta_gn/eta_api/global"
  4. "time"
  5. )
  6. type MeetingProbabilities struct {
  7. MeetingInfoId int `gorm:"column:meeting_info_id;primaryKey;type:int" orm:"column(meeting_info_id);pk" gorm:"primaryKey" description:"会议信息ID"`
  8. DateTime string `gorm:"column:DATE_TIME;type:varchar(255)" orm:"column(datetime)" description:"数据日期"`
  9. Content string `gorm:"column:CONTENT;type:varchar(255)" orm:"column(content)" description:"表格内容"`
  10. ExcelImage string `gorm:"column:EXCEL_IMAGE;type:varchar(255)" orm:"column(excel_image)" description:"表格图片"`
  11. IsDelete int `gorm:"column:IS_DELETE;type:int" orm:"column(is_delete)" description:"是否删除,0:未删除,1:已删除"`
  12. CreateTime time.Time `gorm:"column:CREATE_TIME;type:datetime" orm:"column(create_time)" description:"创建时间"`
  13. ModifyTime time.Time `gorm:"column:MODIFY_TIME;type:datetime" orm:"column(modify_time)" description:"修改时间"`
  14. }
  15. func GetMeetingInfoById(dateTime string) (item *MeetingProbabilities, err error) {
  16. sql := ``
  17. if dateTime == "" {
  18. sql = ` SELECT * FROM meeting_probabilities WHERE is_delete=0 ORDER BY create_time DESC LIMIT 1 `
  19. err = global.DmSQL["data"].Raw(sql).First(&item).Error
  20. return
  21. } else {
  22. sql = ` SELECT * FROM meeting_probabilities WHERE date_time=? AND is_delete=0 `
  23. err = global.DmSQL["data"].Raw(sql, dateTime).First(&item).Error
  24. return
  25. }
  26. }