package com.ruoyi.demo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.demo.entity.vo.CommercialVo;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@TableName("dl_commercial")
@NoArgsConstructor
public class Commercial {
    @TableId(value = "commercial_id",type = IdType.ASSIGN_ID)
    private String commercialId;
    @TableField("commercial_name")
    private String commercialName;
    @TableField("code")
    private String code;
    @TableField("commercial_type")
    private String commercialType;
    @TableField("state")
    private int state;
    @TableField("principal_name")
    private String principalName;
    @TableField("principal_telephone")
    private String principalTelephone;
    @TableField("prove_1")
    private String prove1;
    @TableField("prove_2")
    private String prove2;
    @TableField("prove_3")
    private String prove3;
    @TableField("prove_4")
    private String prove4;
    @TableField("prove_5")
    private String prove5;
    @TableField("addr_code")
    private String addrCode;
    @TableField("addr_code_info")
    private String addrCodeInfo;
    @TableField("addr_info")
    private String addrInfo;
    @TableField("create_time")
    private LocalDateTime createTime;
    @TableField("deleted")
    private Integer deleted;

    public Commercial(CommercialVo commercialVo) {
        this.commercialName = commercialVo.getCommercialName();
        this.code = commercialVo.getCode();
        this.commercialType = commercialVo.getCommercialType();
        this.state = commercialVo.getState();
        this.principalName = commercialVo.getPrincipalName();
        this.principalTelephone = commercialVo.getPrincipalTelephone();
        this.prove1 = commercialVo.getProve1();
        this.prove2 = commercialVo.getProve2();
        this.prove3 = commercialVo.getProve3();
        this.prove4 = commercialVo.getProve4();
        this.prove5 = commercialVo.getProve5();
        this.addrCode = commercialVo.getAddrCode();
        this.addrInfo = commercialVo.getAddrInfo();
    }
}
