根据Excel某列模糊修改对应数据库里的列
根据某个模糊参数修改
//JSONObject ipParagraph = ipAdminService.updateDescriptionByIpParagraph(user.get("ipParagraph").toString(), user.get("description").toString());
// user.get("ipParagraph").toString()
/* businessIpParagraph.setUserId(user.get("ipParagraph").toString());
businessIpParagraph.setIpParagraph(user.get("description").toString());*/
/*if (c == 0) {
row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
map.put("ipParagraph", cell.getStringCellValue());
} else if (c == 1) {
row.getCell(1).setCellType(Cell.CELL_TYPE_STRING);
map.put("description",cell.getStringCellValue());
}
}*/
/**
* ÐÞ¸Ädescription
* @param description
* @param ipParagraph
* @return
*/
JSONObject updateDescriptionByIpParagraph(String description, String ipParagraph);
/* @Override
public JSONObject updateDescriptionByIpParagraph(String ipParagraph, String description) {
HashMap<String, String> args = new HashMap<String, String>();
args.put("ipParagraph",ipParagraph);
args.put("description",description);
String[] strings = ipParagraph.split("\\.");
String str1=strings[0]+"."+strings[1];
if(str1.equals("119.254") || str1.equals("10.17") || str1.equals("117.107")) {
if(!com.sinnet.crm.util.string.StringUtils.isEmpty(description)) {
JSONObject requestByPost = WebServiceHelper.requestByPost("ip_service", "IpParagraph", "saveIpP", args);
return requestByPost;
}
}
return null;
}*/
@RequestMapping(value="/updateBusinessIpParagraph",method={RequestMethod.POST})
@ResponseBody
public Map<String,Object> updateDescriptionByIpParagraph(String description, String ipParagraph,HttpServletRequest request) throws Exception{
Map<String, Object> map = new HashMap<String, Object>();
try {
int model_r = ipPService.updateDescriptionByIpParagraph(description,ipParagraph);
map.put("state", "success");
map.put("message", "²Ù×÷³É¹¦");
map.put("data", model_r);
} catch (Exception e) {
e.printStackTrace();
map.put("state", "error");
map.put("message", "Êý¾Ý·þÎñÒì³£");
map.put("detail", e.getMessage());
}
return map;
}
/*
* ¸ù¾ÝipParagraph ÐÞ¸Ädescription
* µ¥¶ÀµÄʵÏÖ, String ipParagraph
*/
public int updateDescriptionByIpParagraph(String description, String ipParagraph) {
StringBuffer sb = new StringBuffer();
sb.append(" update business_ip_paragraph_copy set description=? where 1=1 and ipParagraph=?");
return jdbcTemplate.update(sb.toString(), description,ipParagraph);
}