为什么会报错不知道sql语句哪里出问题了,感觉写的是对的啊
<update id="updatemoney">
update sys_money
<set>
<if test="bsalary!=null">
bsalary = #{bsalary}
if>
<if test="psalary!=null">
psalary = #{psalary}
if>
set>
<where>
id =#{id}
where>
update>
错误提示:
WHERE id =1' at line 5
WHERE id =1' at line 5
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'psalary = '0'
WHERE id =1' at line 5] with root cause
java.sql.SQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'psalary = '0'
WHERE id =1' at line 5
更新多个字段的时候,字段中间要加个逗号
不知道你这个问题是否已经解决, 如果还没有解决的话: