mybatis 组合条件

 <if test="(param.phone!=null and param.phone!='') or (param.businessName!=null and param.businessName!='')">
            and (
            <if test="param.phone!=null and param.phone!=''">
                partner.partner_contact_phone=#{param.phone}
            </if>
            <if test="(param.phone!=null and param.phone!='') and (param.businessName!=null and param.businessName!='')">
                or
            </if>
            <if test="param.businessName!=null and param.businessName!=''">
                partner.partner_name=#{param.businessName}
            </if>
            )
        </if>

 

posted @ 2022-11-25 15:20  八英里  阅读(34)  评论(0编辑  收藏  举报