Browse Source

邀请注册增加分类统计数据及统计总数的接口

hejq 8 years ago
parent
commit
816b5e90b2

+ 14 - 3
src/main/java/com/uas/platform/b2b/v2/service/impl/InviteRecordServiceImpl.java

@@ -108,8 +108,19 @@ public class InviteRecordServiceImpl implements InviteRecordService {
      */
      */
     @Override
     @Override
     public List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year) {
     public List<Invitation> getCountGroupByDate(Long userUU, Long enUU, String year) {
-        String sql = "SELECT a.time,v.count todoCount, a.count count FROM v$invitation V LEFT JOIN v$invitation_all A ON V.USERUU = A.USERUU AND A.TIME = V.TIME WHERE v.active = 0" +
-                "and a.time like '%" + year + "%' and a.useruu = " + userUU;
-        return commonDao.query(sql, Invitation.class);
+        String sql = "select time, count, 0 as doneCount from v$invitation_all where time like '%" + year + "%' and useruu = " + userUU;
+        List<Invitation> all = commonDao.query(sql, Invitation.class);
+        String sql1 = "select time, count doneCount from v$invitation where time like'%" + year + "%' and useruu = " + userUU + "and active = 1";
+        List<Invitation> done = commonDao.query(sql1, Invitation.class);
+        if (!CollectionUtils.isEmpty(all) && !CollectionUtils.isEmpty(done)) {
+            for (Invitation a : all) {
+                for (Invitation d : done) {
+                    if (a.getTime().equals(d.getTime())) {
+                        a.setDoneCount(d.getDoneCount());
+                    }
+                }
+            }
+        }
+        return all;
     }
     }
 }
 }