diff --git a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
index b99503c5..d0d87f2c 100644
--- a/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
+++ b/xm-core/src/main/resources/mybatis/mapper/xm/core/dao/XmMenuMapper.xml
@@ -28,9 +28,16 @@
+
+ and not
+ exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
+
+
+ and not
+ exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id)
+
- and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
-
+
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)
)
@@ -49,9 +56,15 @@
-
and plan.project_id=#{projectId}
- and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
+
+ and not
+ exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
+
+
+ and not
+ exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id)
+
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_id)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)