mybatis做if判断注意
- string判断
<if test="strValue != null and strValue != '' ">
str_value = #{strValue}
</if>
- 数值类型(double,integer,float,bigdecimal)
<if test="numValue != null">
num_value = #{numValue}
</if>
- 集合类型(list)
<if test="list.size()>0">
list_value in
<foreach collection="list" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>