/** * 通过dtu号获得井 * * @param dtuNum * @return */ public WellModel getWellByDtuNum(String dtuNum) { Query query = new Query(Criteria.where("dtuId").is(dtuNum)); WellModel well = PersistManager.INSTANCE .getMongoTemplate() .findOne(CollectionConstants.WELL_COLLECTION_NAME, query, WellModel.class); return well; }
public List<WellModel> getAllWells() { Query query = new Query(Criteria.where("num").exists(true)); List<WellModel> wellList = PersistManager.INSTANCE .getMongoTemplate() .find(CollectionConstants.WELL_COLLECTION_NAME, query, WellModel.class); return wellList; }
/** * 通过路径获得井列表 * * @param path * @return */ public List<WellModel> getWellsByPath(String path) { Query query = new Query(Criteria.where("path").is(path)); List<WellModel> wellList = PersistManager.INSTANCE .getMongoTemplate() .find(CollectionConstants.WELL_COLLECTION_NAME, query, WellModel.class); return wellList; }
/** * 通过井号获得井 * * @param wellNum * @return */ public WellModel getWellByNum(String wellNum) { Query query = new Query(Criteria.where("num").is(wellNum)); // System.out.println(wellNum); WellModel well = PersistManager.INSTANCE .getMongoTemplate() .findOne(CollectionConstants.WELL_COLLECTION_NAME, query, WellModel.class); return well; }