动态sql的mapper.xml的示例(update)

<update id="updateBlog" parameterType="map">
     update blog
     <set>
         <if test="title != null">
             title = #{title},
         </if>
         <if test="author != null">
             author = #{author},
         </if>
         <if test="views != null">
             views = #{views},
         </if>
     </set>
     where id = #{id}
 </update>
以粮为纲全面发展
原文地址:https://www.cnblogs.com/alexliuf/p/13715036.html