package com.sysu.admin.controller.lz.everyday;

import com.sysu.admin.controller.lz.period.LzPeriod;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.FieldNameConstants;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import javax.persistence.*;
import java.util.Date;
import java.util.List;

@Data
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@FieldNameConstants(innerTypeName = "FIELDS")
@Table(name = "lz_everyday")
@Entity
@DynamicInsert
@DynamicUpdate
public class LzEveryday {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    @Column
    private Integer treeId;

    @Column(updatable = false, nullable = false)
    private Date createDate;

    /**
     * 物候期
     */
    @ManyToOne(cascade= CascadeType.REFRESH)
    @JoinColumn(name = "period_id")
    private LzPeriod lzPeriod;

    /**
     * 白点率
     */
    @Column
    private Double whitePoint;

    /**
     * 花叶比
     */
    @Column
    private Double flowerLength;

    /**
     * 花穗比
     */
    @Column
    private Double flowerPercent;

    /**
     * 产量（预估值千克）
     */
    @Column
    private Integer yield;

    /**
     * 红叶率
     */
    private Double redLeafPercent;

    /**
     * 开花面积比
     */
    private Double flowerAreaPercent;


    /**
     * 局部关键点图片
     */
    @Column
    private String partImgUrl;

    @Transient
    private List<LzEverydayImage> lzEverydayImage;
}



















