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