meeting_probabilities.go 1.5 KB

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