Hibernate hql 时间操作(加)

来源:互联网 发布:国产cad软件排行 编辑:程序博客网 时间:2024/05/21 18:02

使用hql获取数据时,查询条件设计到日期,并且日期无法从程序中传入,只能利用hql来进行日期操作。当时用的是postgresSQL数据库,从网上查了下postgresSQL的日期函数:http://www.cnblogs.com/mchina/archive/2013/04/15/3010418.html

1 加

//SQLselect now() + interval '2 days';//hql.. and not exists (select m.id from MTrackRecord m where m.mcustomer_info.id = c.id and m.status = '1' and m.starttime >= c.created_on and m.starttime <= c.created_on + 2 days)
原创粉丝点击