select * from t_goods
<where>
<if test="goodsName!=null and goodsName!=''">
or goodsName LIKE CONCAT(CONCAT('%',#{goodsName},'%'))
</if>
<if test="basePrice!=null and basePrice!=''">
or basePrice LIKE CONCAT(CONCAT('%',#{basePrice},'%'))
</if>
</where>
order by id
简单的模糊查询格式
最新推荐文章于 2021-08-10 08:59:21 发布