liupeng 4 years ago
parent
commit
1c52faccb0

+ 7 - 3
code/sapparent/sapservice/src/main/java/org/fouram/mapper/WxUserMapper.xml

@@ -58,8 +58,12 @@
 	</update>
 	
 	<update id="updateAllSapUserIds">
-		update wx_user a set a.sapUserIds = (select GROUP_CONCAT(b.userId, ',') 
-			from sap_user b where (a.userId = b.userId or a.userId = b.email) and a.name = b.name 
-			GROUP BY b.personId);
+		update wx_user a set a.sapUserIds = (
+			select GROUP_CONCAT(b.userId, ',') 
+			from sap_user b 
+			where (a.userId = b.userId or a.userId = b.email 
+				or a.userId = b.username or a.userId = b.formatMobile) and a.name = b.name 
+			GROUP BY b.personId) 
+		where a.sapUserIds is null;
 	</update>
 </mapper>