exists ( select 1 from xm_group_user gu where gu.group_id=res.id and gu.username like concat('%',#{groupUsernameKey},'%'))
exists ( select 1 from xm_group_user gu where gu.group_id=res.id and gu.username like concat('%',#{groupUsernameKey},'%'))
</if>
</if>
<iftest="orCrowBranchId!=null and orCrowBranchId!=''"> and (res.branch_id=#{branchId} or res.crow_branch_id=#{orCrowBranchId})</if>
<iftest="orCrowBranchId!=null and orCrowBranchId!=''"> and (res.branch_id=#{branchId} or res.crow_branch_id=#{orCrowBranchId})</if>
<iftest="iterationId!=null and iterationId!=''"> and exists ( select 1 from xm_iteration_product_link ipl left join xm_product_project_link ppl on ipl.product_id=ppl.product_id and (ipl.product_id=res.product_id or ppl.project_id = res.project_id))</if>
<iftest="iterationId!=null and iterationId!=''"> and exists ( select 1 from xm_iteration_link ipl where (ipl.pro_id = res.product_id and ipl.ltype='1') or (ipl.pro_id=res.project_id and ipl.ltype='0'))</if>
<iftest=" iterationId !=null and iterationId!=''">
<iftest=" iterationId !=null and iterationId!=''">
and exists( select 1 from xm_iteration_product_link ppl
and exists( select 1 from xm_iteration_link ppl
where ppl.iteration_id=#{iterationId} and ppl.product_id=res.id
where ppl.iteration_id=#{iterationId} and ppl.product_id=res.id
)
)
</if>
</if>
@ -50,7 +50,7 @@
)
)
</if>
</if>
<iftest="iterationId!=null and iterationId!=''">
<iftest="iterationId!=null and iterationId!=''">
and exists( select 1 from xm_iteration_product_link ipl where ipl.product_id =res.id and ipl.iteration_id=#{iterationId} )
and exists( select 1 from xm_iteration_link ipl where ipl.pro_id =res.id and ipl.iteration_id=#{iterationId} )
</if>
</if>
<iftest="compete !=null and compete!=''">
<iftest="compete !=null and compete!=''">
and ( exists ( select 1 from xm_group_user gu inner join 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 )
and ( exists ( select 1 from xm_group_user gu inner join 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 )