Mybatis 字符参数出现Error querying database. Cause: java.lang.NumberFormatException: For input string: "李

org.apache.ibatis.exceptions.PersistenceException: 
### Error querying database.  Cause: java.lang.NumberFormatException: For input string: "李"
### Cause: java.lang.NumberFormatException: For input string: "李"
at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:107)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:98)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:114)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:58)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:43)
at com.sun.proxy.$Proxy5.findUserList(Unknown Source)




and user.sex=#{userCustom.sex}


and user.username like '%${userCustom.username}%'


 


判断是否为空应该去掉‘’中间的空格



你可能感兴趣的:(Java)