<iftest="( productId != null and productId !='') or ( menuId != null and menuId !='')">
<iftest="( productId != null and productId !='') or ( menuId != null and menuId !='')">
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
<iftest="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<iftest="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<iftest="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
<iftest="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
)
)
</if>
</if>
<iftest="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from XM.xm_iteration_menu im left join xm.xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
)
</if>
<iftest="key != null and key !='' "> and res.iteration_name like #{key} </if>
</where>
</where>
</select>
</select>
<!--结束 自定义sql函数区域-->
<!--结束 自定义sql函数区域-->
@ -45,14 +50,19 @@
</foreach>
</foreach>
</if>
</if>
<includerefid="where"/>
<includerefid="where"/>
<iftest="key != null and key !='' "></if>
<iftest="( productId != null and productId !='') or ( menuId != null and menuId !='')">
<iftest="( productId != null and productId !='') or ( menuId != null and menuId !='')">
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
and exists ( select 1 from XM.xm_iteration_menu im where im.iteration_id=res.id
<iftest="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<iftest="productId != null and productId !='' "> and im.product_id=#{productId} </if>
<iftest="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
<iftest="menuId != null and menuId !='' "> and im.menu_id=#{menuId} </if>
)
)
</if>
</if>
<iftest="compete !=null and compete!=''">
and ( res.admin_userid=#{compete}
or exists (select 1 from XM.xm_iteration_menu im left join xm.xm_menu m on im.product_id=m.product_id where m.mm_userid=#{compete} and im.iteration_id=res.id)
)
</if>
<iftest="key != null and key !='' "> and res.iteration_name like #{key} </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 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!=''">
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)
)
</if>
<iftest="key != null and key !='' "> and res.menu_name like #{key} </if>
</where>
</where>
order by res.seq_no asc
order by res.seq_no asc
</select>
</select>
@ -47,7 +52,12 @@
<iftest="key != null and key !='' "></if>
<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 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!=''">
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)
)
</if>
<iftest="key != null and key !='' "> and res.menu_name like #{key} </if>
<iftest="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<iftest="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<iftest="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu inner join XM.xm_task t on gu.project_id=t.project_id and t.product_id=res.id where gu.userid=#{compete} and t.product_id=res.id )
or res.pm_userid=#{compete}
or exists ( select 1 from xm_menu m where m.mm_userid=#{compete} and m.product_id=res.id)
)
</if>
<iftest="key != null and key !='' "> and res.product_name like #{key} </if>
</where>
</where>
</select>
</select>
@ -37,9 +42,14 @@
</foreach>
</foreach>
</if>
</if>
<includerefid="where"/>
<includerefid="where"/>
<iftest="key != null and key !='' "></if>
<iftest="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<iftest="key != null and key !='' "> and res.product_name like #{key} </if>
<iftest="projectId != null and projectId !='' "> and exists (select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and t.project_id=#{projectId} where t.project_id=#{projectId} and m.product_id=res.id) </if>
<iftest="compete !=null and compete!=''">
and ( exists ( select 1 from xm_project_group_user gu inner join XM.xm_task t on gu.project_id=t.project_id and t.product_id=res.id where gu.userid=#{compete} and t.product_id=res.id )
or res.pm_userid=#{compete}
or exists ( select 1 from xm_menu m where m.mm_userid=#{compete} and m.product_id=res.id)
and ( exists ( select 1 from XM.xm_project_group g,XM.xm_project_group_user gu where gu.group_id=g.id and gu.userid=#{userid} and g.project_id=res.id )
and ( exists ( select 1 from XM.xm_project_group g,XM.xm_project_group_user gu where gu.group_id=g.id and gu.userid=#{userid} and g.project_id=res.id )
or res.create_userid=#{userid}
or exists ( select 1 from XM.xm_task_execuser exe where exe.project_id=res.id and exe.userid=#{userid} )
or res.create_userid=#{compete}
or exists ( select 1 from XM.xm_task_execuser exe where exe.project_id=res.id and exe.userid=#{compete} )
)
)
</if>
</if>
<!-- 按参与角色查询等-->
<!-- 按参与角色查询等-->
@ -110,9 +110,9 @@
<iftest="myFocus != null and myFocus != ''">
<iftest="myFocus != null and myFocus != ''">
and exists ( select 1 from XM.xm_my_focus f where f.userid=#{userid} and f.project_id=res.id )
and exists ( select 1 from XM.xm_my_focus f where f.userid=#{userid} and f.project_id=res.id )
</if>
</if>
<iftest="key != null and key !='' "></if>
<iftest="productId != null and productId !='' "> and exists ( select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and m.product_id=#{productId} where m.product_id=#{productId} and t.project_id=res.id) </if>
<iftest="productId != null and productId !='' "> and exists ( select 1 from XM.xm_task t left join XM.xm_menu m on t.menu_id=m.menu_id and m.product_id=#{productId} where m.product_id=#{productId} and t.project_id=res.id) </if>
<iftest="key != null and key !='' "> and res.name like #{key} </if>