xml中判断sql参数不为空时才执行对应更新

update 表名 t
set

<if test="字段 != null and 字段 != ' '">
            字段= #{参数},
</if>
.......
where t.id=#{id}

 

 
 
posted @ 2020-12-07 14:02  皮军旗  阅读(884)  评论(0)    收藏  举报