根据起止日期拼接hql,进行查询
来源:互联网 发布:精准扶贫大数据平台 编辑:程序博客网 时间:2024/05/16 16:00
controller.java
int total = acrossDeptApplyService.findTotal();
int startDate =0;int endDate =0;
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
if (start!=null&&start.trim().length()>0){
//startDate=DateUtil.getOnlyDate(start);
//startDate = Integer.parseInt(sdf.format(start));
startDate=Integer.parseInt(sdf.format(DateFormat.getDateInstance().parse(start)));
}
if (end!=null&&end.trim().length()>0){
//endDate =DateUtil.getOnlyDate(end);
//endDate = Integer.parseInt(sdf.format(end));
endDate=Integer.parseInt(sdf.format(DateFormat.getDateInstance().parse(end)));
}
DaoImpl.java
if (startDate!=0){
buffer.append("and to_number(to_char(applyTime,'yyyyMMdd')) >= ?");
params.add(startDate);
}
if (endDate!=0){
buffer.append("and to_number(to_char(applyTime,'yyyyMMdd')) <= ?");
params.add(endDate);
}
终于解决了问题。
0 0
- 根据起止日期拼接hql,进行查询
- 根据起止日期生成连续日期
- 根据当前日期获取本周起止时间
- 根据当前日期获取本周起止时间
- java excel根据起止日期导出
- 【转】根据起止日期+时间取数
- hql语句拼接查询
- 根据当前日期 获取 本周 ,本月 的起止日期
- hql的日期查询
- hql查询当天日期
- hql查询语句的拼接要注意
- hql多条件查询的拼接
- hql的拼接查询以及异样显示
- Hibernate多条件查询,HQL拼接
- 【mysql】hql查询日期用法
- 分享 HQL 查询日期 Oracle
- 根据某个日期获得其上月,上季,上周的起止日期
- 起止日期要明确
- http://blog.csdn.net/flyingleo1981/article/details/19196275
- 将序列反序
- 转载:码途有道----基于系统观的核心能力构建
- 创建SSH Key连接github或gitlab
- Android中消息系统模型和Handler Looper
- 根据起止日期拼接hql,进行查询
- 串行异步通信接口
- Aptana Studio 3 闪退问题解决
- 如何进行面向对象设计
- 计算IMEI号的校验位
- 杂记
- 用C语言堆栈操作的计算器的实现(输入输出流使用的C++)
- 10个最“优秀”的代码注释
- codechef Chef and Swaps