/** * 方法描述:根据ID修改圈子信息 * * @param circle 圈子实体信息 * @return resultNum-受影响行数:1为更新成功,其他为更新失败 date:2014-12-14 add by: [email protected] * @throws SPTException */ public int updateCircle(Circle circle) throws SPTException { logger.debug("[CircleDaoImpl.updateCircle] start..."); /** 修改角色返回结果参数默认为 -1 (失败) */ int resultNum = -1; /** 更新时各字段对应值 map */ Map<String, String> paramMap = new HashMap<String, String>(); paramMap.put("id", circle.getId()); paramMap.put("name", circle.getName()); paramMap.put("description", circle.getDescription()); paramMap.put("headPath", circle.getHeadPath()); paramMap.put("joinType", circle.getJoinType()); paramMap.put("issueAddress", circle.getIssueAddress()); paramMap.put("createUserid", circle.getCreateUser()); paramMap.put("address", circle.getAddress()); paramMap.put("province", circle.getProvince()); paramMap.put("city", circle.getCity()); paramMap.put("longitude", circle.getLongitude()); paramMap.put("latitude", circle.getLatitude()); resultNum = commonDao.update(UPDATA_CIRCLE, paramMap); logger.debug("[CircleDaoImpl.updateCircle] end..."); return resultNum; }
/** * 方法描述:添加圈子信息 * * @param circle 圈子实体信息 * @return 1添加成功,否则失败 date:2014-12-14 * @author [email protected] */ public int addCicle(Circle circle) throws SPTException { logger.debug("[CircleDaoImpl.addCicle] start..."); /** 增加圈子信息返回结果参数默认为 -1 (失败) */ int resultNum = -1; /** 增加时各字段对应值 map */ Map<String, String> paramMap = new HashMap<String, String>(); paramMap.put("name", circle.getName()); paramMap.put("description", circle.getDescription()); paramMap.put("headPath", circle.getHeadPath()); paramMap.put("joinType", circle.getJoinType()); paramMap.put("issueAddress", circle.getIssueAddress()); paramMap.put("createUserid", circle.getCreateUser()); paramMap.put("issueTime", circle.getIssueTime()); paramMap.put("endTime", circle.getEndTime()); paramMap.put("address", circle.getAddress()); paramMap.put("notice", circle.getNotice()); paramMap.put("province", circle.getProvince()); paramMap.put("city", circle.getCity()); paramMap.put("longitude", circle.getLongitude()); paramMap.put("latitude", circle.getLatitude()); paramMap.put("postWeek", circle.getPostWeek() + ""); paramMap.put("postAmPm", circle.getPostAmPm() + ""); resultNum = commonDao.update(ADD_CIRCLE, paramMap); int id = commonDao.getLastId(CircleTable.CIRCLE.getTableName(), "id"); circle.setId(id + ""); logger.debug("[CircleDaoImpl.addCicle] end..."); return resultNum; }