package com.zhongzheng.common.core.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zhongzheng.common.annotation.Excel;
import com.zhongzheng.common.annotation.Excel.ColumnType;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * 字典类型表 sys_dict_type
 *
 * @author zhongzheng
 */

@Data
@NoArgsConstructor
@Accessors(chain = true)
public class SysDictType implements Serializable
{
    private static final long serialVersionUID = 1L;

    /** 字典主键 */
    @Excel(name = "字典主键", cellType = ColumnType.NUMERIC)
    @TableId(value = "dict_id",type = IdType.AUTO)
    private Long dictId;

    /** 字典名称 */
    @ApiModelProperty(value ="字典名称")
    @Excel(name = "字典名称")
    @NotBlank(message = "字典名称不能为空")
    @Size(min = 0, max = 100, message = "字典类型名称长度不能超过100个字符")
    private String dictName;

    /** 字典类型 */
    @ApiModelProperty(value ="字典类型")
    @Excel(name = "字典类型")
    @NotBlank(message = "字典类型不能为空")
    @Size(min = 0, max = 100, message = "字典类型类型长度不能超过100个字符")
    private String dictType;

    /** 状态（1正常 0停用） */
    @Excel(name = "状态", readConverterExp = "状态（1正常 0停用）")
    private String status;

    /** 创建者 */
    @TableField(fill = FieldFill.INSERT)
    private String createBy;

    /** 创建时间 */
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String updateBy;

    /** 更新时间 */
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    /** 备注 */
    private String remark;

    @TableField(exist = false)
    private List<String> statusArray;
    /**
     * 请求参数
     */
    @TableField(exist = false)
    private Map<String, Object> params = new HashMap<>();


    /** 分页大小 */
    @ApiModelProperty("分页大小")
    @TableField(exist = false)
    private Integer pageSize;
    /** 当前页数 */
    @ApiModelProperty("当前页数")
    @TableField(exist = false)
    private Integer pageNum;
}
