|
@@ -31,11 +31,9 @@
|
|
|
<delete id="delFriendByTenantId">
|
|
|
DELETE t1
|
|
|
FROM im_user_friend t1
|
|
|
- LEFT JOIN teacher t2 ON (
|
|
|
- t2.tenant_id_ = #{tenantId} AND
|
|
|
- (t1.user_id_ = t2.user_id_ OR t1.friend_id_ = t2.user_id_)
|
|
|
- )
|
|
|
- WHERE (t1.user_id_ = #{userId} and t1.client_type_ = #{clientType})
|
|
|
- OR t1.friend_id_ = #{userId}
|
|
|
+ LEFT JOIN teacher t2 ON t1.friend_id_ = t2.user_id_
|
|
|
+ LEFT JOIN teacher t3 ON t1.user_id_ = t3.user_id_
|
|
|
+ WHERE (t1.user_id_ = #{userId} and t1.client_type_ = #{clientType} and t2.tenant_id_ = #{tenantId})
|
|
|
+ OR (t1.friend_id_ = #{userId} and t1.friend_type_ = #{clientType} and t3.tenant_id_ = #{tenantId})
|
|
|
</delete>
|
|
|
</mapper>
|