From b31a2529ad309413a23d8ff208d6b15b76efc1cc Mon Sep 17 00:00:00 2001 From: fuliqi <fuliqi@qq.com> Date: 星期三, 08 一月 2025 17:58:40 +0800 Subject: [PATCH] OSD导出加上标签 --- ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java | 30 +++++++++++++++++++++++++++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java index 9ed4af2..f005ce1 100644 --- a/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java +++ b/ycl-pojo/src/main/java/com/ycl/platform/domain/result/UY/RecordMetaDSumResult.java @@ -3,10 +3,14 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.ycl.platform.domain.result.BaseResult; import lombok.Data; +import org.springframework.data.mongodb.core.index.CompoundIndex; +import org.springframework.data.mongodb.core.index.CompoundIndexes; +import org.springframework.data.mongodb.core.index.Indexed; import org.springframework.data.mongodb.core.index.TextIndexed; import org.springframework.data.mongodb.core.mapping.Document; import java.util.Date; +import java.util.Objects; /** * 褰曞儚鍙敤鎬� @@ -15,12 +19,16 @@ */ @Data @Document(collection = "uy_record_meta_d_sum") +@CompoundIndexes({ + //name锛氱储寮曞悕绉� def锛氬瓧娈�(1姝e簭 -1鍊掑簭) unique锛氭槸鍚﹀敮涓�绱㈠紩 + //鐩存帴鍔犲埌瀛楁涓婇潰娌$敤 + @CompoundIndex(name = "video_record", def = "{statTime:-1, no:1}") +}) public class RecordMetaDSumResult extends BaseResult { /** * 琛屾斂鍖哄煙鍚嶇О */ - @TextIndexed private String arealayername; /** @@ -42,7 +50,6 @@ /** * 鎽勫儚鏈哄悕绉� */ - @TextIndexed private String deviceName; /** @@ -58,7 +65,6 @@ /** * 鍥芥爣骞冲彴ID */ - @TextIndexed private String platId; /** @@ -72,9 +78,15 @@ private Integer recordStatus; /** + * 褰曞儚瀹屾暣鐘舵�侊紝1锛氬畬鏁达紝0锛氶棿姝囷紝-1锛氬紓甯� + */ + private String recordStatusText; + + /** * 缁熻鏃堕棿锛屾牸寮忎负鏃ユ湡瀛楃涓� */ @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Indexed(background = true) private Date statTime; /** @@ -82,4 +94,16 @@ */ private String tenantId; + public String getRecordStatusText() { + if (Objects.equals(recordStatus, 1)) { + recordStatusText = "瀹屾暣"; + } + if (Objects.equals(recordStatus, 0)) { + recordStatusText = "闂存瓏"; + } + if (Objects.equals(recordStatus, -1)) { + recordStatusText = "寮傚父"; + } + return recordStatusText; + } } -- Gitblit v1.8.0