mybatis使用map动态查询的坑--已解决 Cause: java.lang.NumberFormatException: For input string: "ss" #数据表的设计


Cause: java.lang.NumberFormatException: For input string: “ss”
#数据表的设计

mybatis使用map动态查询的坑

#controller
mybatis使用map动态查询的坑mapper 映射文件
mybatis使用map动态查询的坑运行结果
mybatis使用map动态查询的坑如果把前面map里面的“123”换成“ss"

mybatis使用map动态查询的坑在运行后就报错

mybatis使用map动态查询的坑换了其他的字段也试过了,只要传入字符串就报错!

因为在<if test="password!=null and password!=' '.toString()">里面使用了’ ',mybatis会把它识别成char 类型,所以只需要加一个toString方法就好了
这里 ’ ’ 将被认为是 char 类型,但是 ’ ’ 或者 " " 都可以被作为 String类型。

相关文章:

  • 2022-01-02
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2022-12-23
  • 2021-11-30
  • 2021-11-19
  • 2021-09-19
猜你喜欢
  • 2022-12-23
  • 2021-04-22
  • 2021-10-13
  • 2021-06-01
  • 2021-10-10
  • 2022-01-07
  • 2021-07-30
相关资源
相似解决方案