From 51becaaae9516cfd6995873e2018f65885db73b4 Mon Sep 17 00:00:00 2001 From: wangliwen Date: Thu, 5 Jan 2023 09:11:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=B8=82=E7=BA=A7=E3=80=81?= =?UTF-8?q?=E5=8C=BA=E7=BA=A7=20=E9=83=A8=E9=97=A8=E6=95=B0=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/renren/common/controller/CensusController.java | 2 ++ .../main/java/io/renren/modules/sys/dao/SysDeptDao.java | 9 +++++++++ .../io/renren/modules/sys/service/SysDeptService.java | 2 ++ .../modules/sys/service/impl/SysDeptServiceImpl.java | 5 +++++ .../src/main/resources/mapper/sys/SysDeptDao.xml | 8 ++++++++ 5 files changed, 26 insertions(+) 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