<iftest="groupNameKey != null and groupNameKey !='' "> and res.group_name like concat('%',#{groupNameKey},'%') </if>
<iftest="groupNameKey != null and groupNameKey !='' "> and res.group_name like concat('%',#{groupNameKey},'%') </if>
<iftest="mngUsernamekey != null and mngUsernamekey !='' "> and (res.leader_username like concat('%',#{mngUsernamekey},'%') or res.ass_username like concat('%',#{mngUsernamekey},'%')) </if>
<iftest="mngUsernamekey != null and mngUsernamekey !='' "> and (res.leader_username like concat('%',#{mngUsernamekey},'%') or res.ass_username like concat('%',#{mngUsernamekey},'%')) </if>
<iftest="groupUsernamekey != null and groupUsernamekey !='' "> and
exists ( select 1 from xm_project_group_user gu where gu.group_id=res.id and gu.username like concat('%',#{groupUsernamekey},'%'))
<iftest="groupUsernameKey != null and groupUsernameKey !='' "> and
exists ( select 1 from xm_project_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_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="groupNameKey != null and groupNameKey !='' "> and g.group_name like concat('%',#{groupNameKey},'%') </if>
<iftest="groupNameKey != null and groupNameKey !='' "> and g.group_name like concat('%',#{groupNameKey},'%') </if>
<iftest="mngUsernamekey != null and mngUsernamekey !='' "> and (g.leader_username like concat('%',#{mngUsernamekey},'%') or g.ass_username like concat('%',#{mngUsernamekey},'%')) </if>
<iftest="mngUsernamekey != null and mngUsernamekey !='' "> and (g.leader_username like concat('%',#{mngUsernamekey},'%') or g.ass_username like concat('%',#{mngUsernamekey},'%')) </if>
<iftest="groupUsernamekey != null and groupUsernamekey !='' "> and res.username like concat('%',#{groupUsernamekey},'%') </if>
<iftest="groupUsernameKey != null and groupUsernameKey !='' "> and res.username like concat('%',#{groupUsernameKey},'%') </if>