| | |
| | | import com.ycl.platform.domain.result.HK.*; |
| | | import com.ycl.platform.domain.result.UY.OneMachineFileResult; |
| | | import com.ycl.platform.domain.result.UY.RecordMetaDSumResult; |
| | | import com.ycl.platform.domain.result.UY.VideoOnlineResult; |
| | | import com.ycl.platform.service.DataCenterService; |
| | | import com.ycl.system.Result; |
| | | import com.ycl.utils.MongoUtil; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.data.domain.Sort; |
| | | import org.springframework.data.mongodb.core.MongoTemplate; |
| | | import org.springframework.data.mongodb.core.query.Criteria; |
| | | import org.springframework.data.mongodb.core.query.Query; |
| | | import org.springframework.data.mongodb.core.query.TextCriteria; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OneMachineFileResult> videoPointOnlineRate(DataCenterQuery params) { |
| | | public Result videoPointOnlineRate(DataCenterQuery params) { |
| | | Query query = new Query(); |
| | | // 全文索引查询 |
| | | MongoUtil.fullText(query, params.getKeyword()); |
| | |
| | | } |
| | | query.addCriteria(criteria); |
| | | 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); |
| | | return resultList; |
| | | List<VideoOnlineResult> resultList = mongoTemplate.find(query, VideoOnlineResult.class); |
| | | long total = mongoTemplate.count(query, VideoOnlineResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<OneMachineFileResult> videoOneMachineDocumentRegister(DataCenterQuery params) { |
| | | public Result videoOneMachineDocumentRegister(DataCenterQuery params) { |
| | | Query query = new Query(); |
| | | // 全文索引查询 |
| | | MongoUtil.fullText(query, params.getKeyword()); |
| | |
| | | query.addCriteria(criteria); |
| | | 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); |
| | | return resultList; |
| | | long total = mongoTemplate.count(query, OneMachineFileResult.class); |
| | | return Result.ok().data(resultList).total(total); |
| | | } |
| | | |
| | | /** |