コード例 #1
0
 /**
  * 通过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;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 /**
  * 通过路径获得井列表
  *
  * @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;
 }
コード例 #4
0
 /**
  * 通过井号获得井
  *
  * @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;
 }
コード例 #5
0
 private List<ApplicationInfo> getApplicationInfos(
     List<String> appIds, MongoOperations mongoOperation) throws PhrescoException {
   List<ApplicationInfo> applicationInfos = new ArrayList<ApplicationInfo>();
   List<ApplicationInfoDAO> appInfoDAOs =
       mongoOperation.find(
           APPLICATION_INFO_COLLECTION_NAME,
           new Query(Criteria.whereId().in(appIds.toArray())),
           ApplicationInfoDAO.class);
   Converter<ApplicationInfoDAO, ApplicationInfo> converter =
       (Converter<ApplicationInfoDAO, ApplicationInfo>)
           ConvertersFactory.getConverter(ApplicationInfoDAO.class);
   for (ApplicationInfoDAO applicationInfoDAO : appInfoDAOs) {
     ApplicationInfo applicationInfo =
         converter.convertDAOToObject(applicationInfoDAO, mongoOperation);
     applicationInfos.add(applicationInfo);
   }
   return applicationInfos;
 }