| | |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | // 统计数 |
| | | long one = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("1")), OneMachineFileResult.class); |
| | | long two = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("2")), OneMachineFileResult.class); |
| | | long three = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("-1")), OneMachineFileResult.class); |
| | | long one = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("1")), RecordMetaDSumResult.class); |
| | | long two = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("2")), RecordMetaDSumResult.class); |
| | | long three = mongoTemplate.count(new Query().addCriteria(Criteria.where("recordStatus").is("-1")), RecordMetaDSumResult.class); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(one, two, three)); |
| | | map.put("list", resultList); |
| | |
| | | ); |
| | | } |
| | | query.addCriteria(criteria); |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | long total = mongoTemplate.count(query, RecordMetaDSumResult.class); |
| | | query.with(Sort.by(Sort.Order.asc(TIME_FIELD))).skip(params.getSkipNum()).limit(Math.toIntExact(params.getPageSize())); |
| | | List<OneMachineFileResult> resultList = mongoTemplate.find(query, OneMachineFileResult.class); |
| | | List<RecordMetaDSumResult> resultList = mongoTemplate.find(query, RecordMetaDSumResult.class); |
| | | // 统计数 |
| | | long nonNetwork = mongoTemplate.count(new Query().addCriteria(Criteria.where("LWSX").is("0")), OneMachineFileResult.class); |
| | | long network = mongoTemplate.count(new Query().addCriteria(Criteria.where("LWSX").is("1")), OneMachineFileResult.class); |
| | | long video = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*1.*")), OneMachineFileResult.class); |
| | | long car = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*2.*")), OneMachineFileResult.class); |
| | | long face = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*3.*")), OneMachineFileResult.class); |
| | | long nonNetwork = mongoTemplate.count(new Query().addCriteria(Criteria.where("LWSX").is("0")), RecordMetaDSumResult.class); |
| | | long network = mongoTemplate.count(new Query().addCriteria(Criteria.where("LWSX").is("1")), RecordMetaDSumResult.class); |
| | | long video = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*1.*")), RecordMetaDSumResult.class); |
| | | long car = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*2.*")), RecordMetaDSumResult.class); |
| | | long face = mongoTemplate.count(new Query().addCriteria(Criteria.where("SXJGNLX").regex(".*3.*")), RecordMetaDSumResult.class); |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("count", Arrays.asList(nonNetwork, network, video, car, face)); |
| | | map.put("list", resultList); |