|
@@ -106,12 +106,12 @@
|
|
|
resultType="cn.newfeifan.mall.module.distri.dal.dataobject.sharepath.SharePathDO">
|
|
|
WITH RECURSIVE user_hierarchy AS (
|
|
|
-- 初始查询,获取目标用户及其直接左右区用户
|
|
|
- SELECT user_id, user_name, left_child_id, right_child_id,parent_id, depth, referrer_id,phone
|
|
|
+ SELECT id, user_id, user_name, left_child_id, right_child_id,parent_id, depth, referrer_id,phone
|
|
|
FROM distri_share_path
|
|
|
WHERE user_id = #{userId}
|
|
|
UNION ALL
|
|
|
-- 递归部分,获取左右区用户的下级用户,处理NULL值
|
|
|
- SELECT u.user_id, u.user_name, u.left_child_id, u.right_child_id, u.parent_id, u.depth, u.referrer_id, u.phone
|
|
|
+ SELECT u.id, u.user_id, u.user_name, u.left_child_id, u.right_child_id, u.parent_id, u.depth, u.referrer_id, u.phone
|
|
|
FROM distri_share_path u
|
|
|
INNER JOIN user_hierarchy uh ON (
|
|
|
(u.user_id = uh.left_child_id AND uh.left_child_id IS NOT NULL) OR
|