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

我有两个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)

终于发现问题所在,就是实体类的id用的是Long类型,而我service层用的是Integer类型,把实体类的也改为Integer就成功了

应该是实体类id没有标识主键, 加上注解@Id