cygx_morning_meeting_reviews.go 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "github.com/rdlucklib/rdluck_tools/paging"
  5. "time"
  6. )
  7. // CygxMorningMeetingReviews [...]
  8. type CygxMorningMeetingReviews struct {
  9. Id int `orm:"column(id);pk"`
  10. MeetingTime time.Time `json:"meetingTime"` // 晨会日期
  11. PublishTime time.Time `json:"publishTime"` // 发布日期
  12. CreateTime time.Time `json:"createTime"`
  13. ModifyTime time.Time `json:"modifyTime"`
  14. Status int `json:"status"` // 0:未发布,1:已发布
  15. PartNums int `json:"partNums"` // 段落数
  16. IndustryNames string `json:"industryName"` // 产业名称
  17. }
  18. // 列表
  19. func GetCygxMorningMeetingReviewsList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxMorningMeetingReviews, err error) {
  20. o := orm.NewOrm()
  21. sql := `SELECT * FROM cygx_morning_meeting_reviews WHERE 1=1 `
  22. if condition != "" {
  23. sql += condition
  24. }
  25. sql += ` LIMIT ?,? `
  26. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  27. return
  28. }
  29. func GetCygxMorningMeetingReviewsListCount(condition string, pars []interface{}) (count int, err error) {
  30. o := orm.NewOrm()
  31. sql := `SELECT COUNT(1) AS count FROM cygx_morning_meeting_reviews WHERE 1=1 `
  32. if condition != "" {
  33. sql += condition
  34. }
  35. err = o.Raw(sql, pars).QueryRow(&count)
  36. return
  37. }
  38. type CygxMorningMeetingReviewItem struct {
  39. Id int `orm:"column(id);pk"`
  40. MeetingTime string `json:"meetingTime"` // 晨会日期
  41. PublishTime string `json:"publishTime"` // 发布日期
  42. CreateTime string `json:"createTime"`
  43. ModifyTime string `json:"modifyTime"`
  44. Status int `json:"status"` // 0:未发布,1:已发布
  45. PartNums int `json:"partNums"` // 段落数
  46. IndustryNames string `json:"industryName"` // 产业名称
  47. }
  48. type CygxMorningMeetingReviewsList struct {
  49. List []*CygxMorningMeetingReviewItem
  50. Paging *paging.PagingItem `description:"分页数据"`
  51. }
  52. func GetMorningMeetingReviewById(reviewId int) (item *CygxMorningMeetingReviews, err error) {
  53. o := orm.NewOrm()
  54. sql := `SELECT * FROM cygx_morning_meeting_reviews WHERE id=?`
  55. err = o.Raw(sql, reviewId).QueryRow(&item)
  56. return
  57. }
  58. type MorningReviewPublishReq struct {
  59. ReviewIds string `description:"晨会id,多个用英文逗号隔开"`
  60. }
  61. type MorningReviewPublishCancelReq struct {
  62. ReviewId int `description:"晨会id"`
  63. }
  64. type MorningReviewDeleteReq struct {
  65. ReviewId int `description:"晨会id"`
  66. }