时间区间查询

<if test="beginDate != null  and endDate != null ">
                    and (  date_format(table.date,'%Y%m%d') <![CDATA[>=]]> date_format(#{beginDate }, '%Y%m%d')
                             and date_format(table.date,'%Y%m%d') <![CDATA[<=]]> date_format(#{endDate }, '%Y%m%d')  )
 </if>

beginDate :开始时间

endDate    :结束时间

table.date :数据表中的时间字段

查询从beginDate ~ endDate  时间段的数据

发布了15 篇原创文章 · 获赞 5 · 访问量 1万+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章