See the method as follows:
Paging Query 1 @RequestMapping (value= "Bootgridpage", produces= "Application/json;charset=utf-8") @ResponseBody Public bootgridpageinfoset fenye (int current,int rowcount,string sort,string nane,string ph) {P
Agehelper.startpage (Current,rowcount)//paging Example Example = new Example (ccompareccicmodel.class); String By=jsonutil.getsortby (sort);//Parse field example.setorderbyclause (by);
Sort that field example.criteria Criteria = Example.createcriteria ();
if (Stringutil.isnotempty (Nane)) {criteria.andlike ("xm", "%" + nane + "%");
} if (Stringutil.isnotempty (ph)) {criteria.andlike ("rybh", "%" + ph + "%");
}//Criteria.andequalto ("XM", "Tri Ying");//condition equal//Criteria.andgreaterthan ("XB", "1");//Greater Than
Criteria.andlessthan ("XB", "2");/less than//Criteria.andisnotnull ("XM");//is NOT NULL Criteria.andcondition ("xzdqh=", "110104"), and/or all conditions can be = like, can replace all//list<string> values=new A
Rraylist<string> ();
Values.add ("110104");
Values.add ("440304");
Criteria.andin ("Xzdqh", values);//in ()//Criteria.andbetween ("Csrq", "1956/01/08", "1966/10/21")/Time apart
Example.criteria criteria2 = Example.createcriteria ();
Criteria2.andcondition ("xzdqh=", "220104"); Example.or (). Andcondition ("xzdqh=", "220104");//or//Example.or (CRITERIA2);//or List<ccomparecci
Cmodel> List=service.selectbyexample (example);
New bootgridpageinfoset<ccompareccicmodel> (list);
return new bootgridpageinfoset<ccompareccicmodel> (list); }
See the comments in the code for details. Suggest or own one experiment, look at the output of the SQL statement