HTML中
controller
/**
* @title 根据父id获取参数列表
* @author wangyu
* @date 2017-04-17
* @param parentId
* 父节点id
*/
public ModelAndView costCenByParentId(HttpServletRequest request,
HttpServletResponse response) {
String parentId = request.getParameter("parentId");
List list = costCenManager.getAllCostCenByParentId(String.valueOf(parentId));
this.renderText(response, JSONArray.fromObject(list).toString());
return null;
}
mamager
/**
* @title 根据父id获取参数列表
* @author wangyu
* @date 2017-04-17
* @param parentId
* 父节点id
*/
public List getAllCostCenByParentId(String parentId) {
Criteria criteria = this.getCriteria();
criteria.add(Restrictions.eq("parentId", parentId));
criteria.addOrder(Order.asc("createTime"));
return criteria.list();
}