Explorar o código

Merge branch 'account_condition'

zoujiajian %!s(int64=3) %!d(string=hai) anos
pai
achega
c583ad7494

+ 16 - 3
netflix-dao/src/main/java/com/cyksj/model/excel/ExcelManageAccountData.java

@@ -20,7 +20,9 @@ import java.util.Date;
 @Setter
 @SearchBean(tables = "account a left join goods_don g on a.goods_id = g.id " +
 		"left join groups_trips gt on gt.account_id = a.id " +
-		"left join goods_don_sku gdk on gdk.id = gt.sku_id")
+		"left join groups_relation gr on gr.groups_id = gt.id " +
+		"left join goods_don_sku gdk on gdk.id = gt.sku_id",
+		groupBy = "a.id,g.id,a.bank_card,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.id,gdk.spec_val")
 public class ExcelManageAccountData {
 
 	@ExcelIgnore
@@ -67,15 +69,26 @@ public class ExcelManageAccountData {
 	@DbIgnore
 	private String activeCodeStatus;
 
-	@DbField("select count(ur.id) from user_ticket_cleared_record ur where ur.account_id = a.id and deleted is true")
+	@DbField("select count(ur.id) from user_ticket_cleared_record ur where ur.account_id = a.id and deleted is true and source = 'self'")
 	@ExcelIgnore
 	private Integer expiryCount;
 
 	@DbField("if((select s.account_id from (select s.account_id, count(*) num" +
 			" from (select ur.account_id, ur.relation_id" +
-			" from user_ticket_cleared_record ur where ur.deleted is true" +
+			" from user_ticket_cleared_record ur where ur.deleted is true and source = 'self'" +
 			" group by ur.account_id, ur.relation_id) s" +
 			"  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)")
 	@ExcelIgnore
 	private Boolean expiredAll;
+
+	@DbField("max(gr.expiry_time)")
+	@ExcelIgnore
+	private Date lastTicketTime;
+
+	/**
+	 * 今日有过期人员
+	 */
+	@DbField("min(gr.expiry_time)")
+	@ExcelIgnore
+	private Date firstTicketTime;
 }

+ 9 - 3
netflix-dao/src/main/java/com/cyksj/model/manage/views/AccountView.java

@@ -19,7 +19,7 @@ import java.util.Date;
         "left join groups_trips gt on gt.account_id = a.id " +
         "left join groups_relation gr on gr.groups_id = gt.id " +
         "left join goods_don_sku gdk on gdk.id = gt.sku_id",
-        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")
+        groupBy = "a.id,g.id,a.bank_card,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.id,gdk.spec_val")
 public class AccountView {
 
     @DbField("a.id")
@@ -88,12 +88,12 @@ public class AccountView {
     @DbField("gdk.spec_val")
     private String specVal;
 
-    @DbField("select count(ur.id) from user_ticket_cleared_record ur where ur.account_id = a.id and deleted is true")
+    @DbField("select count(ur.id) from user_ticket_cleared_record ur where ur.account_id = a.id and deleted is true and source = 'self'")
     private Integer expiryCount;
 
     @DbField("if((select s.account_id from (select s.account_id, count(*) num" +
             " from (select ur.account_id, ur.relation_id" +
-            " from user_ticket_cleared_record ur where ur.deleted is true" +
+            " from user_ticket_cleared_record ur where ur.deleted is true and source = 'self'" +
             " group by ur.account_id, ur.relation_id) s" +
             "  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)")
     private Boolean expiredAll;
@@ -101,6 +101,12 @@ public class AccountView {
     @DbField("max(gr.expiry_time)")
     private Date lastTicketTime;
 
+    /**
+     * 今日有过期人员
+     */
+    @DbField("min(gr.expiry_time)")
+    private Date firstTicketTime;
+
     @DbIgnore
     private Integer updatePwdNum;