Administrator 2 năm trước cách đây
mục cha
commit
8e91d4ccbb

+ 1 - 1
src/main/java/com/sysu/admin/controller/aland/LandRepository.java

@@ -13,7 +13,7 @@ public interface LandRepository extends JpaPlusRepository<Land, Long> {
     @Query(value = "select crop_type,sum(area) from  leizhou_land where St_within(geom,st_geomfromtext(?1,4326)) group by crop_type",nativeQuery = true)
     List<Object[]> statCropType(String wkt);
 
-    @Query(value = "select crop_type,sum(area) from  leizhou_land  group by majority",nativeQuery = true)
+    @Query(value = "select majority,sum(area) from  leizhou_land  group by majority",nativeQuery = true)
     List<Object[]> statMajorityAll();
 
     @Query(value = "select majority,sum(area) from  leizhou_land where St_within(geom,st_geomfromtext(?1,4326)) group by majority",nativeQuery = true)

+ 1 - 1
src/main/java/com/sysu/admin/controller/aland/LandService.java

@@ -42,7 +42,7 @@ public class LandService extends BaseService<Land,Long> {
             String wkt = districtRepository.findWktByCode(district);
             res = landRepository.statMajority(wkt);
         }else{
-            res =landRepository.statMajorityAll();
+            res = landRepository.statMajorityAll();
         }
         res.stream().forEach(o -> {
             Double area = (Double)o[1];