user_label_activity.go 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxUserLabelActivity struct {
  7. Id int `orm:"column(id);pk"`
  8. UserId int `description:"用户ID"`
  9. CompanyId int `description:"公司id"`
  10. RealName string `description:"用户实际名称"`
  11. Mobile string `description:"手机号"`
  12. Email string `description:"邮箱"`
  13. Label string `description:"标签内容"`
  14. IndustrialManagementId int `description:"cygx_industrial_management表的主键ID"`
  15. ActivityId int `description:"活动ID"`
  16. CreateTime time.Time `description:"创建时间"`
  17. ModifyTime time.Time `description:"更新时间"`
  18. }
  19. // 列表
  20. func GetCygxUserLabelActivity(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxUserLabelActivity, err error) {
  21. o := orm.NewOrmUsingDB("hz_cygx")
  22. sql := `SELECT * FROM cygx_user_label_activity as art WHERE 1= 1 `
  23. if condition != "" {
  24. sql += condition
  25. }
  26. sql += ` LIMIT ?,? `
  27. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  28. return
  29. }
  30. // 批量添加
  31. func AddCygxUserLabelActivityList(items []*CygxUserLabelActivity) (lastId int64, err error) {
  32. lenitems := len(items)
  33. if lenitems == 0 {
  34. return
  35. }
  36. o := orm.NewOrmUsingDB("hz_cygx")
  37. _, err = o.InsertMulti(1, items)
  38. return
  39. }