ChannelView.java 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. package com.cyksj.model.views;
  2. import com.ejlchina.searcher.bean.DbField;
  3. import com.ejlchina.searcher.bean.SearchBean;
  4. import lombok.Getter;
  5. import lombok.Setter;
  6. import java.math.BigDecimal;
  7. import java.util.Date;
  8. /**
  9. * @author chan
  10. * @date 2022/12/13 2:54 PM
  11. */
  12. @Getter
  13. @Setter
  14. @SearchBean(tables = "channel c " +
  15. " LEFT JOIN channel_popularize cp on c.id = cp.channel_id " +
  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. , where = ":condition:"
  20. , groupBy = " c.id,c.`name`,c.wx_shop_id,c.host,c.zfb_shop_id,c.created_time,c.update_time"
  21. ,distinct = true
  22. )
  23. public class ChannelView {
  24. @DbField("c.id")
  25. private Long id;
  26. @DbField("c.name")
  27. private String name;
  28. /**
  29. * 域名
  30. */
  31. @DbField("c.host")
  32. private String host;
  33. /**
  34. * 链接数
  35. */
  36. @DbField("count(DISTINCT(cp.id))")
  37. private Integer popularizeCount;
  38. @DbField("c.wx_shop_id")
  39. private String wxShopId;
  40. @DbField("c.zfb_shop_id")
  41. private String zfbShopId;
  42. /**
  43. * 浏览数
  44. */
  45. @DbField("select count(v.id) from channel_popularize_visit v,channel_popularize cp where v.popularize_id = cp.id and cp.id = c.id ")
  46. private Integer visit;
  47. /**
  48. * 订单数
  49. */
  50. @DbField("count(o1.id)")
  51. private Integer orderCount;
  52. /**
  53. * 订单金额
  54. */
  55. @DbField("IFNULL(sum(o1.money),0)")
  56. private BigDecimal orderMoney;
  57. /**
  58. * 退款订单数
  59. */
  60. @DbField("count(o2.id)")
  61. private Integer refundCount;
  62. /**
  63. * 退款金额
  64. */
  65. @DbField("IFNULL(sum(o2.money),0)")
  66. private BigDecimal refundMoney;
  67. @DbField("c.remark")
  68. private String remark;
  69. @DbField("c.creator")
  70. private String creator;
  71. @DbField("c.created_time")
  72. private Date createdTime;
  73. @DbField("c.update_time")
  74. private Date updateTime;
  75. }