Mybatis if標籤判斷傳入值

原始代碼:

<if test="criteria.errorType != null and criteria.errorType == '1'">
                        and x.result !=0
                    </if>

發現篩選不起作用

修改代碼:<if test="criteria.errorType != null and criteria.errorType == '1'.toString()">
                        and x.result !=0
                    </if>

或者

<if test="criteria.errorType != null and criteria.errorType == 1">
                        and x.result !=0
                    </if>

然後就ok了

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章