标签判断String类型时,可以进行
<if test="id!= null and id!= ''">
and id=#{id}
</if>
但是如果id是int类型且id=0,那么在if判断时,offset !=”————>false
所以int类型进行标签判断只需
<if test="id!= null">
and id=#{id}
</if>
即可.
标签判断String类型时,可以进行
<if test="id!= null and id!= ''">
and id=#{id}
</if>
但是如果id是int类型且id=0,那么在if判断时,offset !=”————>false
所以int类型进行标签判断只需
<if test="id!= null">
and id=#{id}
</if>
即可.