InformationView.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. package com.cyksj.model.views;
  2. import com.baomidou.mybatisplus.core.toolkit.Wrappers;
  3. import com.cyksj.model.entity.InformationClickUserRecord;
  4. import com.cyksj.model.entity.OrderDon;
  5. import com.ejlchina.searcher.bean.DbField;
  6. import com.ejlchina.searcher.bean.DbIgnore;
  7. import com.ejlchina.searcher.bean.SearchBean;
  8. import lombok.Getter;
  9. import lombok.Setter;
  10. import java.util.Date;
  11. import java.util.List;
  12. /**
  13. * @author zwhui
  14. * @date 2023/10/12 14:58
  15. */
  16. @Getter
  17. @Setter
  18. @SearchBean(tables = "information i",where = "i.deleted is true")
  19. public class InformationView {
  20. @DbField("i.id")
  21. private Long id;
  22. /**
  23. * 文章标题
  24. */
  25. @DbField("i.title")
  26. private String title;
  27. /**
  28. * 缩略图
  29. */
  30. @DbField("i.thumbnail")
  31. private String thumbnail;
  32. /**
  33. * 文章类型
  34. */
  35. @DbField("i.category_ids")
  36. private String categoryIds;
  37. /**
  38. * 文章类型名
  39. */
  40. @DbIgnore
  41. private List<String> categoryNames;
  42. /**
  43. * 内容
  44. */
  45. @DbField("i.content")
  46. private String content;
  47. /**
  48. * true 上架 || false 下架
  49. */
  50. @DbField("i.status")
  51. private Boolean status;
  52. /**
  53. * true 推荐 || false
  54. */
  55. @DbField("i.recommend")
  56. private Boolean recommend;
  57. /**
  58. * true 置顶 || false
  59. */
  60. @DbField("i.top")
  61. private Boolean top;
  62. /**
  63. * 推荐商品id
  64. */
  65. @DbField("i.goods_ids")
  66. private String goodsIds;
  67. @DbField("i.created_time")
  68. private Date createdTime;
  69. /**
  70. * 推荐商品名
  71. */
  72. @DbIgnore
  73. private List<String> goodsTitles;
  74. /**
  75. * 点击数
  76. */
  77. @DbField("select count(*) from information_click_user_record ir where ir.info_id = i.id and ir.goods_id is not null")
  78. private Integer click;
  79. /**
  80. * 下单数
  81. */
  82. @DbField("select count(*) from information_click_user_record ir left join order_don o on o.id = ir.order_id where ir.info_id = i.id and o.status not in ('close','noPayment')")
  83. private Integer order;
  84. /**
  85. * 浏览量
  86. */
  87. @DbField("select count(*) from information_click_user_record ir where ir.info_id = i.id and ir.goods_id is null and ir.order_id is null")
  88. private Integer visit;
  89. }