// 按id查询 @RequestMapping("fenghuang/ZiyuanJiudianSelectId.do") @ResponseBody public Map<String, Object> jiudianSelectId( HttpServletRequest request, HttpServletResponse response, long id) { Map<String, Object> result = new HashMap<String, Object>(); try { List<Map<String, Object>> jdlist = izyjd.jiudianSelectId(id); for (int i = 0; i < jdlist.size(); i++) { for (Entry<String, Object> entry : jdlist.get(i).entrySet()) { if (entry.getValue() == null) { entry.setValue(""); } } } result.put("rows", jdlist); JsonConfig config = new JsonConfig(); config.registerJsonValueProcessor(Timestamp.class, new DateJsonValueProcessor("yyyy-MM-dd")); // 把MAP转换成JSON,返回到前台 JSONObject fromObject = JSONObject.fromObject(result, config); return fromObject; } catch (Exception e) { e.printStackTrace(); } return result; }