String queryString = "SELECT c.couponname,c.couponfee/100,c.pic1_path,date_format(c.endtime,'%Y-%c-%d') as endTime FROM couponpublish c,couponpool s WHERE s.pubid=c.pubid AND s.owner='"+userId+"' ";
String whereString="";
//优惠卷类别 1.可用;2.历史
if(type==1){
whereString=whereString+" and ( '"+nowTime+"' between c.starttime and c.endtime ) and s.status=3 ";
}else{
whereString=whereString+" and (( '"+nowTime+"' > c.endtime ) or s.status>3 )";
}
String orderString=" order by c.updatetime ";
int offset=PagerUtil.getOffset(Integer.valueOf(page),Integer.valueOf(rows));
List<Map> list=super.findListbySqlReturnMapByPage(queryString+whereString, offset, Integer.valueOf(rows));
System.out.println(list);
attributes.put("coupons", list);
}else{
throw new InterfaceException(new ErrorBean(ErrorCode.USER_NO_LOGIN));
}
return attributes;
怎么写判断当前时间是否是查到的时间的三天前,然后写在list里
问题是我得先查出时间才能比较哎
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。