美文网首页
mybatis时间范围查询

mybatis时间范围查询

作者: 叫我胖虎大人 | 来源:发表于2019-08-18 11:25 被阅读0次
<if test="excStartTime!=null and excStartTime!=''">
                <![CDATA[   and DATE_FORMAT(dl.exc_start_time, '%Y-%m-%d')>=  DATE_FORMAT(#{excStartTime}, '%Y-%m-%d')   ]]>
        </if>
        <if test="excEndTime!=null and excEndTime!=''">
            <![CDATA[  and DATE_FORMAT(dl.exc_end_time, '%Y-%m-%d') <= DATE_FORMAT(#{excEndTime}, '%Y-%m-%d')    ]]>
        </if>

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

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

&lt;小于号 < &gt; 大于号>

转载至https://www.cnblogs.com/bulrush/p/10550529.html

相关文章

网友评论

      本文标题:mybatis时间范围查询

      本文链接:https://www.haomeiwen.com/subject/islrsctx.html