rai_serve_week_bill.go 1.0 KB

123456789101112131415161718192021222324252627
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CygxRaiServeWeekBill struct {
  7. ServeWeekBillId int `orm:"column(serve_week_bill_id);pk" description:"服务周账单ID"`
  8. CompanyId int `comment:"公司ID"`
  9. CompanyName string `comment:"公司名称"`
  10. UserTotal int `comment:"用户数量"`
  11. WeekServeCount float64 `comment:"周度服务量总计"`
  12. CoverageRate float64 `comment:"覆盖率"`
  13. WeekStartDate string `comment:"周一开始日期"`
  14. WeekEndDate string `comment:"周日结束日期"`
  15. CreateTime time.Time `comment:"创建时间"`
  16. ModifyTime time.Time `comment:"修改时间"`
  17. }
  18. // 最近四周覆盖率列表
  19. func GetCygxRaiServeBillListWeek4(companyId int) (items []*CygxRaiServeWeekBill, err error) {
  20. o := orm.NewOrmUsingDB("hz_cygx")
  21. sql := `SELECT * FROM cygx_rai_serve_week_bill WHERE company_id = ? ORDER BY week_start_date DESC LIMIT 4 `
  22. _, err = o.Raw(sql, companyId).QueryRows(&items)
  23. return
  24. }