Make inquiries about the year
Jsp:
function Search () {
var queryparams={
"Zhandianchaobiao.niandu": $ ("#nianDu"). Val (),
}
$ (' #dgResult '). DataGrid (' Load ', queryparams);
}
Action:
/**
* Paging Query
*/
Public String Findzhandianchaobiao () {
Resultmap = new HashMap ();
Fill in the query criteria into Resultmap
if (Zhandianchaobiao! = null)
{
Resultmap.put ("Niandu", Zhandianchaobiao.getniandu ());
}
Page page = Service.findzhandianchaobiao (Resultmap, GetPage (), getRows ());
if (Page.getresults (). Size ()!=0) {
Resultmap.put ("Total", page.gettotalsize ());
Resultmap.put ("Rows", Page.getresults ());
}else{
Resultmap.put ("Total", 0);
Resultmap.put ("Rows", 0);
}
return SUCCESS;
}
Service:
@Transactional (propagation=propagation.required)
Public Page Findzhandianchaobiao (Map valuemap,int curpage, int pagenum) {
String hql = "from Zhandianchaobiao i where 1=1";
if (Valuemap.get ("Niandu")! = NULL &&! "". Equals (Valuemap.get ("Niandu"))) {
hql+= "and i.niandu=" +valuemap.get ("Niandu");
}
Return Dao.find (HQL, Curpage, pagenum);
}
SSH easyui and background fuzzy query