where

<select id="searchProducts" parameterType="products" resultType="products">
    select *from products
    <where>
        <if test="pname != null">
            and pname like '%${pname}%'
        </if>
        <if test="cid != null">
            and cid = #{cid}
        </if>
    </where>
</select>

posted @ 2021-10-13 11:56  青竹之下  阅读(227)  评论(0编辑  收藏  举报