時間區間查詢

<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萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章