<if test="leaderType !=null and leaderType =! ''">
    LEFT JOIN leader_unread AS lu ON lg.id = lu.leader_guidance_id
</if>
    WHERE 1 = 1
<if test='leaderType == "0"'>
    AND (lu.user_id != #{userId}  or lu.user_id is NULL)
</if>
<if test='leaderType == "1"'>
     AND (lu.user_id = #{userId})
</if>

执行时,当leaderType为0或1时,一直报ava.lang.NumberFormatException: For input string

和同事看了半天没找到原因,在看了这位大佬CSDN的文章及下面的评论,找到了问题,判断条件里的<if test="leaderType !=null and leaderType != ''"> 不小心写成了=!,修改之后,一切正常

最后修改于 2021-01-22 16:42:56
如果觉得我的文章对你有用,请随意赞赏
扫一扫支付
上一篇