mybatis隐藏不用的sql

在mybatis的xml中,选中了不用的sql语句,使用ctrl + shift + / 隐去,,结果是

 <where>
       <if test="dto.startTime != '' and dto.startTime != null">
          and to_char(time,'yyyy-mm-dd') &gt;= #{dto.startTime}
      </if>
      <if test="dto.endTime != '' and dto.endTime != null">
          and to_char(time,'yyyy-mm-dd') &lt;= #{dto.endTime}
     </if>/* test='type == "y" ' */
</where>

/* test='type == "y" ' */

然后启动, 调用方法,结果报出 Cause: java.lang.RuntimeException: java.sql.SQLSyntaxErrorException: ORA-00936: 缺失表达式

不使用快捷键,手动添加<!--test='type=="y"'-->就不会报错了

原文地址:https://www.cnblogs.com/gczmn/p/8312846.html