package com.bohuikeji.frame.module.admin.entity.sys;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.bohuikeji.frame.module.admin.annotation.TableKeyField;
import com.bohuikeji.frame.module.admin.annotation.TableQueryField;
import com.bohuikeji.frame.module.admin.annotation.TableShowField;
import com.bohuikeji.frame.module.admin.annotation.TableNewField;
import com.bohuikeji.frame.module.admin.base.EntityBase;
import com.bohuikeji.frame.module.admin.entity.web.block.SelectBlock;
import com.bohuikeji.frame.module.admin.enums.ColumnWayEnum;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * <p>
 * 角色表
 * </p>
 *
 * @author jobob
 * @since 2019-08-09
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class SysRole extends EntityBase<SysRole> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "role_id", type = IdType.AUTO)
    @TableShowField(value = "ID",id = true)
    @TableNewField(show = false)
    private Integer roleId;

    @TableField("role_name")
    @TableShowField("名称")
    @TableNewField
    @TableQueryField(show = false ,like = true)
    private String roleName;

    @TableField("super_role_id")
    @TableShowField("父角色")
    @TableNewField(block = SelectBlock.class)
    @TableKeyField(table = "sys_role",keyShowFields = "role_name",keyLikeFields = "role_name",key = SysRole.class)
    @TableQueryField(like = false)
    private Integer superRoleId;



    @TableField("fran_id")
    private String franId;

    /**
     * 角色类型(1、平台，2、加盟商)
     */
    //@TableShowField("角色类型")
    @TableField("role_type")
    private Integer roleType;

    @TableField("role_status")
    @TableShowField("角色状态")
    @TableQueryField(like = false)
    @TableNewField(options = {"正常","停用"})
    private String roleStatus="正常";

    @TableField("create_user")
    @TableShowField("创建人")
    @TableKeyField(table = "sys_user",keyShowFields = {"user_name"},key = SysUser.class)
    @TableNewField(way = ColumnWayEnum.SESSION_USER,show = false)
    private String createUser;


    @TableField("create_time")
    @TableShowField("创建时间")
    @TableQueryField(sort = 0,like = false)
    private LocalDateTime createTime=LocalDateTime.now();



}
