weixin_43634763
weixin_43634763
2019-01-18 19:45

使用updateByPrimaryKeySelective生成的sql语句的where后除了id还有其他字段???导致更新失败

  • java

我有两个service都用了updateByPrimaryKeySelective
有一个成功了还有一个失败了。该如何解决这个问题?

成功那个打印出的sql

2019-01-18 19:43:50.550 DEBUG 9924 --- [nio-8080-exec-6] c.p.h.m.u.P.updateByPrimaryKeySelective  : ==>  Preparing: UPDATE sys_permission SET id = id,parent_id = ?,sort = ?,per_type = ?,is_show = ? WHERE id = ? 

2019-01-18 19:43:50.550 DEBUG 9924 --- [nio-8080-exec-6] c.p.h.m.u.P.updateByPrimaryKeySelective  : ==> Parameters: 1(Integer), 12(Integer), 0(Integer), 1(Integer), 65(Integer)

失败那个打印出的sql

2019-01-18 19:30:27.376 DEBUG 9924 --- [nio-8080-exec-8] c.p.h.m.u.U.updateByPrimaryKeySelective  : ==>  Preparing: UPDATE sys_user SET id = ?,password = ?,phone = ?,update_time = ?,status = ?,rid = ? WHERE id = ? AND username = ? AND password = ? AND phone = ? AND gender = ? AND create_time = ? AND update_time = ? AND status = ? AND rid = ? 

2019-01-18 19:30:27.377 DEBUG 9924 --- [nio-8080-exec-8] c.p.h.m.u.U.updateByPrimaryKeySelective  : ==> Parameters: 2(Long), 123456(String), 123456654(String), 2019-01-18 19:30:27.376(Timestamp), 0(Integer), 1(Integer), 2(Long), null, 123456(String), 123456654(String), null, null, 2019-01-18 19:30:27.376(Timestamp), 0(Integer), 1(Integer)

  • 点赞
  • 回答
  • 收藏
  • 复制链接分享

2条回答