From b9102912aac2729231bd9d2c41058da9bfa7bc96 Mon Sep 17 00:00:00 2001
From: CeDo <cedoogle@gmail.com>
Date: 星期四, 17 六月 2021 11:24:23 +0800
Subject: [PATCH] bugfixed

---
 springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java |   21 ++++++++++++++++-----
 1 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java
index 3c3dcf2..b73818a 100644
--- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java
+++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/dao/BigScreenDAO.java
@@ -119,9 +119,15 @@
     BigScreenStatisticPartyBuild partybuild(@Param("communityId") Long communityId);
 
     @Select("<script> " +
-            " SELECT pm.id, pm.member_id, pm.user_id, pm.name, pm.photo_path, COUNT(pa.id) AS total   " +
-            " FROM com_pb_activity_member  pm  LEFT JOIN com_pb_activity pa  ON pm.activity_id = pa.id   " +
-            " WHERE pa.community_id = #{communityId}   " +
+            " SELECT pm.id, pm.member_id, pm.user_id, pm.name, " +
+            " case " +
+            " when me.photo_path is NOT NULL then  me.photo_path \n" +
+            " when CAST(SUBSTRING(me.id_card , 17, 1) AS SIGNED)%2=1 then 'https://www.psciio.com/idcard/tst/idcard/a723e5bcbd594a48956ef9354c8b477c.jpg' " +
+            " ELSE 'https://www.psciio.com/idcard/tst/idcard/cfb9b58913074068bba8c7002f91e7ff.jpg' END AS photo_path " +
+            " ,COUNT(pa.id) AS total   " +
+            " FROM com_pb_activity_member  pm  LEFT JOIN com_pb_activity pa  ON pm.activity_id = pa.id  " +
+            " LEFT JOIN com_pb_member me ON pm.member_id = me.id  " +
+            " WHERE pa.community_id = #{communityId}  AND me.id IS NOT null  " +
             " GROUP BY pm.member_id  " +
             " ORDER BY total DESC  " +
             " LIMIT 3  " +
@@ -129,10 +135,15 @@
     List<PartyBuildingMemberVO> bigscreenPartyactivitytopuser(@Param("communityId")Long communityId);
 
     @Select("<script> " +
-            "  SELECT id AS member_id, user_id, NAME, photo_path, 0 AS total  " +
+            "  SELECT id AS member_id, user_id, NAME, " +
+            " case " +
+            " when photo_path IS NOT NULL then  photo_path  " +
+            " when CAST(SUBSTRING(id_card , 17, 1) AS SIGNED)%2=1 then 'https://www.psciio.com/idcard/tst/idcard/a723e5bcbd594a48956ef9354c8b477c.jpg' " +
+            " ELSE 'https://www.psciio.com/idcard/tst/idcard/cfb9b58913074068bba8c7002f91e7ff.jpg' END AS photo_path , " +
+            " 0 AS total  " +
             " FROM  com_pb_member " +
             " WHERE community_id=#{communityId}  " +
-            " ORDER BY join_time DESC  " +
+            " ORDER BY join_time ASC  " +
             " LIMIT 3  " +
             "</script>")
     List<PartyBuildingMemberVO> defaultPartyactivity(@Param("communityId")Long communityId);

--
Gitblit v1.7.1