mybatis时间范围查询


     <if test="excStartTime!=null and excStartTime!=''">
                =  DATE_FORMAT(#{excStartTime}, '%Y-%m-%d')   ]]>
        if>
        <if test="excEndTime!=null and excEndTime!=''">
            
        if>
    

大于号和小于号在mybatis中不起作用,所以要转换一下.

或者使用转义符.

 <if test="excTimeLength != null">
       and dl.exc_time_length >= #{excTimeLength,jdbcType=INTEGER}
      if>

<小于号  <      > 大于号>