<iftest="ext.linkProjectId !=null and ext.linkProjectId!=''">
<iftest="ext.linkProjectId !=null and ext.linkProjectId!=''">
inner join xm_product_project_link ppl on res.id=ppl.product_id and ext.ppl.project_id=#{ext.linkProjectId}
inner join xm_product_project_link ppl on res.id=ppl.product_id and ppl.project_id=#{ext.linkProjectId}
</if>
</if>
<where>
<where>
${@com.mdp.Util@trimWhere(ew.customSqlSegment)}
${@com.mdp.Util@trimWhere(ew.customSqlSegment)}
<!--下面可以添加更多查询条件,正常的if 条件都是支持的-->
<!--下面可以添加更多查询条件,正常的if 条件都是支持的-->
<includerefid="whereForMap"></include>
</where>
</where>
<!--下面双引号内可以添加默认排序,如果前端没有上传排序,将使用引号内的排序规则-->
<!--下面双引号内可以添加默认排序,如果前端没有上传排序,将使用引号内的排序规则-->
@ -22,26 +22,26 @@
</if>
</if>
</select>
</select>
<sqlid="whereForMap">
<sqlid="whereForMap">
<iftest="ext.key != null and ext.key !='' "> and ext.res.product_name like concat('%',#{ext.key} ,'%') </if>
<iftest="ext.key != null and ext.key !='' "> and res.product_name like concat('%',#{ext.key} ,'%') </if>
<iftest="ext.linkIterationId !=null and ext.linkIterationId!=''">
<iftest="ext.linkIterationId !=null and ext.linkIterationId!=''">
and ext.exists( select 1 from xm_iteration ppl where ppl.product_id=res.id and ext.ppl.id=#{ext.linkIterationId} )
and exists( select 1 from xm_iteration ppl where ppl.product_id=res.id and ppl.id=#{ext.linkIterationId} )
</if>
</if>
<iftest="ext.compete !=null and ext.compete!=''">
<iftest="ext.compete !=null and ext.compete!=''">
and ext.( exists ( select 1 from xm_group_user gu inner join xm_product_project_link t on (gu.project_id=t.project_id or gu.product_id=t.product_id ) and ext.t.product_id=res.id where gu.userid=#{ext.compete} and ext.t.product_id=res.id )
and ( exists ( select 1 from xm_group_user gu inner join xm_product_project_link t on (gu.project_id=t.project_id or gu.product_id=t.product_id ) and t.product_id=res.id where gu.userid=#{ext.compete} and t.product_id=res.id )
or res.pm_userid=#{ext.compete} or res.adm_userid=#{ext.compete} or res.ass_userid=#{ext.compete}
or res.pm_userid=#{ext.compete} or res.adm_userid=#{ext.compete} or res.ass_userid=#{ext.compete}
)
)
</if>
</if>
<iftest="ext.ctimeStart!=null and ext.ctimeEnd!=null ">and ext.ctime between #{ext.ctimeStart} and ext.#{ext.ctimeEnd}</if>
<iftest="ext.ctimeStart!=null and ext.ctimeEnd!=null ">and ctime between #{ext.ctimeStart} and #{ext.ctimeEnd}</if>
<iftest="ext.isTpl!=null and ext.isTpl=='1'">
<iftest="ext.isTpl!=null and ext.isTpl=='1'">
and ext.(res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and ext.res.is_tpl='1')
and (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and res.is_tpl='1')
</if>
</if>
<iftest="ext.del==null or del==''">
<iftest="ext.del==null or del==''">
and ext.res.del!="1"
and res.del!="1"
</if>
</if>
<iftest="ext.linkBranchId!=null and ext.linkBranchId!=''">
<iftest="ext.linkBranchId!=null and ext.linkBranchId!=''">
and ext.( res.branch_id = #{ext.linkBranchId}
and ( res.branch_id = #{ext.linkBranchId}
<iftest="ext.isTpl!=null and ext.isTpl=='1'">
<iftest="ext.isTpl!=null and ext.isTpl=='1'">
or (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and ext.res.is_tpl='1')
or (res.branch_id in( #{ext.platformBranchId},#{ext.linkBranchId}) and res.is_tpl='1')