推荐一下自己写的一个springMVC+hibernate注解+easyUI项目

项目地址:http://git.oschina.net/kaierge/SpringMVC_Hibernate_EesyUI/tree/master

贴出一段action层的代码:

@Controller

@SuppressWarnings({"rawtypes","unchecked"})

@RequestMapping("/dept")

public class DeptAction {


@Autowired

@Qualifier(value="deptDao")

private DeptDao deptDao;

    // 根据各种条件获取

@RequestMapping(value="/getDeptListByPId.xhtml")

@ResponseBody

public JsonResult getDeptListByPId(PageBean pageBean,Integer pid,String name,

HttpServletRequest request,HttpServletResponse response){

JsonResult jsonResult = new JsonResult();

StringBuilder queryFromSb = new StringBuilder();

queryFromSb.append("o.pid=?");

List params = new ArrayList();

params.add(pid);//选择条件

//前台查找条件

if(name!=null){

queryFromSb.append(" and o.name like ? ");

params.add("%"+name+"%");

}

List deList = deptDao.getScrollData(pageBean, queryFromSb.toString(), params.toArray(), null);

Object rows = deptDao.getScrollDataCount(queryFromSb.toString(), params.toArray());

jsonResult.setTotal(rows);

jsonResult.setRows(deList);

return jsonResult;

}

}


推荐一下自己写的一个springMVC+hibernate注解+easyUI项目_第1张图片



转载于:https://my.oschina.net/u/2282932/blog/386111

你可能感兴趣的:(javascript,java,git)