package com.rf.psychological.menu.dao.model;

import com.rf.psychological.base.model.BaseEntity;
import lombok.*;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.util.List;

/**
 * @Author:zzf
 * @Date:2022/7/6:17:25
 * @Description: 菜单
 */

@EqualsAndHashCode(callSuper = true)
@Entity
@Data
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_menu_info" )
@org.hibernate.annotations.Table(appliesTo = "t_menu_info", comment = "菜单表")
public class MenuEntry extends BaseEntity {

    @Column(name = "menu_no",columnDefinition = "varchar(20) unique not null  comment '菜单编号'")
    private String menuNo;

    @Column(name = "menu_path",columnDefinition = "varchar(200)  comment '菜单路由'")
    private String menuPath;

    @Column(name = "menu_name",columnDefinition = "varchar(20) not null comment '菜单名'")
    private String menuName;

    @Column(name = "parent_menu",columnDefinition = "varchar(20) not null default '0' comment '上级菜单：0表示最顶层菜单'")
    private String parentMenu;

    @Column(name = "menu_order",columnDefinition = "smallint not null default 0 comment '菜单序号'")
    private int menuOrder;

    @Column(name = "menu_status",columnDefinition = "smallint not null default 0 comment '菜单状态：0不可用；1可用；默认不可用'")
    private int menuStatus;

    @Transient
    private List<MenuEntry> childMenuList;

}
