package com.zcxk.rmcp.core.mongo;

import com.zcxk.core.mongo.annotation.QueryField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * @author wilian.peng
 * @Description <p>设备数据表，按照设备ID进行分片</p>
 * sh.enableSharding("smartcity")
 * sh.shardCollection("smartcity.sc_device_data",{"deviceId":"hashed"});
 * @date 2019年11月12日 下午10:05:10
 */
@Data
@ApiModel("设备数据表")
@Document(collection = "rmcp_device_data")
public class DeviceData implements Serializable {

    private static final long serialVersionUID = 4357722209160768792L;

    @ApiModelProperty(value = "主键", position = 1)
    @Id
    Long id;

    @QueryField
    @ApiModelProperty(value = "设备Id", position = 2)
    Long deviceId;

    @ApiModelProperty(value = "年份", position = 3)
    Integer year;

    @ApiModelProperty(value = "测点数据", position = 4)
    List<DeviceDataItem> data;

    @ApiModelProperty(value = "状态", position = 5)
    Integer status;

    @ApiModelProperty(value = "创建人", position = 6)
    String createBy;

    @ApiModelProperty(value = "创建时间", position = 7)
    Date createDate;


}
