update admin
<set>
<if test="admin_name != null" >
admin_name = #{admin_name,jdbcType=VARCHAR},
</if>
<if test="admin_password != null" >
admin_password = #{admin_password,jdbcType=VARCHAR},
</if>
<if test="admin_nickname != null" >
admin_nickname = #{admin_nickname,jdbcType=VARCHAR},
</if>
<if test="admin_sex != null" >
admin_sex = #{admin_sex,jdbcType=VARCHAR},
</if>
<if test="admin_phone != null" >
admin_phone = #{admin_phone,jdbcType=VARCHAR},
</if>
<if test="admin_status != null" >
admin_status = #{admin_status,jdbcType=INTEGER},
</if>
<if test="admin_ctime != null" >
admin_ctime = #{admin_ctime,jdbcType=DATE},
</if>
</set>
where admin_id = #{admin_id,jdbcType=INTEGER}
Mybatis中update中 set 和 if 用法
最新推荐文章于 2024-06-07 15:24:21 发布