当有Integer数据类型的参数值为0时,如pid=0,xml中pid=="" 判断为ture,即不走条件语句 xml
<if test="pid != null and pid != '' "> AND a.pid = #{pid} </if>
因此还要加上一句 or pid==0test