AccountView.java 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.cyksj.model.manage.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/10/12 12:02 PM
  12. */
  13. @Getter
  14. @Setter
  15. @SearchBean(tables = "account a left join goods_don g on a.goods_id = g.id " +
  16. "left join groups_trips gt on gt.account_id = a.id " +
  17. "left join groups_relation gr on gr.groups_id = gt.id " +
  18. "left join goods_don_sku gdk on gdk.id = gt.sku_id",
  19. groupBy = "a.id,g.id,g.title,a.account,a.password,a.start_time,a.expiry_time,a.amount,a.cn_account,a.us_account,gt.id,a.remark,gdk.spec_val")
  20. public class AccountView {
  21. @DbField("a.id")
  22. private Long id;
  23. @DbField("g.id")
  24. private Long goodsId;
  25. @DbField("g.title")
  26. private String title;
  27. @DbField("a.bank_card")
  28. private String bankCard;
  29. @DbField("a.account")
  30. private String account;
  31. @DbField("a.password")
  32. private String password;
  33. @DbField("a.start_time")
  34. private Date startTime;
  35. @DbField("a.expiry_time")
  36. private Date expiryTime;
  37. @DbField("a.amount")
  38. private BigDecimal amount;
  39. /**
  40. * 国区id
  41. */
  42. @DbField("a.cn_account")
  43. private String cnAccount;
  44. /**
  45. * 美区id
  46. */
  47. @DbField("a.us_account")
  48. private String usAccount;
  49. @DbIgnore
  50. private Integer invited;
  51. @DbIgnore
  52. private Integer unInvited;
  53. @DbIgnore
  54. private Integer total;
  55. @DbField("gt.id")
  56. private Long groupsId;
  57. /**
  58. * 账号备注
  59. */
  60. @DbField("a.remark")
  61. private String remark;
  62. /**
  63. * 规格
  64. */
  65. @DbField("gdk.spec_val")
  66. private String specVal;
  67. @DbField("select count(ur.id) from user_ticket_cleared_record ur where ur.account_id = a.id and deleted is true")
  68. private Integer expiryCount;
  69. @DbField("if((select s.account_id from (select s.account_id, count(*) num" +
  70. " from (select ur.account_id, ur.relation_id" +
  71. " from user_ticket_cleared_record ur where ur.deleted is true" +
  72. " group by ur.account_id, ur.relation_id) s" +
  73. " group by s.account_id) s left join groups_trips gt on gt.account_id = s.account_id where s.account_id = a.id and s.num >= gt.num)is null,false,true)")
  74. private Boolean expiredAll;
  75. @DbField("max(gr.expiry_time)")
  76. private Date lastTicketTime;
  77. }