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

原文地址:https://www.cnblogs.com/zhxn/p/6909343.html