diff --git a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java index 25597a60..3a3257b1 100644 --- a/renren-admin/src/main/java/io/renren/common/controller/CensusController.java +++ b/renren-admin/src/main/java/io/renren/common/controller/CensusController.java @@ -813,6 +813,7 @@ public class CensusController { add(new LinkedHashMap() {{ put("tip", "区市部门"); put("level", "county"); + put("dept_count", sysDeptService.countByType(3)); put("apply_sum", county_apply_sum); put("resource_sum", county_resource_sum); put("resource_weekly_change", finalCounty_resource_weekly_change); @@ -823,6 +824,7 @@ public class CensusController { add(new LinkedHashMap() {{ put("tip", "市级部门"); put("level", "municipal"); + put("dept_count", sysDeptService.countByType(2)); put("apply_sum", municipal_apply_sum); put("resource_sum", municipal_resource_sum); put("resource_weekly_change", finalMunicipal_resource_weekly_change); diff --git a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java index 91b41add..fa95e18b 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/dao/SysDeptDao.java @@ -46,4 +46,13 @@ public interface SysDeptDao extends BaseDao { List getIdFromDistrict(@Param("district") Long district); + + /** + * 统计部门类型数量 + * + * @param type + * @return + */ + Long countByType(@Param("type") Integer type); + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java index 803c94a1..57778b20 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/SysDeptService.java @@ -42,4 +42,6 @@ public interface SysDeptService extends BaseService { */ List getIdFromDistrict(Long district); + Long countByType(Integer type); + } \ No newline at end of file diff --git a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java index f32819dc..869a671e 100644 --- a/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java +++ b/renren-admin/src/main/java/io/renren/modules/sys/service/impl/SysDeptServiceImpl.java @@ -158,6 +158,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl SELECT id from sys_dept WHERE district = #{district}; + \ No newline at end of file