dao层用的是Hibernate 什么JPA之类的总之语句是JPQL语句,实体类有date类型的,mysql对应的是datetime类型的,mysql语句我知道怎么写select * from ranking where DATE_SUB(CURDATE(), INTERVAL 7 DAY) <= date(_dt)但是JPQL语句如何啊,或者是直接全部查出来再用java代码处理吗?  public List<String> getWeek() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd E");
Date now = new Date();
Integer starDay;
Integer lastDay;
// 获得星期
String strDay = sdf.format(now).substring(13);
Integer currentDay = Integer.parseInt(strDay.substring(8, 11));
if (strDay.equals("一")) {      //monday
starDay = 0;
lastDay = currentDay + 6;
} else if (strDay.equals("二")) {  //tuesday
starDay = 1;
lastDay = currentDay + 5;
} else if (strDay.equals("三")) {  //wednesday
starDay = 2;
lastDay = currentDay + 4;
} else if (strDay.equals("四")) {  //thursday
starDay = 3;
lastDay = currentDay + 3;
} else if (strDay.equals("五")) {  //friday
starDay = 4;
lastDay = currentDay + 2;
} else if (strDay.equals("六")) {  //saturday
starDay = 5;
lastDay = currentDay + 1;
} else if (strDay.endsWith("日")) {    //sunday
starDay = 6;
lastDay = currentDay + 0;
}
//String starDate = new StrBuilder(sdf.format(now).substring(0, 8))..toString();
return null;
}
下面我不知道该怎么写了啊!