25.SQL片段 有的时候,我们可能会将一些功能的部分抽取出来,方便复用! 使用SQL标签抽取公共部分 <sql id="getSql"> <if test="title != null"> title=#{ title} </if> <if test="author !=null" > and author =#{ author} </if> </sql> 在需要的地方使用Include标签应用即可 <update id