rs_calendar_meeting_user.go 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package roadshow
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "hongze/hongze_cygx/utils"
  5. "time"
  6. )
  7. type RsCalendarMeetingUserResp struct {
  8. RsCalendarMeetingUserId int `description:"参会名单主键ID"`
  9. RealName string `description:"用户实际名称"`
  10. Position string `description:"职位"`
  11. }
  12. type RsCalendarMeetingUser struct {
  13. RsCalendarMeetingUserId int `orm:"column(rs_calendar_meeting_user_id);pk" description:"主键ID"`
  14. RsCalendarId int `description:"日程ID"`
  15. UserId int `description:"用户ID"`
  16. Mobile string `description:"手机号"`
  17. Email string `description:"邮箱"`
  18. CompanyId int `description:"公司ID"`
  19. CompanyName string `description:"公司名称"`
  20. RealName string `description:"用户实际名称"`
  21. Position string `description:"职位"`
  22. AdminId int `description:"管理员ID"`
  23. AdminName string `description:"管理员姓名"`
  24. StartDate string `description:"开始日期"`
  25. EndDate string `description:"结束日期"`
  26. StartTime string `description:"开始时间"`
  27. EndTime string `description:"结束时间"`
  28. }
  29. // 列表
  30. func GetRsCalendarMeetingUserList(condition string, pars []interface{}) (items []*RsCalendarMeetingUser, err error) {
  31. o := orm.NewOrmUsingDB("weekly_report")
  32. sql := `SELECT
  33. art.rs_calendar_id,
  34. art.user_id,
  35. art.real_name,
  36. art.mobile,
  37. art.email,
  38. art.company_id,
  39. art.company_name,
  40. rs.start_time,
  41. rs.start_date
  42. FROM rs_calendar_meeting_user as art
  43. inner join rs_calendar_researcher as rs ON rs.rs_calendar_id = art.rs_calendar_id
  44. WHERE 1=1 `
  45. if condition != "" {
  46. sql += condition
  47. }
  48. _, err = o.Raw(sql, pars).QueryRows(&items)
  49. return
  50. }
  51. type RsCalendarResearcher struct {
  52. RsCalendarResearcherId int `orm:"column(rs_calendar_researcher_id);pk"`
  53. RsCalendarId int `description:"日历活动id"`
  54. ResearcherId int `description:"研究员id"`
  55. ResearcherName string `description:"研究员名称"`
  56. StartDate string `description:"开始日期"`
  57. EndDate string `description:"结束日期"`
  58. StartTime string `description:"开始时间"`
  59. EndTime string `description:"结束时间"`
  60. StartWeek string `description:"开始日期对应周"`
  61. EndWeek string `description:"结束日期对应周"`
  62. CreateTime time.Time
  63. ModifyTime time.Time
  64. Status int `description:"状态:1:待接受,2:已接受,3:已拒绝,4:已删除,5:已撤回,6:已结束"`
  65. RefuseReason string `description:"拒绝理由"`
  66. RefuseTime time.Time `description:"拒绝时间"`
  67. DeleteReason string `description:"删除理由"`
  68. DeleteTime time.Time `description:"删除时间"`
  69. ApproveTime time.Time `description:"接受时间"`
  70. IsSynced int `description:"是否与上海同步 0:未同步 1:已同步"`
  71. ResearcherSort int `description:"研究员新增排序"`
  72. UnionCode string `description:"公开会议联合编码"`
  73. }
  74. // 根据多个路演ID获取研究员信息
  75. func GetRsCalendarResearcherListByIds(rsCalendarIds []int) (item []*RsCalendarResearcher, err error) {
  76. if len(rsCalendarIds) == 0 {
  77. return
  78. }
  79. o := orm.NewOrmUsingDB("weekly_report")
  80. sql := `SELECT * FROM rs_calendar_researcher WHERE rs_calendar_id IN (` + utils.GetOrmInReplace(len(rsCalendarIds)) + `) `
  81. _, err = o.Raw(sql, rsCalendarIds).QueryRows(&item)
  82. return
  83. }