package com.ruoyi.demo.entity.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import com.ruoyi.demo.entity.WdInfo;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
public class WdInfoVo implements Serializable {
    private String wdId;
    private String wdName;
    private String addrInfo;
    private String addrCode;

    private String addrCodeInfo;
    private BigDecimal lat;
    private BigDecimal lng;
    private String typeCodeBy;
    private String typeNameBy;

    private String wdTypeCode;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime enterTime;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime updateTime;
    private String collectUserId;
    private String collectPerson;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    private LocalDateTime collectTime;

    @TableField("show_delete")
    private int showDelete = -1;

    int pageNum = 1;

    int pageSize = 10;

    private String orderBy = "collect_time";

    public WdInfoVo(WdInfo wdInfo) {
        this.wdId = wdInfo.getWdId();
        this.wdName = wdInfo.getWdName();
        this.addrInfo = wdInfo.getAddrInfo();
        this.addrCode = wdInfo.getAddrCode();
        this.lat = wdInfo.getLat();
        this.lng = wdInfo.getLng();
        this.typeCodeBy = wdInfo.getTypeCodeBy();
        this.typeNameBy = wdInfo.getTypeNameBy();
        this.wdTypeCode = wdInfo.getWdTypeCode();
        this.enterTime = wdInfo.getEnterTime();
        this.updateTime = wdInfo.getUpdateTime();
        this.collectUserId = wdInfo.getCollectUserId();
        this.collectPerson = wdInfo.getCollectPerson();
        this.collectTime = wdInfo.getCollectTime();
        this.showDelete = wdInfo.getShowDelete();
    }

    public WdInfoVo() {
    }
}
