package com.terra.coal.entity; import com.baomidou.mybatisplus.annotation.FieldStrategy; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableName; import lombok.AllArgsConstructor; import lombok.Data; import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; /** * Coal54Entity * @author WWW */ @Data @AllArgsConstructor @TableName("public.coal54") @EqualsAndHashCode(callSuper = false) public class Coal54Entity implements Serializable { private static final long serialVersionUID = 5660360983928368364L; private Integer gid; private BigDecimal top; private BigDecimal bottom; private BigDecimal clong; private BigDecimal width; private BigDecimal height; private String ctype; private BigDecimal density; private BigDecimal gangue; private BigDecimal volume; @TableField(value = "ST_AsText(geom)", updateStrategy = FieldStrategy.NEVER, insertStrategy = FieldStrategy.NEVER) private String geom; public Coal54Entity() { } public Coal54Entity(BigDecimal x, BigDecimal y, BigDecimal top, BigDecimal clong, BigDecimal width, BigDecimal height, String ctype, BigDecimal density, BigDecimal gangue) { this.top = top; this.clong = clong; this.width = width; this.height = height; this.ctype = ctype; this.density = density; this.gangue = gangue; this.bottom = top.add(height); this.volume = clong.multiply(width).multiply(height); this.geom = String.format("ST_GeomFromText('POINT (%f %f)')", x.doubleValue(), y.doubleValue()); } public Integer getGid() { return gid; } public void setGid(Integer gid) { this.gid = gid; } public BigDecimal getTop() { return top; } public void setTop(BigDecimal top) { this.top = top; } public BigDecimal getBottom() { return bottom; } public void setBottom(BigDecimal bottom) { this.bottom = bottom; } public BigDecimal getClong() { return clong; } public void setClong(BigDecimal clong) { this.clong = clong; } public BigDecimal getWidth() { return width; } public void setWidth(BigDecimal width) { this.width = width; } public BigDecimal getHeight() { return height; } public void setHeight(BigDecimal height) { this.height = height; } public String getCtype() { return ctype; } public void setCtype(String ctype) { this.ctype = ctype; } public BigDecimal getDensity() { return density; } public void setDensity(BigDecimal density) { this.density = density; } public BigDecimal getGangue() { return gangue; } public void setGangue(BigDecimal gangue) { this.gangue = gangue; } public BigDecimal getVolume() { return volume; } public void setVolume(BigDecimal volume) { this.volume = volume; } public String getGeom() { return geom; } public void setGeom(String geom) { this.geom = geom; } }