package com.mosty.wzzx.mongodb.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mosty.base.model.BaseEntity;
import com.vividsolutions.jts.geom.Point;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.sql.Timestamp;
import java.util.Date;

/**
 * <p>
 * 位置-历史位置表
 * </p>
 *
 * @author zengbo
 * @since 2022-08-29
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@Document(collection = "tb_wz_sblswz")
@ApiModel(value = "TbWzLswz对象", description = "位置-历史位置表")
public class TbWzSblswzMo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "唯一标识ID")
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Id
    private String id;

    @ApiModelProperty(value = "数据来源名称")
    private String sjly;

    @ApiModelProperty(value = "--D_BZ_WZSJLY(位置数据来源)数据来源（01 udp推送 02 移动设备）")
    private String sjlydm;

    @Indexed
    @ApiModelProperty(value = "关联业务ID（预留）")
    private String ywid;

    @Indexed
    @ApiModelProperty(value = "设备ID")
    private String sbid;

    @Indexed
    @ApiModelProperty(value = "设备名称")
    private String sbmc;

    @Indexed
    @Field("yh_id")
    @ApiModelProperty(value = "用户ID")
    private String yhId;

    @Indexed
    @Field("yh_xm")
    @ApiModelProperty(value = "用户姓名")
    private String yhXm;

    @Indexed
    @Field("yh_sfzh")
    @ApiModelProperty(value = "用户身份证")
    private String yhSfzh;

    @Indexed
    @Field("jz_id")
    @ApiModelProperty(value = "警组ID")
    private String jzId;

    @Indexed
    @Field("jz_mc")
    @ApiModelProperty(value = "警组名称")
    private String jzMc;

    @ApiModelProperty(value = "定位日期")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    private Date dwrq;

    @ApiModelProperty(value = "定位时间")
    private Date dwsj;

    @ApiModelProperty(value = "地球经度")
    private BigDecimal jd;

    @ApiModelProperty(value = "地球维度")
    private BigDecimal wd;

    @ApiModelProperty(value = "坐标")
    @TableField(exist = false)
    @Transient
    private Point zb;

    @ApiModelProperty(value = "坐标hash值")
    private String zbhash;

    @ApiModelProperty(value = "--D_BZ_WZTGZ(位置提供者)位置提供者（pgs PGIS定位 lbs 综合定位）")
    private String wztgz;

    @ApiModelProperty(value = "国家")
    private String guo;

    @ApiModelProperty(value = "省")
    private String sheng;

    @ApiModelProperty(value = "市")
    private String shi;

    @ApiModelProperty(value = "城市编码")
    private String csbm;

    @ApiModelProperty(value = "所属区县")
    private String ssqx;

    @ApiModelProperty(value = "区县编码")
    private String qxbm;

    @ApiModelProperty(value = "地址详址")
    private String dzxz;

    @ApiModelProperty(value = "地址简称")
    private String dzjc;

    @ApiModelProperty(value = "定位标志")
    private String dwbz;

    @ApiModelProperty(value = "巡防时长（与上一个点的时长）")
    private Integer xfsc;

    @ApiModelProperty(value = "巡防里程（米）（与上一个点的距离）")
    private Integer xflc;

    @ApiModelProperty(value = "所属部门id")
    private String ssbmid;

    @ApiModelProperty(value = "所属部门")
    private String ssbm;

    @ApiModelProperty(value = "所属部门代码")
    private String ssbmdm;

    @ApiModelProperty(value = "所属县公安局id")
    private String ssxgajid;

    @ApiModelProperty(value = "所属县公安局")
    private String ssxgaj;

    @ApiModelProperty(value = "所属县公安局代码")
    private String ssxgajdm;

    @ApiModelProperty(value = "所属市公安局id")
    private String sssgajid;

    @ApiModelProperty(value = "所属市公安局")
    private String sssgaj;

    @ApiModelProperty(value = "所属市公安局代码")
    private String sssgajdm;


    @ApiModelProperty(value = "数据来源：1、PC，2、手机端", name = "xtSjly")
    @Field("xt_sjly")
    @Indexed
    private String xtSjly;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "数据状态：0、注销，1、正常，-1、封存", name = "xtSjzt")
    @Field("xt_sjzt")
    @Indexed
    private String xtSjzt;

    @TableLogic
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "删除标识：0、未删除，1、已删除", name = "xtScbz")
    @Field("xt_scbz")
    @Indexed
    private String xtScbz;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建IP", name = "xtCjip")
    @Field("xt_cjip")
    @Indexed
    private String xtCjip;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建时间", name = "xtCjsj")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @Field("xt_cjsj")
    @Indexed
    private Date xtCjsj;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人ID", name = "xtCjrId")
    @Field("xt_cjr_id")
    private String xtCjrId;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建人名称", name = "xtCjr")
    @Field("xt_cjr")
    @Indexed
    private String xtCjr;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建部门代码", name = "xtCjbmdm")
    @Field("xt_cjbmdm")
    private String xtCjbmdm;

    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty(value = "创建部门名称", name = "xtCjbmmc")
    @Field("xt_cjbmmc")
    private String xtCjbmmc;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新IP", name = "xtZhgxip")
    @Field("xt_zhgxip")
    private String xtZhgxip;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新时间", name = "xtZhgxsj")
    @Field("xt_zhgxsj")
    private Date xtZhgxsj;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新人ID", name = "xtZhgxrid")
    @Field("xt_zhgxrid")
    private String xtZhgxrid;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新人名称", name = "xtZhgxr")
    @Field("xt_zhgxr")
    private String xtZhgxr;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新部门代码", name = "xtZhgxbmdm")
    @Field("xt_zhgxbmdm")
    private String xtZhgxbmdm;

    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty(value = "最后更新部门名称", name = "xtZhgxbm")
    @Field("xt_zhgxbm")
    private String xtZhgxbm;

    @ApiModelProperty(value = "备注", name = "bz")
    @Field("bz")
    public String bz;

}
