report_selection_subject_history.go 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxReportSelectionSubjectHistory struct {
  7. Id int `orm:"column(id);pk"`
  8. ArticleId int `description:"文章ID"`
  9. UserId int `description:"用户ID"`
  10. CreateTime time.Time `description:"创建时间"`
  11. ModifyTime time.Time `description:"修改时间"`
  12. Mobile string `description:"手机号"`
  13. Email string `description:"邮箱"`
  14. CompanyId int `description:"公司id"`
  15. CompanyName string `description:"公司名称"`
  16. IndustrialSubjectId int `description:"标的ID"`
  17. IndustrialManagementId int `description:"产业Id"`
  18. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  19. ThirdId int `description:"类似产业、标的的三方ID"`
  20. LableName string `description:"标签名称"`
  21. }
  22. type AddCygxReportSelectionSubjectHistoryReq struct {
  23. ArticleId int `description:"文章id"`
  24. IndustrialSubjectId int `description:"标的ID"`
  25. IndustrialManagementId int `description:"产业Id"`
  26. ThirdId int `description:"类似产业、标的的三方ID"`
  27. }
  28. // 添加
  29. func AddCygxReportSelectionSubjectHistory(item *CygxReportSelectionSubjectHistory) (err error) {
  30. o := orm.NewOrm()
  31. _, err = o.Insert(item)
  32. return
  33. }
  34. // 列表
  35. func GetCygxReportSelectionSubjectHistory() (items []*CygxReportSelectionSubjectHistory, err error) {
  36. o := orm.NewOrm()
  37. sql := `SELECT * FROM cygx_report_selection_subject_history as art WHERE 1= 1 `
  38. _, err = o.Raw(sql).QueryRows(&items)
  39. return
  40. }
  41. func UpdateCygxReportSelectionSubjectHistoryName(lableName string, id int) (err error) {
  42. o := orm.NewOrm()
  43. sql := `UPDATE cygx_report_selection_subject_history SET lable_name=? WHERE id = ? `
  44. _, err = o.Raw(sql, lableName, id).Exec()
  45. return
  46. }