解决方法:
将
<if test=" null != tagtype and ‘’!= tagtype">
AND tagtype = #{tagtype}
</if>
修改为
<if test=" null != tagtype and ''
0 != tagtype">
AND tagtype = #{tagtype}
</if>
原因就是 忽略了参数为 0 就代表参数类型时int 默认值应该是 0