// 按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;
 }
 // 模糊查询
 @RequestMapping("fenghuang/ZyjiudianSelectLike.do")
 @ResponseBody
 public Map<String, Object> jiudianSelectLike(
     HttpServletRequest request,
     HttpServletResponse response,
     Integer page,
     Integer rows,
     String name,
     String chengshi,
     String weihuren) {
   try {
     Pagination<Jiudian> pagination =
         (Pagination<Jiudian>) izyjd.jiudianSelectLike(page, rows, name, chengshi, weihuren);
     List<Map<String, Object>> jiudianList = pagination.getResultList();
     Map<String, Object> returnValue = new HashMap<String, Object>();
     for (int i = 0; i < jiudianList.size(); i++) {
       for (Entry<String, Object> entry : jiudianList.get(i).entrySet()) {
         if (entry.getValue() == null) {
           entry.setValue("");
         }
       }
     }
     returnValue.put("total", pagination.getTotalRows());
     returnValue.put("rows", jiudianList);
     JsonConfig config = new JsonConfig();
     config.registerJsonValueProcessor(Timestamp.class, new DateJsonValueProcessor("yyyy-MM-dd"));
     // 把MAP转换成JSON,返回到前台
     JSONObject fromObject = JSONObject.fromObject(returnValue, config);
     // System.out.println(fromObject);
     return fromObject;
   } catch (Exception e) {
     e.printStackTrace();
   }
   return null;
 }
 // 删除
 @RequestMapping("fenghuang/ZiyuanJiudianDelete.do")
 @ResponseBody
 public Map<String, Object> jiudianDelete(
     HttpServletRequest request, HttpServletResponse response, long id) {
   Map<String, Object> result = new HashMap<String, Object>();
   boolean bl = false;
   try {
     bl = izyjd.jiudianDelete(id);
   } catch (Exception e) {
     e.printStackTrace();
   }
   result.put("success", bl);
   return result;
 }
  // 添加
  @RequestMapping("fenghuang/ZiyuanJiudianAdd.do")
  @ResponseBody
  public Map<String, Object> jiudianAdd(
      HttpServletRequest request,
      HttpServletResponse response,
      String chengshi,
      String name,
      String fangjian,
      String hzjb,
      String whr,
      String xjbz,
      String dianhua,
      String chuanzhen,
      String email,
      String guanwang,
      String dizhi,
      String pingjia,
      String tishi,
      String danjijia,
      String wangjijia,
      String jgsm,
      String bz) {

    Jiudian jd = new Jiudian();

    if (chengshi != null && !"".equals(chengshi)) {
      jd.setChengshi(Long.parseLong(chengshi));
    }
    jd.setName(name);
    if (fangjian != null && !"".equals(fangjian)) {
      jd.setFangjian(Long.parseLong(fangjian));
    }
    jd.setHzjb(hzjb);
    jd.setWhr(whr);
    jd.setXjbz(xjbz);
    jd.setDianhua(dianhua);
    jd.setChuanzhen(chuanzhen);
    jd.setEmail(email);
    jd.setGuanwang(guanwang);
    jd.setDizhi(dizhi);
    jd.setPingjia(pingjia);
    jd.setTishi(tishi);
    if (danjijia != null && !"".equals(danjijia)) {
      jd.setDanjijia(Integer.parseInt(danjijia));
    }
    if (wangjijia != null && !"".equals(wangjijia)) {
      jd.setWangjijia(Integer.parseInt(wangjijia));
    }
    jd.setJgsm(jgsm);
    jd.setBz(bz);

    Map<String, Object> result = new HashMap<String, Object>();
    boolean bl = false;
    try {
      izyjd.jiudianAdd(jd);
      bl = true;
    } catch (Exception e) {
      e.printStackTrace();
    }
    result.put("success", bl);
    return result;
  }