在mybatis的xml中,選中了不用的sql語句,使用ctrl + shift + / 隱去,,結果是
<where>
<if test="dto.startTime != '' and dto.startTime != null">
and to_char(time,'yyyy-mm-dd') >= #{dto.startTime}
</if>
<if test="dto.endTime != '' and dto.endTime != null">
and to_char(time,'yyyy-mm-dd') <= #{dto.endTime}
</if>/* test='type == "y" ' */
</where>
/* test='type == "y" ' */ ,
然後啟動, 呼叫方法,結果報出 Cause: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00936: 缺失表示式
不使用快捷鍵,手動新增<!--test='type=="y"'-->就不會報錯了