activity_special_points_company.go 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxActivitySpecialInheritPointsCompany struct {
  7. Id int `orm:"column(id);pk"`
  8. CompanyId int // 公司ID
  9. CompanyName string // 公司名称
  10. Points int // 公司剩余点数
  11. CreateTime time.Time // 创建时间
  12. ModifyTime time.Time // 更新时间
  13. ChartPermissionId int // 品种ID
  14. ChartPermissionName string // 品种名称
  15. }
  16. func AddCygxActivitySpecialPointsCompany(item *CygxActivitySpecialInheritPointsCompany) (err error) {
  17. o := orm.NewOrmUsingDB("hz_cygx")
  18. _, err = o.Insert(item)
  19. if err != nil {
  20. return
  21. }
  22. return
  23. }
  24. func AddCygxActivitySpecialInheritPointsCompanyMulti(items []*CygxActivitySpecialInheritPointsCompany) (err error) {
  25. o := orm.NewOrmUsingDB("hz_cygx")
  26. _, err = o.InsertMulti(1, items)
  27. return
  28. }
  29. func GetCygxActivitySpecialInheritPointsByCompanyId(companyId int) (list []*CygxActivitySpecialInheritPointsCompany, err error) {
  30. o := orm.NewOrmUsingDB("hz_cygx")
  31. sql := ` SELECT * FROM cygx_activity_special_inherit_points_company WHERE company_id = ? `
  32. _, err = o.Raw(sql, companyId).QueryRows(&list)
  33. return
  34. }