package com.bohuikeji.delivery.backstage.entity;

import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.entity.vo.AddressVo;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 客户地址管理表
 * </p>
 *
 * @author 10552
 * @since 2019-08-22
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TCustomerAddress对象", description="客户地址管理表")
public class TCustomerAddress extends EntityBase<TCustomerAddress> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value="客户地址管理id(新增时请留空或null)")
    @TableId(value = "cust_add_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer custAddId;

    @ApiModelProperty(value = "客户id")
    @TableField("customer_id")
    @TableShowField("客户id")
    @TableNewField
    private Integer customerId;

    @ApiModelProperty(value = "姓名")
    @TableField("name")
    @TableShowField("姓名")
    @TableNewField(block = SelectBlock.class)
    @TableQueryField
    private String name;

    @ApiModelProperty(value = "手机号")
    @TableField("phone")
    @TableShowField("手机号")
    @TableNewField(block = SelectBlock.class)
    @TableQueryField
    private String phone;


    @ApiModelProperty(value = "地址信息")
    @TableField("address_json")
    @TableShowField("地址信息")
    @TableNewField
    private AddressVo addressJson;

    @ApiModelProperty(value = "是否默认地址(是否)")
    @TableField("default_address")
    @TableShowField("是否默认地址(是否)")
    @TableNewField
    private Boolean defaultAddress=false;

    @ApiModelProperty(value = "状态")
    @TableField("status")
    @TableShowField("状态")
    @TableNewField(block = SelectBlock.class)
    @TableQueryField
    private String status="正常";

    @ApiModelProperty(value = "地图获取的详细地址")
    @TableField("location_address")
    @TableShowField("地图获取的详细地址")
    @TableNewField
    private String locationAddress;

    @ApiModelProperty(value = "地址类型(寄件地址/收件地址)")
    @TableField("type")
    @TableShowField("寄件地址/收件地址")
    @TableNewField
    @TableQueryField
    private String  type;

    @ApiModelProperty(value = "地址二维码")
    @TableField("address_code")
    @TableShowField("地址二维码")
    @TableNewField
    private String addressCode;

    @ApiModelProperty(value = "分享链接")
    @TableField("code_url")
    @TableShowField("分享链接")
    @TableNewField
    private String codeUrl;

    @ApiModelProperty(value = "分享链接")
    @TableField("logo_url")
    @TableShowField("分享链接")
    @TableNewField
    private String logoUrl;

    @ApiModelProperty(value = "三级联动默认选项")
    @TableField("default_val")
    @TableShowField("三级联动默认选项")
    @TableNewField
    private String defaultVal;

    @ApiModelProperty(value = "分享标识")
    @TableField(exist = false) //不为数据库字段
    private Integer shareId;

    public TCustomerAddress(){}
    public TCustomerAddress(String name,String phone,String address,AddressVo addressVo,Boolean isDefault){
        this.setName(name);
        this.setPhone(phone);
        this.setLocationAddress(address);
        this.setAddressJson(addressVo);
        this.setDefaultAddress(isDefault);
    }


}
