首页 > 代码库 > ssh easyui与后台模糊查询
ssh easyui与后台模糊查询
//对年度进行查询
jsp:
function search(){
var queryParams={
"zhandianChaobiao.nianDu":$("#nianDu").val(),
}
$(‘#dgResult‘).datagrid(‘load‘, queryParams);
}
action :
/**
* 分页查询
*/
public String findZhandianChaobiao(){
resultMap = new HashMap();
//将查询条件填入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与后台模糊查询