check the manual that corresponds to your MySQL server version for the right syntax to use near
<update id="updateWarehouseResources" parameterType="java.util.Map">
update nddp_test.config_warehouse_resources
<trim prefix="set" suffixOverrides=",">
<if test="name != null"> name=#{name}, </if>
<if test="order != null"> order=#{order}, </if>
<if test="offline != null"> offline=#{offline}, </if>
<if test="repair != null"> repair=#{repair}, </if>
</trim>
where id = #{id}
</update>
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: 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 'order='4800',
offline='3800',
repair='77'
whe' at line 3
注意这种一般情况下是语法问题,说明mysql的各种语句还是不够熟练,
(1)看表名是不是使用了Mysql的关键字,如果是,请立马改掉;(我的错误使用了MySQL的关键字!)
(2)语句给出哪里错误,如我的题目中给出“near”,说明在那附近有问题,或者在where前多加了逗号,去掉就行了
还没有评论,来说两句吧...