yidong_activity.go 5.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package yidong
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "hongze/hongze_cygx/utils"
  5. "time"
  6. )
  7. type CygxYidongActivity struct {
  8. Id string `json:"id" comment:"主键ID"`
  9. YidongId string `json:"yidong_id" comment:"活动唯一标识"`
  10. CompanyInfo string `json:"company_info" comment:"公司信息"`
  11. Title string `json:"title" comment:"活动标题"`
  12. Type string `json:"type" comment:"活动类型"`
  13. IndustrySwName string `json:"industry_sw_name" comment:"行业名称"`
  14. Start string `json:"start" comment:"开始时间"`
  15. End string `json:"end" comment:"结束时间"`
  16. SignUpStart string `json:"sign_up_start" comment:"报名开始时间"`
  17. SignUpEnd string `json:"sign_up_end" comment:"报名结束时间"`
  18. ActivityJoinType string `json:"activity_join_type" comment:"参与类型"`
  19. Banner string `json:"banner" comment:"活动横幅链接"`
  20. Url string `json:"url" comment:"活动链接"`
  21. SyncId string `json:"sync_id" comment:"同步ID"`
  22. SyncFlag string `json:"sync_flag" comment:"同步标志"`
  23. BusinessCardOpen string `json:"business_card_open" comment:"是否打开名片"`
  24. BusinessCardRequired string `json:"business_card_required" comment:"是否要求名片"`
  25. PersonNameOpen string `json:"person_name_open" comment:"是否打开姓名"`
  26. PersonNameRequired string `json:"person_name_required" comment:"是否要求姓名"`
  27. PersonTelephoneOpen string `json:"person_telephone_open" comment:"是否打开电话"`
  28. PersonTelephoneRequired string `json:"person_telephone_required" comment:"是否要求电话"`
  29. MailOpen string `json:"mail_open" comment:"是否打开邮件"`
  30. MailRequired string `json:"mail_required" comment:"是否要求邮件"`
  31. CompanyShortNameOpen string `json:"company_short_name_open" comment:"是否打开公司简称"`
  32. CompanyShortNameRequired string `json:"company_short_name_required" comment:"是否要求公司简称"`
  33. CompanyCodeOpen string `json:"company_code_open" comment:"是否打开公司代码"`
  34. CompanyCodeRequired string `json:"company_code_required" comment:"是否要求公司代码"`
  35. JobNameOpen string `json:"job_name_open" comment:"是否打开职位名称"`
  36. JobNameRequired string `json:"job_name_required" comment:"是否要求职位名称"`
  37. CertificateInformationOpen string `json:"certificate_information_open" comment:"是否打开证书信息"`
  38. CertificateInformationRequired string `json:"certificate_information_required" comment:"是否要求证书信息"`
  39. InviteeOpen *string `json:"invitee_open" comment:"是否打开受邀人"`
  40. InviteeRequired *string `json:"invitee_required" comment:"是否要求受邀人"`
  41. CreateUserId string `json:"create_user_id" comment:"创建用户ID"`
  42. CreatePersonName string `json:"create_person_name" comment:"创建人姓名"`
  43. PublishFlag string `json:"publish_flag" comment:"发布标志"`
  44. CompanyCode string `json:"company_code" comment:"公司代码"`
  45. BackFlag string `json:"back_flag" comment:"回退标志"`
  46. ActivityForm string `json:"activity_form" comment:"活动形式"`
  47. ActivityAddress string `json:"activity_address" comment:"活动地址"`
  48. MeetingStatus string `json:"meeting_status" comment:"会议状态"`
  49. CloudMeetingStatus string `json:"cloud_meeting_status" comment:"云会议状态"`
  50. InteractQaStatus string `json:"interact_qa_status" comment:"互动问答状态"`
  51. LiveStatus string `json:"live_status" comment:"直播状态"`
  52. CreateTime time.Time `comment:"创建时间"`
  53. }
  54. // AddCygxYidongActivityMulti 批量添加
  55. func AddCygxYidongActivityMulti(items []*CygxYidongActivity) (err error) {
  56. if len(items) == 0 {
  57. return
  58. }
  59. o, err := orm.NewOrm().Begin()
  60. if err != nil {
  61. return
  62. }
  63. defer func() {
  64. if err == nil {
  65. o.Commit()
  66. } else {
  67. o.Rollback()
  68. }
  69. }()
  70. if len(items) > 0 {
  71. _, err = o.InsertMulti(len(items), items)
  72. }
  73. return
  74. }
  75. // 列表
  76. func GetCygxYidongActivityListByYidongIds(yidongIds []string) (items []*CygxYidongActivity, err error) {
  77. lenarr := len(yidongIds)
  78. if lenarr == 0 {
  79. return
  80. }
  81. o := orm.NewOrm()
  82. sql := `SELECT yidong_id FROM cygx_yidong_activity WHERE yidong_id IN (` + utils.GetOrmInReplace(lenarr) + `) `
  83. _, err = o.Raw(sql, yidongIds).QueryRows(&items)
  84. return
  85. }