/** * ** 转化对象为要更新的部分字段 * * @param update * @return */ private DBObject makeUpdate(CommonType phonetype) { DBObject update = new BasicDBObject(); DBObject updateSet = new BasicDBObject(); updateSet.put("type_value", phonetype.getType_value()); updateSet.put("type_name", phonetype.getType_name()); this.setModifyInfo(updateSet); update.put("$set", updateSet); logger.debug("更新的对象信息\n{}", update); return update; }
@Override public DBObject updatePart(DBObject returnFields, CommonType phonetype) { DBObject toUpdate = makeUpdate(phonetype); return this.phonetypedao.updateOneById(phonetype.get_id_m(), returnFields, toUpdate); }