ChannelPopularizeView.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package com.cyksj.model.views;
  2. import com.ejlchina.searcher.bean.DbField;
  3. import com.ejlchina.searcher.bean.DbIgnore;
  4. import com.ejlchina.searcher.bean.SearchBean;
  5. import lombok.Getter;
  6. import lombok.Setter;
  7. import java.math.BigDecimal;
  8. import java.util.Date;
  9. /**
  10. * @author chan
  11. * @date 2022/12/13 2:54 PM
  12. */
  13. @Getter
  14. @Setter
  15. @SearchBean(tables = "channel_popularize cp " +
  16. " LEFT JOIN order_don o on cp.id = o.popularize_id :time: " +
  17. " LEFT JOIN order_don o1 on o.id = o1.id and o1.`status` not in ('close','noPayment')" +
  18. " LEFT JOIN order_don o2 on o.id = o2.id and o2.`status` = 'refund' " +
  19. " LEFT JOIN channel c on c.id = cp.channel_id "
  20. ,distinct = true
  21. ,groupBy = "cp.id,cp.name,cp.url,cp.modality,cp.pay_method,cp.created_time,cp.update_time"
  22. )
  23. public class ChannelPopularizeView {
  24. @DbField("cp.id")
  25. private Long id;
  26. /**
  27. * 渠道id
  28. */
  29. @DbField("cp.channel_id")
  30. private Long channelId;
  31. /**
  32. * 渠道名称
  33. */
  34. @DbField("c.name")
  35. private String channelName;
  36. /**
  37. * 链接名称
  38. */
  39. @DbField("cp.name")
  40. private String name;
  41. /**
  42. * url
  43. */
  44. @DbField("cp.url")
  45. private String url;
  46. /**
  47. * 样式
  48. */
  49. @DbField("cp.modality")
  50. private String modality;
  51. /**
  52. * 支付方式
  53. */
  54. @DbField("cp.pay_method")
  55. private String payMethod;
  56. @DbField("cp.is_show_sku")
  57. private Boolean isShowSku;
  58. @DbField("cp.is_show_logo")
  59. private Boolean isShowLogo;
  60. /**
  61. * 浏览数
  62. */
  63. @DbField("select count(v.id) from channel_popularize_visit v where v.popularize_id = cp.id ")
  64. private Integer visit;
  65. /**
  66. * 邮箱注册人数
  67. */
  68. @DbIgnore
  69. private Integer emailCount;
  70. /**
  71. * 手机注册人数
  72. */
  73. @DbIgnore
  74. private Integer phoneCount;
  75. /**
  76. * 网页端支付订单数
  77. */
  78. private Integer numOfOrderWebPay;
  79. /**
  80. * 订单数
  81. */
  82. @DbField("count(o1.id)")
  83. private Integer orderCount;
  84. /**
  85. * 订单金额
  86. */
  87. @DbField("IFNULL(sum(o1.money),0)")
  88. private BigDecimal orderMoney;
  89. /**
  90. * 退款订单数
  91. */
  92. @DbField("count(o2.id)")
  93. private Integer refundCount;
  94. /**
  95. * 退款金额
  96. */
  97. @DbField("IFNULL(sum(o2.money),0)")
  98. private BigDecimal refundMoney;
  99. @DbField("cp.created_time")
  100. private Date createdTime;
  101. @DbField("cp.update_time")
  102. private Date updateTime;
  103. }