mysql时间边界查询
SELECT
a.create_time,
a.* FROM passport_out_cash_order a
WHERE
a.create_time > '2019-11-07' AND a.create_time < DATE_ADD('2019-11-08', INTERVAL 1 DAY)
ORDER BY create_time DESC
sqlmap动态条件语句
<trim prefix="where" prefixOverrides="and|or" >
<if test="disburseNo != null and disburseNo != ''" >
and a.disburse_no = #{disburseNo,jdbcType=VARCHAR}
</if>
<if test="disburseState != null" >
and a.disburse_state = #{disburseState,jdbcType=INTEGER}
</if>
<if test="begin != null and begin != ''">
<![CDATA[
and a.create_time > #{begin,jdbcType=TIMESTAMP}
]]>
</if>
<if test="end != null and end != ''">
<![CDATA[
and a.create_time < DATE_ADD(#{end, jdbcType=TIMESTAMP}, INTERVAL 1 DAY)
]]>
</if>
</trim>