package com.crunii.micro.domain.entity.main;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;

@Entity
@Table(name = "tsm_menu")
@NamedQuery(name = "TsmMenu.findAll", query = "SELECT t FROM TsmMenu t")
@DynamicInsert
@DynamicUpdate
@Getter
@Setter
@ToString
@EqualsAndHashCode(of = { "menuCode" })
@ApiModel(description = "菜单表")
public class TsmMenu implements Serializable {

    private static final long serialVersionUID = 1L;

	@Id
	@Column(name = "menu_code")
	@ApiModelProperty(value = "菜单编号")
	private String menuCode;

	@Column(name = "menu_name")
	@ApiModelProperty(value = "菜单名称")
	private String menuName;

	@Column(name = "menu_desc")
	@ApiModelProperty(value = "菜单描述")
	private String menuDesc;

	@Column(name = "menu_url")
	@ApiModelProperty(value = "菜单url")
	private String menuUrl;

	@Column(name = "menu_type")
	@ApiModelProperty(value = "0:目录 1:菜单 2:按钮")
	private int menuType;

	@Column(name = "button_url_id")
	@ApiModelProperty(value = "按钮对应的url_id,类型为菜单的为0")
	private int buttonUrlId;

	@Column(name = "parent_menu_code")
	@ApiModelProperty(value = "父菜单编码")
	private String parentMenuCode;

	@Column(name = "code")
	@ApiModelProperty(value = "菜单编码")
	private String code;

	@Column(name = "terminal")
	@ApiModelProperty(value = "展示终端")
	private String terminal;

	@Column(name = "create_time")
	@ApiModelProperty(value = "创建时间")
	private java.util.Date createTime;

	@Column(name = "update_time")
	@ApiModelProperty(value = "更新时间")
	private java.util.Date updateTime;

	@Column(name = "icon")
	@ApiModelProperty(value = "图标")
	private String icon;

	@Column(name = "sort_id")
	@ApiModelProperty(value = "排序")
	private int sortId;

	@Column(name = "state")
	@ApiModelProperty(value = "0 无效，1有效")
	private int state;

}
