美文网首页
不再能使用的

不再能使用的 作者: 游韧八荒 | 来源:发表于2017-02-04 15:09 被阅读0次

    mybatis 3.3.0中对于时间参数进行比较时的一个bug. 如果拿传入的时间类型参数与空字符串''进行对比判断则会引发异常. 所以在上面的代码中去该该判断, 只保留非空判断就正常了

    [html] view plain copy

    <if test="createTime != null and createTime !='' " >  
      date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})  
    </if>  
    

    改为

    [html] view plain copy

    <if test="createTime != null">  
      date(create_time) = date(#{createTime,jdbcType=TIMESTAMP})  
    </if>

    相关文章

      网友评论

          本文标题:不再能使用的 https://www.haomeiwen.com/subject/uznjittx.html