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)

<where>
<if test="userCustom!=null">
<if test="userCustom.sex!=null and userCustom.sex!=' '">
and user.sex=#{userCustom.sex}
</if>
<if test="userCustom.username!=null and userCustom.username!=' '">
and user.username like '%${userCustom.username}%'
</if>
</if>
</where> 


<if test="userCustom.sex!=null and userCustom.sex!=''">判断是否为空应该去掉‘’中间的空格



阅读更多
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zlc819240815/article/details/52347147
个人分类: Java,java框架
上一篇cxf整合spring运行在tomcat时出现version 51.0
下一篇资源文件一块打包成jar,调用时找不到文件
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭