package cn.estsh.i3plus.pojo.report.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.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.List;

/**
 * @Description :
 * @Reference :
 * @Author : wei.peng
 * @CreateDate : 20-3-24 下午2:39
 * @Modify:
 **/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@EqualsAndHashCode(callSuper = true)
@Table(name = "BR_LAYOUT_ELEMENT")
@Api(value = "自定义报表布局元素")
public class BrLayoutElement extends BaseBean {

    private static final long serialVersionUID = 3684811659039862857L;
    @Column(name = "LAYOUT_ID")
    @ApiParam(value = "布局主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long layoutId;

    @Column(name = "PARENT_ID")
    @ApiParam(value = "父节点主键")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    @Column(name = "ELEMENT_TEXT")
    @ApiParam(value ="元素描述")
    private String elementText;

    @Column(name="ELEMENT_SEQ")
    @ApiParam(value ="序列")
    private Integer elementSeq = 0;

    @Column(name="ELEMENT_WIDTH")
    @ApiParam(value ="列宽")
    private Integer elementWidth;

    @Column(name="ELEMENT_HEIGHT")
    @ApiParam(value ="列高")
    private Integer elementHeight;

    @Column(name="ELEMENT_STYLE")
    @ApiParam(value ="列样式")
    private String elementStyle;

    @Column(name="ELEMENT_CSS_CLASS")
    @ApiParam(value ="列样式")
    private String elementCssClass;

    @Column(name = "ELEMENT_DESCRIPTION")
    @ApiParam(value ="元素描述")
    private String elementDescription;

    @Transient
    @ApiParam(value ="行所包含的元素")
    private List<BrLayoutElement> elementList;
}
