mybatis中根据日期模糊查询


首先设置起始日期startDate和结束日期endDate,数据库中日期字段为achive_time,表名为dos_dossier
<select id="getDossiers" resultType="com.ts.dos.model.DosDossier" parameterType="java.util.HashMap">
  select t.achive_time from dos_dossier t
    <if test="startDate != null and startDate != ''">
      and to_char(t.achive_time,'yyyy-MM-dd') >= '${startDate}'
    </if>
    <if test="endDate != null and endDate != ''">
      <![CDATA[and to_char(t.achive_time,'yyyy-MM-dd') <= '${endDate}']]>
    </if>
</select>

MyBatis中关于resultType和resultMap的区别

原文:http://www.tuicool.com/articles/ju2Y7n


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM