package cn.stylefeng.team.meta.modular.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@TableName(value = "devops_meta_user_dict", autoResultMap = true)
@Data
@EqualsAndHashCode(callSuper = true)
public class MetaUserDict extends BaseEntity {

    @TableId(value = "meta_user_dict_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("主键id")
    private Long metaUserDictId;

    @TableField("business_id")
    @ChineseDescription("所属业务id")
    private Long businessId;

    @TableField("dict_type_code")
    @ChineseDescription("字典类型编码")
    private String dictTypeCode;

    @TableField("dict_type_name")
    @ChineseDescription("字典类型名称")
    private String dictTypeName;

    @TableField("dict_type_sort")
    @ChineseDescription("排序")
    private BigDecimal dictTypeSort;

    @TableField(value = "dict_list", typeHandler = JacksonTypeHandler.class)
    @ChineseDescription("字典列表,obj list形式")
    private List<Map<String, Object>> dictList;

    @TableField(value = "version_flag", fill = FieldFill.INSERT)
    @ChineseDescription("乐观锁")
    @Version
    private Long versionFlag;

    @TableField(value = "del_flag", fill = FieldFill.INSERT)
    @ChineseDescription("是否删除：Y-已删除，N-未删除")
    @TableLogic
    private String delFlag;

    @TableField(value = "tenant_id", fill = FieldFill.INSERT)
    @ChineseDescription("租户id")
    private Long tenantId;

}