<iftest=' excludeIterationId !=null and excludeIterationId !="" and iterationFilterType!=null and iterationFilterType!=""'>
and <iftest='iterationFilterType=="not-join"'> not </if>
exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
</if>
<iftest=' taskFilterType!=null and taskFilterType!="" '>
and <iftest='taskFilterType=="not-join"'> not </if>
exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id)
</if>
<iftest=" excludeIterationId !=null and excludeIterationId !='' "> and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)</if>
<iftest="compete !=null and compete!=''">
<iftest="compete !=null and compete!=''">
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_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)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)
)
)
@ -49,9 +56,15 @@
</foreach>
</foreach>
</if>
</if>
<includerefid="where"/>
<includerefid="where"/>
<iftest="key != null and key !='' "></if>
<iftest=" projectId !=null and projectId !='' "> and plan.project_id=#{projectId}</if>
<iftest=" projectId !=null and projectId !='' "> and plan.project_id=#{projectId}</if>
<iftest=" excludeIterationId !=null and excludeIterationId !='' "> and not exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)</if>
<iftest=' excludeIterationId !=null and excludeIterationId !="" and iterationFilterType!=null and iterationFilterType!=""'>
and <iftest='iterationFilterType=="not-join"'> not </if>
exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=#{excludeIterationId} and im.menu_id=res.menu_id)
</if>
<iftest=' taskFilterType!=null and taskFilterType!="" '>
and <iftest='taskFilterType=="not-join"'> not </if>
exists ( select 1 from XM.xm_task t where t.menu_id=res.menu_id)
</if>
<iftest="compete !=null and compete!=''">
<iftest="compete !=null and compete!=''">
and ( exists ( select 1 from XM.xm_menu m1 where m.mm_userid=#{compete} and m.product_id=res.product_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)
or exists ( select 1 from xm_product p where p.pm_userid=#{compete} and res.product_id=p.id)