霍林河露天煤矿生产一体化平台
1
13693261870
2023-04-11 5af8ff1fbdc7183bf611f1971edf1f6e8f68c961
src/main/java/com/terra/coal/mapper/MainMapper.java
@@ -2,6 +2,8 @@
import com.terra.coal.entity.CountEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;
import java.util.List;
@@ -16,10 +18,13 @@
    /**
     * 根据范围统计
     *
     * @param wkt
     * @param z
     * @param deep
     * @return
     * @param top    顶高
     * @param bottom 底高
     * @param wkt    WKT
     * @return CountEntity集合
     */
    public List<CountEntity> countByRange(String wkt, double z, double deep);
    @Select("select ctype, sum(volume) \"volume\", sum(coal_prod) \"coal_prod\", sum(gangue_prod) \"gangue_prod\", 0 \"soil_prod\" from public.coal2000 " +
            "where (top between #{bottom} and #{top} or bottom between #{bottom} and #{top}) and ST_Intersects(geom, ST_PolygonFromText(#{wkt}, 4490)) " +
            "group by ctype order by ctype")
    public List<CountEntity> countByRange(@Param("top") Double top, @Param("bottom") Double bottom, @Param("wkt") String wkt);
}