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

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>

猜你喜欢

转载自www.cnblogs.com/null/p/11211229.html