oracle中的日期查询在mybatis中写法

自作多情 提交于 2020-04-13 14:51:32

【今日推荐】:为什么一到面试就懵逼!>>>

 

oracle中的日期查询在mybatis中写法可以参考如下:注意提交时间的<号是用特殊字符代替的哦,直接写<号程序会报错的
<!-- 通用查询条件 -->

 

 

 

<!-- 通用查询条件 -->

 

 

<!-- 通用查询条件 -->  
<sql id="Base_Search">      
<if test="content != null">            
  AND CONTENT like '%'||#{content,jdbcType=VARCHAR}||'%'      
</if>      
<if test="createdBy != null">            
  AND CREATED_BY = #{createdBy,jdbcType=VARCHAR}    
  </if>      
<!-- 提交时间start -->      
<if test="startTime !=null">        
    AND CREATION_TIME >= to_date(#{startTime},'yyyy-MM-dd hh24:mi:ss')    
  </if>      
<!-- 提交时间end -->    
  <if test="endTime !=null">    
      AND CREATION_TIME &lt;= to_date(#{endTime},'yyyy-MM-dd hh24:mi:ss')      
</if>  
</sql>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!