1.product.xml:
<select id="selectByproductNameAndProductId" resultMap="BaseResultMap" parameterType="map">
SELECT
<include refid="Base_Column_List"/>
FROM
mmall_product
<where>
<if test="productName!=null">
AND name like #{productName}
</if>
<if test="productId!=null">
and id = #{productId}
</if>
</where>
</select>
2.执行查询
http://localhost:8088/manage/product/search.do?productId=1
3.返回结果
4.日志信息