飙血推荐
  • HTML教程
  • MySQL教程
  • JavaScript基础教程
  • php入门教程
  • JavaScript正则表达式运用
  • Excel函数教程
  • UEditor使用文档
  • AngularJS教程
  • ThinkPHP5.0教程

hibernate Criterion criteria 多表查询

时间:2021-12-14  作者:匿名  
List<Criterion> criterions = new ArrayList<Criterion>();
Criteria criteria = createCriteria(域名s);

if (user != null) {
域名(域名("user", user));
}

if (域名tEmpty(域名eportSchedule()) ) {

域名(域名("reportSchedule", 域名ert_value(域名eportSchedule())));
}
if (域名tEmpty(域名ame())) {
域名(域名("name","%"+域名ame()+"%")); 
}
if(域名ate()!=null){
Date date1 = null;
try {
date1 = 域名ateByString(域名ate()+" 00:00:00");

} catch (ParseException e) {
// TODO Auto-generated catch block
域名tStackTrace();
}
Date date2 = null;
try {
date2 = 域名ateByString(域名ate()+" 23:59:59");
域名tln(date2);
} catch (ParseException e) {

域名tStackTrace();
}
域名(域名een("createOn",date1,date2)); 
}
if(域名tEmpty(域名ctivityType())){

Criteria criteria1 = 域名teCriteria("reportDetail");
域名(域名("activityType", 域名ert_value(域名ctivityType())));
}
if(域名tEmpty(type)){
if(域名ls("all")){
//所有
}else if(域名ls("finish")){
//已完成
域名(域名("reportSchedule", 域名ESS));

}else if(域名ls("unfinish")){
域名(域名("reportSchedule", 域名ESS)); 
}
}
域名rder(域名("createOn"));
if( page != null) {
int totalCount = ((Long) 域名rojection(域名ount()).uniqueResult()).intValue();
域名otalCount(totalCount);

域名rojection(null);
域名irstResult((域名ageNum() - 1) * 域名umPerPage()).setMaxResults(域名umPerPage());
} 

return 域名();
标签:JAVA
湘ICP备14001474号-3  投诉建议:234161800@qq.com   部分内容来源于网络,如有侵权,请联系删除。