mybatis 动态sql里面关于时间区间查询的表示方式
来源:互联网 发布:软件开发人员薪酬 编辑:程序博客网 时间:2024/05/27 16:42
在项目中查询时间段的sql语句(时间类型为datetime或date):
<if test="pojo.begintime!=null and pojo.begintime!=''">
<![CDATA[ and DATE_FORMAT(tr.summary_date, '%Y-%m-%d')>= DATE_FORMAT(#{pojo.begintime}, '%Y-%m-%d') ]]>
</if>
<if test="pojo.endtime!=null and pojo.endtime!=''">
<![CDATA[ and DATE_FORMAT(tr.summary_date, '%Y-%m-%d') <= DATE_FORMAT(#{pojo.endtime}, '%Y-%m-%d') ]]>
</if>
在项目中查询时间段的sql语句(时间类型为varchar):
<if test="excelImport_date_begin != null and excelImport_date_begin != '' ">
AND
tm.excelImport_date>=#{excelImport_date_begin}
</if>
<if test="excelImport_date_end != null and excelImport_date_end != '' ">
AND
tm.excelImport_date <=#{excelImport_date_end}
</if>
<小于号 < > 大于号>
页面的源码:
<input id="begintime" class="Wdate date_text" type="text"
onclick="WdatePicker({el:'begintime'})" name="qureyBean.begintime"
value="<s:property value="@com.hljw.util.UncDate@shortDate(qureyBean.begintime)" />" />
至<input id="endtime" class="Wdate date_text" type="text"
onclick="WdatePicker({el:'endtime'})" name="qureyBean.endtime"
value="<s:property value="@com.hljw.util.UncDate@shortDate(qureyBean.endtime)" />"
- mybatis 动态sql里面关于时间区间查询的表示方式
- myBatis查询某个时间区间数据<if test=""> 如何写判断条件,and 里面的内容怎么写?
- 关于thinkphp里面的查询方式
- 关于oracle-sql-时间区间查询精确到时分秒
- 关于ADO+SQL /Access里面查询日期时间类型语句的一点总结
- MyBatis动态sql查询
- Mybatis动态sql查询
- mybatis动态sql查询
- MyBatis的动态SQL的模糊查询
- 关于Mybatis查询时间问题的考虑
- mybatis的动态SQL与模糊查询
- mybatis的动态sql和关联查询
- 关于mybatis最基本的动态sql
- 关于mybatis动态SQL语句的写法
- 关于查询动态时间的MDX语句
- mybatis里面的模糊查询
- MyBatis的动态SQL查询-让查询更灵活多变!
- MyBatis的动态SQL查询-让查询更灵活多变!
- eclipse快捷键以及使用技巧大全
- 前端CSS预处理器Sass
- Unity3D API 知识点积累
- sparkR介绍及安装
- nagios 监控被监控服务器安装nrpe
- mybatis 动态sql里面关于时间区间查询的表示方式
- 可重入函数(类)与线程安全
- fiddler抓取https 如何解决Tunnel to .....443
- HDU6045 Is Derek lying?(规律,2017 HDU多校联赛 第2场)
- BZOJ 2565 最长双回文串 (Manacher)
- 阿里聚安全移动安全专家分享:APP渠道推广作弊攻防那些事儿
- 个人对贪心的理解
- 从零开始学_JavaScript_系列(49)——Promise(2)then、值、catch
- 2017 年用于 UI 设计的 CSS3 和 JavaScript 动画库