霍林河露天煤矿生产一体化平台
1
13693261870
2023-04-10 f34c06ae314cd4a3f9a3bd50a264a3ce0da5d7e7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package com.terra.coal.mapper;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.math.BigDecimal;
import java.util.List;
 
/**
 * MainMapper
 * @author WWW
 */
@Mapper
@Repository
public interface MainMapper {
    /**
     * 根据范围统计
     *
     * @param top
     * @param bottom
     * @param wkt
     * @return
     */
    @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 #{top} and #{bottom} or bottom between #{top} and #{bottom}) and ST_Intersects(geom, ST_PolygonFromText(#{wkt}, 4490))" +
            "group by ctype order by ctype")
    public List<CountEntity> countByRange(@Param("top") BigDecimal top, @Param("bottom") BigDecimal bottom, @Param("wkt") String wkt);
}