|
@@ -28,7 +28,7 @@
|
|
SELECT <include refid="Base_Column_List"/> FROM im_user_friend WHERE user_id_ = #{userId} AND friend_id_ = #{friendId} LIMIT 1
|
|
SELECT <include refid="Base_Column_List"/> FROM im_user_friend WHERE user_id_ = #{userId} AND friend_id_ = #{friendId} LIMIT 1
|
|
</select>
|
|
</select>
|
|
|
|
|
|
- <delete id="delFriendByTenantId">
|
|
|
|
|
|
+ <delete id="delTeacherFriendByTenantId">
|
|
DELETE t1
|
|
DELETE t1
|
|
FROM im_user_friend t1
|
|
FROM im_user_friend t1
|
|
LEFT JOIN teacher t2 ON t1.friend_id_ = t2.user_id_
|
|
LEFT JOIN teacher t2 ON t1.friend_id_ = t2.user_id_
|
|
@@ -36,4 +36,13 @@
|
|
WHERE (t1.user_id_ = #{userId} and t1.client_type_ = #{clientType} and t2.tenant_id_ = #{tenantId})
|
|
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})
|
|
OR (t1.friend_id_ = #{userId} and t1.friend_type_ = #{clientType} and t3.tenant_id_ = #{tenantId})
|
|
</delete>
|
|
</delete>
|
|
|
|
+
|
|
|
|
+ <delete id="delStudentFriendByTenantId">
|
|
|
|
+ DELETE t1
|
|
|
|
+ FROM im_user_friend t1
|
|
|
|
+ LEFT JOIN student t2 ON t1.friend_id_ = t2.user_id_
|
|
|
|
+ LEFT JOIN student 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>
|
|
</mapper>
|