Explorar el Código

水资源,按部门分组

lidongyu hace 1 año
padre
commit
cda28f9d24
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/main/resources/mapper/digitalwater/WaterBigDataMapper.xml

+ 2 - 2
src/main/resources/mapper/digitalwater/WaterBigDataMapper.xml

@@ -230,13 +230,13 @@
         order by a.create_time desc
     </select>
     <select id="selectCenterdataTResourcesHydroenergyList" resultType="java.util.Map">
-        select d.ancestors ancestors,a.dept_id deptId,a.river_total riverTotal, a.water_volume waterVolume
+        select d.ancestors ancestors,a.dept_id deptId,ifnull(sum(a.river_total),0) riverTotal, ifnull(sum(a.water_volume),0) waterVolume
         from centerdata_t_resources_hydroenergy a
         left join ${database_system}.sys_dept d on a.dept_id = d.dept_id
         <where>
             ${params.dataScope}
         </where>
-        GROUP BY a.dept_id
+        group by a.dept_id
         order by a.create_time desc
 
     </select>