mybatis的一個bug,將整數0識別為null,導致sql執行失敗
阿新 • • 發佈:2018-11-09
本文內容整理來源:http://blog.csdn.net/john1337/article/details/70230563
今天在使用mybatis時遇到一個問題,Java程式碼中傳遞的整數0在mybatis中被識別成null
[html] view plain copy
- <where>
- <if
- and status=#{status,jdbcType=INTEGER}
- </if>
- </where>
[html] view plain copy
- <where>
- <if test="status != null and status !='' or status==0">
- and status
- </if>
- </where>