| | |
| | | * @return |
| | | */ |
| | | @MapKey(value = "id") |
| | | Map<String, TreeStringNode> getDistrictTree(@Param("district") DistrictVO district); |
| | | Map<String, TreeStringNode> getDistrictTree(@Param("district") DistrictVO district, |
| | | @Param("regionChildCodesList") List<String> regionChildCodesList, |
| | | @Param("isAdministrator") Integer isAdministrator); |
| | | |
| | | /** |
| | | * 小区表 自定义获取详情 |
| | |
| | | name, |
| | | remark aoiCode |
| | | FROM blade_region where district_code like concat('361102','%') |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | union all |
| | | ( |
| | | select |
| | |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | | and community_code in ('') |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | ) |
| | | </select> |
| | | |
| | |
| | | public Object getDistrictTree(DistrictVO district) { |
| | | // 判断角色,物业角色只能查询当前小区的 |
| | | String userRole = AuthUtil.getUserRole(); |
| | | CommonParamSet invoke = new CommonParamSet<>().invoke(DistrictVO.class, district); |
| | | |
| | | if (RoleUtil.isProperty(userRole)) { |
| | | if (district.getFilterFlag().equals(1)) { |
| | | // 查询小区id |
| | |
| | | } |
| | | } |
| | | } |
| | | Map<String, TreeStringNode> districtTree = baseMapper.getDistrictTree(district); |
| | | Map<String, TreeStringNode> districtTree = baseMapper.getDistrictTree(district,invoke.getRegionChildCodesList(),invoke.getIsAdministrator()); |
| | | List<TreeStringNode> stringNodeTree = NodeTreeUtil.getStringNodeTree(districtTree); |
| | | stringNodeTree.forEach(node -> recursion(node)); |
| | | return stringNodeTree; |