| 
					
				 | 
			
			
				@@ -15,6 +15,7 @@ import com.sysu.admin.utils.TextUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.xiesx.fastboot.base.pagination.PaginationHelper; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.xiesx.fastboot.base.pagination.PaginationResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.xiesx.fastboot.base.pagination.PaginationVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.xiesx.fastboot.base.result.BaseResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import com.xiesx.fastboot.core.jpa.JpaPlusRepository; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.apache.commons.lang3.ArrayUtils; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 import org.apache.commons.lang3.ObjectUtils; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -301,6 +302,24 @@ public class LandService extends BaseService<Land,Long> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public AllLandStatVo allLandStat(CommonVo commonVo){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String wkt = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(commonVo.getTown() != null) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wkt = townService.findWktById(commonVo.getTown()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        }else if(StringUtils.isNotBlank(commonVo.getDistrict())) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            wkt = districtRepository.findWktByCode(commonVo.getDistrict()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        StringBuffer sql = new StringBuffer(100); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        String col = "count(1) as all_count, sum(area) as sum_area, sum(dan_chan * area) as zong_chan ,avg(toc) as avg_toc,avg(ph) as avg_ph,avg(c) as avg_c,avg(_2n) as avg_2n,avg(p) as avg_p,avg(k) as avg_k"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sql.append("select "+col+" from  leizhou_land where 1=1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        StringBuffer append = appendWhere(commonVo, wkt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        sql.append(append); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        System.out.println(sql.toString()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        AllLandStatVo allLandStatVo = (AllLandStatVo)mEntityManager.createNativeQuery(sql.toString(), AllLandStatVo.class).getSingleResult(); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return allLandStatVo; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     public PaginationResult list(CommonVo commonVo,PaginationVo page){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         String wkt = null; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         if(commonVo.getTown() != null) { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -315,7 +334,6 @@ public class LandService extends BaseService<Land,Long> { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuffer sql = new StringBuffer(100); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         countSql.append("select count(1) from  leizhou_land where 1=1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sql.append("select * from  leizhou_land where 1=1"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         StringBuffer append = appendWhere(commonVo, wkt); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         sql.append(append); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         countSql.append(append); 
			 |