package com.sunyard.ssp.modules.user.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import javax.persistence.Transient;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author tsz
 * @since 2020-03-11
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("SC_PERMISSION")
public class ScPermission implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId("ID")
    private Long id;

    @TableField("DESCRIPTION")
    private String description;

    @TableField("NAME")
    private String name;

    @TableField("PARENT_ID")
    private Long parentId;

    @TableField("P_TYPE")
    @JsonProperty("pType")
    private Integer pType;

    @TableField("SORT_ORDER")
    private Double sortOrder;

    @TableField("COMPONENT")
    private String component;

    @TableField("PATH")
    private String path;

    @TableField("TITLE")
    private String title;

    @TableField("ICON")
    private String icon;

    @TableField("P_LEVEL")
    @JsonProperty("pLevel")
    private Integer pLevel;

    @TableField("BUTTON_TYPE")
    private String buttonType;

    @TableField("P_STATUS")
    @JsonProperty("pStatus")
    private Integer pStatus;

    @TableField("URL")
    private String url;

    @TableField("NEED_VERIFY")
    private Boolean needVerify;

    @Transient
    @TableField(exist=false)
    private Boolean hasChild;

    @Transient
    @TableField(exist=false)
    private List<ScPermission> children;

    @Transient
    @TableField(exist=false)
    private List<String> permTypes;

    @Transient
    @TableField(exist=false)
    private Boolean expand = false;

    @Transient
    @TableField(exist=false)
    private Boolean checked = false;

    @Transient
    @TableField(exist=false)
    private Boolean selected = false;


}
