现象:
调用deviceService执行update方法后,sql语句执行成功,但是数据库未更新。
解决办法:
经过对比sql语句、查询了数据库、查了service,最后发现是mapper.xml文件中update语句多加了 where id=#{id};因为id是自增,所以删除该条语句即执行成功。
修改前如下:
update device where id=#{id} status=#{status}, capType=#{capType}, reportDate=#{reportDate},
此时报错,修改后如下:
update device status=#{status}, capType=#{capType}, reportDate=#{reportDate},
update更新成功
上一篇:UVaLive 6693 Flow Game (计算几何,线段相交)
下一篇:MATLAB算法实战应用案例精讲-【数模应用】梯度下降(GD)(附R语言、C++、Python、Java和MATLAB代码)