package cn.estsh.i3plus.pojo.mes.bean;


import cn.estsh.i3plus.pojo.base.bean.BaseBean;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

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

/**
 * @Description :数据权限
 * @Reference :
 * @Author : jack.jia
 * @CreateDate : 2019-04-26
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "MES_DATA_AUTH")
@Api("数据权限")
public class MesDataAuth extends BaseBean implements Serializable {
    private static final long serialVersionUID = -8665559475167190408L;
    @Column(name = "ROLE_ID")
    @ApiParam("角色编号")
    private Long roleId;

    @Column(name = "ROLE_NAME")
    @ApiParam("角色名称")
    private String roleName;

    @Column(name = "DATA_OBJECT")
    @ApiParam("数据对象")
    private String dataObject;

    @Column(name = "DATA_OBJECT_FULL_NAME")
    @ApiParam("数据对象全称")
    private String dataObjectFullName;

    @Column(name = "DATA_OBJECT_NAME")
    @ApiParam("数据对象名称")
    private String dataObjectName;

    @Lob
    @Column(name = "FILTER_RULE")
    @ApiParam("过滤规则")
    private String filterRule;

    public long getRoleIdVal() {
        return this.roleId == null ? 0 : this.roleId.longValue();
    }

}
