integer类型 在Mapper中!= null and != -1 进入了判断条件,去掉!=null 就不会进入到判断条件;如果想要使用!= null则在 != -1 的 -1上加上’-1’单引号
举例:
-
这样传入dailyType=-1不能拼接上and条件
-
这样传入dailyType=-1不能拼接上and条件,但Integer可能为null
-
这样传入dailyType=-1能拼接上and条件
躬身自省,淳朴而谦逊否——文文的博客
integer类型 在Mapper中!= null and != -1 进入了判断条件,去掉!=null 就不会进入到判断条件;如果想要使用!= null则在 != -1 的 -1上加上’-1’单引号
举例:
这样传入dailyType=-1不能拼接上and条件
这样传入dailyType=-1不能拼接上and条件,但Integer可能为null
这样传入dailyType=-1能拼接上and条件
躬身自省,淳朴而谦逊否——文文的博客