company_report_permission.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. package models
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. "time"
  5. )
  6. type CompanyReportPermission struct {
  7. CompanyReportPermissionId int64 `orm:"column(company_report_permission_id);pk"`
  8. CompanyId int
  9. ReportPermissionId int
  10. CreatedTime time.Time
  11. LastUpdatedTime time.Time
  12. ChartPermissionId int
  13. StartDate string `description:"权限开始日期"`
  14. EndDate string `description:"权限结束日期"`
  15. ProductId int `description:"产品id"`
  16. ProductName string `description:"产品名称"`
  17. CompanyContractId int `description:"合同id"`
  18. Status string `description:"'正式','试用','关闭'"`
  19. ModifyTime string `description:"修改时间"`
  20. IsUpgrade int `description:"是否升级,1是,0否"`
  21. ExpensiveYx int `description:"权益研选: 0-3w; 1-5w"`
  22. }
  23. // 通过查询条件获取详情
  24. func GetCompanyReportPermissionDetailByCondition(condition string, pars []interface{}) (item *CompanyReportPermission, err error) {
  25. if condition == "" {
  26. return
  27. }
  28. o := orm.NewOrmUsingDB("weekly_report")
  29. sql := `SELECT * FROM company_report_permission WHERE 1 = 1 ` + condition
  30. err = o.Raw(sql, pars).QueryRow(&item)
  31. return
  32. }
  33. // 列表
  34. func GetCompanyReportPermissionList(condition string, pars []interface{}) (items []*CompanyReportPermission, err error) {
  35. o := orm.NewOrmUsingDB("weekly_report")
  36. sql := `SELECT * FROM company_report_permission WHERE 1= 1 `
  37. if condition != "" {
  38. sql += condition
  39. }
  40. _, err = o.Raw(sql, pars).QueryRows(&items)
  41. return
  42. }