hibernate中时间比较的小笔记

 

 

 

        // 开单时间
        if (!"".equals(startDate) &&  startDate != null) {
            queryCondition = queryCondition
                    + " and t.receiptDate >= str_to_date('"
                    + startDate + "','%Y-%m-%d')" ;

        }

        if (!"".equals(endDate) && endDate != null) {
            queryCondition = queryCondition
                   // + " and t.orderDate < '"+ CommonUtil.getAddDate(endDate.toString(), 1) +"','%Y-%m-%d')";
            		+ " and t.receiptDate < str_to_date('"+ CommonUtil.getAddDate(endDate.toString(), 1) + "','%Y-%m-%d')";
        }

 

posted @ 2014-03-16 10:22  Kstyjobx!!  阅读(2217)  评论(0编辑  收藏  举报