在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"'-->就不会报错了

相关文章:

  • 2021-09-11
  • 2022-12-23
  • 2021-12-19
  • 2021-09-21
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
  • 2021-11-05
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2021-03-31
  • 2021-10-03
  • 2021-10-13
  • 2021-06-15
  • 2021-06-03
相关资源
相似解决方案