转自:
MyBatis简介
MyBatis拥有非常强大的动态SQL处理能力
下文笔者讲述动态sql的相关简介说明,如下所示:
if
当没有传递userName信息时,则不传入此参数
choose,when,otherwise
set
update User 同上的问题,优化后where id=#{id} username=#{username}, password=#{password}, email=#{email} update User where id=#{id} username=#{username}, password=#{password}, email=#{email}