package com.bohuikeji.delivery.backstage.entity;

import com.alibaba.fastjson.JSONObject;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableField;
import com.bohuikeji.frame.module.admin.entity.TFranchiseeInformation;
import com.bohuikeji.frame.module.admin.entity.sys.SysConfig;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.entity.web.block.TextBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnWayEnum;
import com.bohuikeji.frame.module.admin.utils.StringUtils;
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 2021-01-29
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="TCustomerTemplate对象", description="客户计费模板定义表")
public class TCustomerTemplate extends EntityBase<TCustomerTemplate> {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "id")
    @TableId(value = "template_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField
    private Integer templateId;

    @ApiModelProperty(value = "模板号")
    @TableField("template_code")
    @TableShowField("模板号")
    @TableNewField(way = ColumnWayEnum.AUTO_ADD,pix = "T",value = "customer_template",edit = false)
    private String templateCode;

    @ApiModelProperty(value = "模板名称")
    @TableField("template_name")
    @TableShowField("模板名称")
    @TableQueryField(show = false)
    @TableNewField
    private String templateName;

    @ApiModelProperty(value = "模板说明")
    @TableField("template_desc")
    @TableShowField("模板说明")
    @TableNewField(block = TextBlock.class)
    private String templateDesc;

    @ApiModelProperty(value = "模板引用数量")
    @TableField("template_quote")
    @TableShowField("模板引用数量")
    @TableNewField(add = false,edit = false)
    private int templateQuote;

    @ApiModelProperty(value = "模板属所加盟商")
    @TableField("fran_id")
    @TableShowField("模板属所加盟商")
    @TableNewField(edit = false,show = false,way = ColumnWayEnum.SESSION_FRAN)
    @TableKeyField(table = "t_franchisee_information",keyShowFields = {"fran_name"},key = TFranchiseeInformation.class)
    private Integer franId;

    @ApiModelProperty(value = "配置ID")
    @TableField("config_id")
    /*@TableShowField("配置ID")
    @TableNewField
    @TableKeyField(table = "t_config",keyShowFields = {"config_name"})*/
    private Integer configId;

    @ApiModelProperty(value = "配置项名称")
    @TableField(value = "config_name")
    @TableShowField(value = "配置项名称",show = false)
    private String configName;

    @ApiModelProperty(value = "配置项KEY")
    @TableField(value = "config_key")
    @TableShowField(value = "配置项KEY",show = false)
    private String configKey;

    @ApiModelProperty(value = "配置Value")
    @TableField("config_value")
    /*@TableShowField("配置Value")
    @TableNewField*/
    private JSONObject configValue;

    @ApiModelProperty(value = "配置组")
    @TableField("config_group")
    @TableShowField(value = "配置组",show = false)
    /*@TableNewField(edit = false)*/
    private String configGroup;

    @TableField("config_sort")
    private Double configSort;

    @TableField("delete_policy")
    private Integer deletePolicy;

    @ApiModelProperty(value = "模板状态")
    @TableField("template_status")
    @TableShowField("模板状态")
    @TableNewField(options = {"使用中"/*,"草稿","暂停解析"*/})
    @TableQueryField(like = false)
    private String templateStatus;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    @TableShowField("创建时间")
    @TableQueryField(sort = 0,like = false)
    @TableNewField(edit = false,add = false)
    private LocalDateTime createTime;


    @ApiModelProperty(value = "创建人")
    @TableField("create_user")
    @TableShowField("创建人")
    @TableQueryField(like = false)
    @TableNewField(edit = false,required  = false)
    private Integer createUser;

    @ApiModelProperty(value = "创建类型")
    @TableField("create_type")
    @TableShowField("创建类型")
    @TableQueryField(like = false)
    @TableNewField(edit = false,required = false)
    private String createType;

    /**
     * codeUrl创建模板二维码
     */
    @ApiModelProperty(value="codeUrl创建模板二维码",name="url")
    @TableField(exist = false)
    private String codeUrl;

}
