src/main/java/com/terra/coal/entity/Coal2000Entity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/terra/coal/entity/CountEntity.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/java/com/terra/coal/mapper/MainMapper.java | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/main/resources/mapper/MainMapper.xml | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/main/java/com/terra/coal/entity/Coal2000Entity.java
@@ -8,7 +8,6 @@ import lombok.EqualsAndHashCode; import java.io.Serializable; import java.math.BigDecimal; /** * Coal2000Entity @@ -23,23 +22,23 @@ private Integer gid; private BigDecimal top; private Double top; private BigDecimal bottom; private Double bottom; private BigDecimal clong; private Double clong; private BigDecimal width; private Double width; private BigDecimal height; private Double height; private String ctype; private BigDecimal density; private Double density; private BigDecimal gangue; private Double gangue; private BigDecimal volume; private Double volume; @TableField(value = "ST_AsText(geom)", updateStrategy = FieldStrategy.NEVER, insertStrategy = FieldStrategy.NEVER) private String geom; @@ -55,43 +54,43 @@ this.gid = gid; } public BigDecimal getTop() { public Double getTop() { return top; } public void setTop(BigDecimal top) { public void setTop(Double top) { this.top = top; } public BigDecimal getBottom() { public Double getBottom() { return bottom; } public void setBottom(BigDecimal bottom) { public void setBottom(Double bottom) { this.bottom = bottom; } public BigDecimal getClong() { public Double getClong() { return clong; } public void setClong(BigDecimal clong) { public void setClong(Double clong) { this.clong = clong; } public BigDecimal getWidth() { public Double getWidth() { return width; } public void setWidth(BigDecimal width) { public void setWidth(Double width) { this.width = width; } public BigDecimal getHeight() { public Double getHeight() { return height; } public void setHeight(BigDecimal height) { public void setHeight(Double height) { this.height = height; } @@ -103,27 +102,27 @@ this.ctype = ctype; } public BigDecimal getDensity() { public Double getDensity() { return density; } public void setDensity(BigDecimal density) { public void setDensity(Double density) { this.density = density; } public BigDecimal getGangue() { public Double getGangue() { return gangue; } public void setGangue(BigDecimal gangue) { public void setGangue(Double gangue) { this.gangue = gangue; } public BigDecimal getVolume() { public Double getVolume() { return volume; } public void setVolume(BigDecimal volume) { public void setVolume(Double volume) { this.volume = volume; } src/main/java/com/terra/coal/entity/CountEntity.java
对比新文件 @@ -0,0 +1,50 @@ package com.terra.coal.entity; /** * CountEntity * @author WWW */ public class CountEntity { private String ctype; private Double volume; private Double v1; private Double v2; public CountEntity() { } public String getCtype() { return ctype; } public void setCtype(String ctype) { this.ctype = ctype; } public Double getVolume() { return volume; } public void setVolume(Double volume) { this.volume = volume; } public Double getV1() { return v1; } public void setV1(Double v1) { this.v1 = v1; } public Double getV2() { return v2; } public void setV2(Double v2) { this.v2 = v2; } } src/main/java/com/terra/coal/mapper/MainMapper.java
对比新文件 @@ -0,0 +1,25 @@ package com.terra.coal.mapper; import com.terra.coal.entity.CountEntity; import org.apache.ibatis.annotations.Mapper; import org.springframework.stereotype.Repository; import java.util.List; /** * MainMapper * @author WWW */ @Mapper @Repository public interface MainMapper { /** * 鏍规嵁鑼冨洿缁熻 * * @param wkt * @param z * @param deep * @return */ public List<CountEntity> countByRange(String wkt, double z, double deep); } src/main/resources/mapper/MainMapper.xml
对比新文件 @@ -0,0 +1,11 @@ <?xml version="1.0" encoding="UTF-8" ?> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.terra.coal.mapper.MainMapper"> <select id="selectDictTab" resultType="com.terra.coal.entity.CountEntity"> select ctype, sum(volume) "volume", sum(volume * density) "v1", sum(volume * density * gangue) "v2" from public.coal54 where 1 = 1 group by ctype order by ctype </select> </mapper>