cygx_activity_special_points_company.go 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. package data_manage
  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 AddCygxActivitySpecialInheritPointsCompanyMulti(items []*CygxActivitySpecialInheritPointsCompany) (err error) {
  17. o := orm.NewOrmUsingDB("hz_cygx")
  18. _, err = o.InsertMulti(1, items)
  19. return
  20. }
  21. func GetCygxActivitySpecialInheritPointsByCompanyId(companyId int) (list []*CygxActivitySpecialInheritPointsCompany, err error) {
  22. o := orm.NewOrmUsingDB("hz_cygx")
  23. sql := ` SELECT * FROM cygx_activity_special_inherit_points_company WHERE company_id = ? `
  24. _, err = o.Raw(sql,companyId).QueryRows(&list)
  25. return
  26. }
  27. func DelCygxActivitySpecialInheritPointsByCompanyId(companyId int) (err error) {
  28. o := orm.NewOrmUsingDB("hz_cygx")
  29. sql := ` DELETE FROM cygx_activity_special_inherit_points_company WHERE company_id = ? `
  30. _, err = o.Raw(sql,companyId).Exec()
  31. return
  32. }