/*
*  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.company.domain;

import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import me.zhengjie.base.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.sql.Timestamp;

/**
* @website https://el-admin.vip
* @description /
* @author shiguangji
* @date 2021-03-11
**/
@Entity
@Data
@Table(name="dm_company")
public class DmCompany extends BaseEntity implements Serializable {

    @Id
    @Column(name = "company_id")
    @ApiModelProperty(value = "主键")
    private Long companyId;

    @Column(name = "full_name")
    @NotNull
    @ApiModelProperty(value = "单位名称(全称)")
    private String fullName;

    @Column(name = "short_name")
    @ApiModelProperty(value = "单位简称")
    private String shortName;

    @Column(name = "address")
    @ApiModelProperty(value = "单位地址")
    private String address;

    @Column(name = "contacts")
    @ApiModelProperty(value = "联系方式")
    private String contacts;

    @Column(name = "logo")
    @ApiModelProperty(value = "单位logo")
    private String logo;

    @Column(name = "description")
    @ApiModelProperty(value = "单位介绍")
    private String description;

    @Column(name = "website")
    @ApiModelProperty(value = "单位官网")
    private String website;

    @Column(name = "remark")
    @ApiModelProperty(value = "备注")
    private String remark;

    @Column(name = "register_date")
    @ApiModelProperty(value = "注册时间")
    private Timestamp registerDate;



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