report_selection_log_apply.go 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. package cygx
  2. import (
  3. "github.com/beego/beego/v2/client/orm"
  4. )
  5. type CygxReportSelectionLogApplyResp struct {
  6. ReportSelectionLogApplyId int `orm:"column(report_selection_log_apply_id);pk"`
  7. UserId int
  8. CreateTime string
  9. Mobile string `description:"手机号"`
  10. Email string `description:"邮箱"`
  11. CompanyId int `description:"公司id"`
  12. CompanyName string `description:"公司名称"`
  13. RealName string `description:"用户实际名称"`
  14. SellerName string `description:"所属销售"`
  15. RegisterPlatform int `description:"来源 1小程序,2:网页"`
  16. ArticleId int `description:"报告Id"`
  17. IndustrialSubjectId int `description:"标的ID"`
  18. SubjectName string `description:"标的名称"`
  19. }
  20. type CygxReportSelectionLogApplyListResp struct {
  21. List []*CygxReportSelectionLogApplyResp
  22. }
  23. // 获取数量
  24. func GetCygxReportSelectionLogApplyCount(condition string, pars []interface{}) (count int, err error) {
  25. sqlCount := ` SELECT COUNT(1) AS count FROM cygx_report_selection_log_apply as art WHERE 1= 1 `
  26. if condition != "" {
  27. sqlCount += condition
  28. }
  29. o := orm.NewOrmUsingDB("hz_cygx")
  30. err = o.Raw(sqlCount, pars).QueryRow(&count)
  31. return
  32. }
  33. // 列表
  34. func GetCygxReportSelectionLogApplyRespList(condition string, pars []interface{}, startSize, pageSize int) (items []*CygxReportSelectionLogApplyResp, err error) {
  35. o := orm.NewOrmUsingDB("hz_cygx")
  36. sql := `SELECT * FROM cygx_report_selection_log_apply as art WHERE 1= 1 `
  37. if condition != "" {
  38. sql += condition
  39. }
  40. if startSize+pageSize > 0 {
  41. sql += ` LIMIT ?,? `
  42. _, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
  43. } else {
  44. _, err = o.Raw(sql, pars).QueryRows(&items)
  45. }
  46. return
  47. }