好处:不要担心逗号
<!-- 注意点:拼接的sql后面要加“,”号,一定要加,不能忘记,还有不用加“and”语句进行拼接-->
<update id="updateBlogSet" parameterType="map">
update mybatis.blog
<set>
<if test="title !=null">
title =#{title},
</if>
<if test="author !=null">
author =#{author}
</if>
</set>
where id=#{id}
</update>