rai_serve_bill.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package cygx
  2. import "github.com/beego/beego/v2/client/orm"
  3. type RaiServeTypeResp struct {
  4. ServeTypeId int `description:"服务类型id"`
  5. ServeTypeName string `description:"服务类型名称"`
  6. }
  7. type RaiServeTypeListResp struct {
  8. List []*RaiServeTypeResp
  9. }
  10. // 服务类型列表
  11. func GetRaiServeTypeRespList(condition string) (items []*RaiServeTypeResp, err error) {
  12. o := orm.NewOrmUsingDB("hz_cygx")
  13. sql := `SELECT * FROM cygx_rai_serve_type WHERE 1= 1 `
  14. if condition != "" {
  15. sql += condition
  16. }
  17. sql += ` ORDER BY sort DESC LIMIT 100 `
  18. _, err = o.Raw(sql).QueryRows(&items)
  19. return
  20. }
  21. type RaiServeTagResp struct {
  22. TagType int `description:"标签类型"`
  23. TagId int `description:"标签ID"`
  24. TagName string `description:"标签名称"`
  25. Md5Key string `description:"加密key,前端找参数当唯一索引值使用"`
  26. }
  27. type RaiServeTagListResp struct {
  28. List []*RaiServeTagResp
  29. }
  30. type RaiServeCoverageRateResp struct {
  31. List []string
  32. }
  33. // 服务类型列表
  34. func GetRaiServeSearchTagRespList(keywords string) (items []*RaiServeTagResp, err error) {
  35. o := orm.NewOrmUsingDB("hz_cygx")
  36. sql := `SELECT
  37. 1 AS tag_type,
  38. i.industrial_management_id AS tag_id,
  39. i.industry_name AS tag_name,
  40. i.create_time
  41. FROM
  42. cygx_industrial_management AS i
  43. WHERE
  44. 1 = 1
  45. AND i.chart_permission_id IN ( 19, 20, 21, 22 )
  46. AND i.industry_name LIKE '%` + keywords + `%' UNION ALL
  47. SELECT
  48. 2 AS tag_type,
  49. s.industrial_subject_id AS tag_id,
  50. s.subject_name AS tag_name,
  51. s.create_time
  52. FROM
  53. cygx_industrial_subject AS s
  54. INNER JOIN cygx_industrial_management AS i ON i.industrial_management_id = s.industrial_management_id
  55. WHERE
  56. 1 = 1
  57. AND i.chart_permission_id IN ( 19, 20, 21, 22 )
  58. AND s.subject_name LIKE '%` + keywords + `%'
  59. ORDER BY
  60. create_time ASC `
  61. _, err = o.Raw(sql).QueryRows(&items)
  62. return
  63. }
  64. // 权益服务明细表
  65. type CygxRaiServeBillResp struct {
  66. Content string `comment:"服务内容说明"`
  67. ServeTypeName string `comment:"服务类型"`
  68. Mobile string `comment:"手机号"`
  69. Email string `comment:"邮箱"`
  70. RealName string `comment:"用户实际名称"`
  71. ServeCount float64 `comment:"服务量小计"`
  72. Tag string `comment:"标签,多个用 , 隔开"`
  73. IsKp int `comment:"是否是KP,1:是、0:否"`
  74. ViewTime string `comment:"浏览时间"`
  75. }
  76. type CygxRaiServeBillListResp struct {
  77. CompanyName string `comment:"公司名称"`
  78. List []*CygxRaiServeBillResp
  79. }
  80. // 列表
  81. func GetCygxRaiServeBillRespList(condition string, pars []interface{}) (items []*CygxRaiServeBillResp, err error) {
  82. o := orm.NewOrmUsingDB("hz_cygx")
  83. sql := `SELECT * FROM cygx_rai_serve_bill as art WHERE 1= 1 `
  84. if condition != "" {
  85. sql += condition
  86. }
  87. sql += ` ORDER BY bill_id DESC LIMIT 1000 `
  88. _, err = o.Raw(sql, pars).QueryRows(&items)
  89. return
  90. }