package cn.stylefeng.team.project.api.entity;

import cn.stylefeng.roses.kernel.db.api.pojo.entity.BaseBusinessEntity;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import cn.stylefeng.roses.kernel.rule.annotation.SimpleFieldFormat;
import cn.stylefeng.roses.kernel.sys.api.format.OrgNameFormatProcess;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

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

@TableName("devops_business")
@Data
@EqualsAndHashCode(callSuper = true)
public class Business extends BaseBusinessEntity {

    @TableId(value = "business_id", type = IdType.ASSIGN_ID)
    @ChineseDescription("业务id")
    private Long businessId;

    @TableField("business_category_id")
    @ChineseDescription("业务所属分类id")
    private Long businessCategoryId;

    @TableField("business_name")
    @ChineseDescription("业务名称")
    private String businessName;

    @TableField("business_code")
    @ChineseDescription("业务编码")
    private String businessCode;

    @TableField("system_code")
    @ChineseDescription("系统编码，这里用十进制存储")
    private Integer systemCode;

    @TableField("system_code_show")
    @ChineseDescription("系统编码，用于展示，展示的时候是8位10进制的字符串，例如展示的时候可能显示：#A00000000")
    private String systemCodeShow;

    @TableField("business_icon_type")
    @ChineseDescription("图标类型：1-文件id，2-选择图片")
    private Integer businessIconType;

    @TableField("business_icon")
    @ChineseDescription("图标编码")
    private String businessIcon;

    @TableField("business_icon_file_id")
    @ChineseDescription("模块的图标")
    private Long businessIconFileId;

    @TableField("ownership_dept_id")
    @ChineseDescription("归属部门id，一般用在统计")
    @SimpleFieldFormat(processClass = OrgNameFormatProcess.class)
    private Long ownershipDeptId;

    @TableField("fld_sort")
    @ChineseDescription("排序")
    private BigDecimal fldSort;

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

    @TableField(exist = false)
    @ChineseDescription("业务数据填报的权限配置")
    private List<BusinessPermission> businessPermissionList;

}
