昨天遇到一个bug,我在postgresql执行的多个方法判断两个varchar类型的时间大小都是正确的,一到mybatis就失效。在这里折腾了2,3个小时。

后面没办法了,我就想着是不是我把where条件删除,直接select all 也没有数据不成?其实。

然后突然发现有一个<if test='status != null'>,然后我想了想,这个status我用的String还是Integer?一看,吐血,用的String。

好吧,改为Integer类型就正常了,和时间判断完全没关系。

 

如果用String,应该写为<if test="status != null and status != '' ">

and要小写,出了判断null,还要判断空白

相关文章:

  • 2022-01-06
  • 2022-02-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-14
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-10-14
  • 2021-09-13
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案