/*
*  Copyright 2019-2020 Zheng Jie
*
*  Licensed under the Apache License, Version 2.0 (the "License");
*  you may not use this file except in compliance with the License.
*  You may obtain a copy of the License at
*
*  http://www.apache.org/licenses/LICENSE-2.0
*
*  Unless required by applicable law or agreed to in writing, software
*  distributed under the License is distributed on an "AS IS" BASIS,
*  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
*  See the License for the specific language governing permissions and
*  limitations under the License.
*/
package me.zhengjie.modules.dm.envmonitor.monitorobject.domain;

import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;
import javax.persistence.*;
import javax.validation.constraints.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import org.hibernate.annotations.*;
import java.sql.Timestamp;
import java.io.Serializable;

/**
* @website https://el-admin.vip
* @description /
* @author shuai.huang
* @date 2021-03-30
**/
@Entity
@Data
@Table(name="dm_env_monitor_object")
public class DmEnvMonitorObject implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    @ApiModelProperty(value = " 主键")
    private Long id;

    @Column(name = "construct_name")
    @ApiModelProperty(value = "建筑名称")
    private String constructName;

    @Column(name = "gis_coordinate")
    @ApiModelProperty(value = "GIS坐标")
    private String gisCoordinate;

    @Column(name = "construct_structure_type")
    @ApiModelProperty(value = "建筑结构类型")
    private String constructStructureType;

    @Column(name = "construct_period")
    @ApiModelProperty(value = "使用期限")
    private String constructPeriod;

    @Column(name = "construct_time")
    @ApiModelProperty(value = "建筑年代")
    private String constructTime;

    @Column(name = "construct_type")
    @ApiModelProperty(value = "建筑类别")
    private String constructType;

    @Column(name = "construct_storey")
    @ApiModelProperty(value = "建筑层数")
    private Integer constructStorey;

    @Column(name = "construct_height")
    @ApiModelProperty(value = "建筑高度")
    private Float constructHeight;

    @Column(name = "base_area")
    @ApiModelProperty(value = "基底面积")
    private Float baseArea;

    @Column(name = "construct_area")
    @ApiModelProperty(value = "总建筑面积")
    private Float constructArea;

    @Column(name = "remark")
    @ApiModelProperty(value = "主要用途")
    private String remark;

    @Column(name = "create_by")
    @ApiModelProperty(value = "创建者")
    private String createBy;

    @Column(name = "update_by")
    @ApiModelProperty(value = "更新者")
    private String updateBy;

    @Column(name = "create_time")
    @CreationTimestamp
    @ApiModelProperty(value = "创建时间")
    private Timestamp createTime;

    @Column(name = "update_time")
    @UpdateTimestamp
    @ApiModelProperty(value = "更新时间")
    private Timestamp updateTime;

    public void copy(DmEnvMonitorObject source){
        BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
    }
}