补充市级、区级 部门数量

This commit is contained in:
wangliwen 2023-01-05 09:11:53 +08:00
parent 11f38631c1
commit 51becaaae9
5 changed files with 26 additions and 0 deletions

View File

@ -813,6 +813,7 @@ public class CensusController {
add(new LinkedHashMap<String, Object>() {{
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<String, Object>() {{
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);

View File

@ -46,4 +46,13 @@ public interface SysDeptDao extends BaseDao<SysDeptEntity> {
List<Long> getIdFromDistrict(@Param("district") Long district);
/**
* 统计部门类型数量
*
* @param type
* @return
*/
Long countByType(@Param("type") Integer type);
}

View File

@ -42,4 +42,6 @@ public interface SysDeptService extends BaseService<SysDeptEntity> {
*/
List<Long> getIdFromDistrict(Long district);
Long countByType(Integer type);
}

View File

@ -158,6 +158,11 @@ public class SysDeptServiceImpl extends BaseServiceImpl<SysDeptDao, SysDeptEntit
return baseDao.getIdFromDistrict(district);
}
@Override
public Long countByType(Integer type) {
return baseDao.countByType(type);
}
/**
* 获取所有上级部门ID

View File

@ -51,5 +51,13 @@
<select id="getIdFromDistrict" resultType="java.lang.Long">
SELECT id from sys_dept WHERE district = #{district};
</select>
<select id="countByType" resultType="java.lang.Long">
SELECT
COUNT( id )
FROM
sys_dept
WHERE
type = #{type};
</select>
</mapper>