解決辦法,不使用Integer字段,使用string類型字段;
private Integer type;
mapper檔案:
<choose>
<when test="type == 1">
1
</when>
<otherwise>
</otherwise>
</choose>
即使 type為1也執行0,不會執行1
更改後代碼 :
private String type;
mapper檔案:
<choose>
<when test="type == '1'">
1
</when>
<otherwise>
</otherwise>
</choose>
然後就一切正常了