mybatis动态insert,update
1. 动态update
UPDATE ui.user_question_section_xref
<set>
reviewer = #{0}, score = #{1} , last_update_user =
#{0},
<if test="param4 != null">comment = #{3}</if> // 在使用数字索引参数的情况下,在if条件中需要用paramX(x从1开始)来表示
</set>
1. 动态update
UPDATE ui.user_question_section_xref
<set>
reviewer = #{0}, score = #{1} , last_update_user =
#{0},
<if test="param4 != null">comment = #{3}</if> // 在使用数字索引参数的情况下,在if条件中需要用paramX(x从1开始)来表示
</set>