if标签使用

<select id="selectOrder" resultMap="BaseResultMap" parameterType="com.tuanzi.order.entity.Indent">
        select
        *
        from indent
        <where>
            <if test="name != null">
                name like CONCAT("%",#{name},"%")
            </if>
            <if test="phone != null">
                and phone like CONCAT("%",#{phone},"%")
            </if>
            <if test="number != null">
                and number like CONCAT("%",#{number},"%")
            </if>
        </where>
    </select>


版权声明:本文为weixin_45699455原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。