mybatis对包括0在内的Integre类型进行判断
使用mybatis对text类型和别的类进行判断一般如下:
<if test="p_remarks !=null and p_remarks !=''">
p_remarks=#{p_remarks},
</if>
对Integer类型一般也是这样,
<if test="p_state !=null and p_state !=''">
p_state=#{p_state},
</if>
但进行判断包括0在内的时间就不行了,mybatis把int类型的0当成 ’ ’ 空格使用所以被 !=’ ’ 判断给拦截下来,
所以去掉空的判断就行了
<if test="p_state !=null">
p_state=#{p_state},
</if>