mybatis中 if标签判断int或者Integer类型时,判断标签不生效问题
mybatis中 if标签判断int或者Integer类型时注意:
如下图所示,其中的fbzt字段是Integer类型的,我加了fbzt !=’'这个判断条件后,该判断就不生效了:
<if test="fbzt !=null and fbzt !='' ">
and FBZT = #{fbzt}
</if>
应该去掉 不用判断是否为"’’"。
<if test="fbzt !=null">
and FBZT = #{fbzt}
</if&
原创
2021-07-01 09:50:32 ·
1377 阅读 ·
0 评论