<update id="update">
update business
<set>
<if test="title != null">
title = #{title},
</if>
<if test="subtitle != null">
subtitle = #{subtitle},
</if>
<if test="city != null">
city = #{city},
</if>
<if test="category != null">
category = #{category},
</if>
<if test="imgFileName != null">
img_file_name = #{imgFileName},
</if>
<if test="price != null">
price = #{price},
</if>
<if test="distance != null">
distance = #{distance},
</if>
<if test="desc != null">
`desc` = #{desc},
</if>
</set>
where id= #{id}
</update>为什么desc要加``呢
【毕设】SSM全面梳理,前后端分离,zTree 和复杂SQL打造权限系统,解惑MyBatis和RESTful
了解课程