| | |
| | | right join jczz_grid jg on jg.community_code = br.village_code and jg.is_deleted = 0 |
| | | where br.ancestors like concat('%',#{regionCode},'%') |
| | | ) |
| | | union all |
| | | ( |
| | | SELECT |
| | | t1.id,t1.parentId,t1.name |
| | | FROM |
| | | ( |
| | | SELECT |
| | | @ids AS ids, |
| | | ( SELECT @ids := GROUP_CONCAT( id ) FROM police_region WHERE FIND_IN_SET( parentId, @ids ) ) AS cids |
| | | FROM |
| | | police_region |
| | | WHERE |
| | | @ids IS NOT NULL |
| | | AND @ids := #{regionCode} |
| | | ) id, |
| | | police_region t1 |
| | | WHERE |
| | | FIND_IN_SET(t1.parentId,ids) |
| | | ) |
| | | </select> |
| | | |
| | | |
| | |
| | | LEFT JOIN jczz_place_ext jpe ON jpe.place_id = jp.id |
| | | LEFT JOIN blade_user bu ON bu.id = jtpr.create_user |
| | | LEFT JOIN jczz_doorplate_address jda on jda.address_code=jtpr.house_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jpag.community_code= jg.community_code |
| | | LEFT JOIN jczz_police_affairs_grid jpag on jp.jw_grid_code= jpag.jw_grid_code |
| | | <where> |
| | | <if test="taskPalce.id != null ">and id = #{taskPalce.id}</if> |
| | | <if test="taskPalce.placeCheckId != null ">and place_check_id = #{taskPalce.placeCheckId}</if> |
| | |
| | | <if test="isAdministrator==2"> |
| | | <choose> |
| | | <when test="regionChildCodesList !=null and regionChildCodesList.size()>0"> |
| | | and jg.grid_code in |
| | | and |
| | | ( |
| | | jg.grid_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | or |
| | | jpag.community_code in |
| | | <foreach collection="regionChildCodesList" item="code" open="(" close=")" separator=","> |
| | | #{code} |
| | | </foreach> |
| | | ) |
| | | </when> |
| | | <otherwise> |
| | | and |
| | | ( |
| | | jg.grid_code in ('') or jpag.community_code in ('') |
| | | ) |
| | | </otherwise> |
| | | </choose> |
| | | </if> |
| | | </where> |
| | |
| | | @Override |
| | | public IPage<TaskPlaceRectificationVO> selectTaskPlaceRectificationList(IPage<TaskPlaceRectificationVO> page, TaskPlaceRectificationDTO taskPlaceRectificationDTO) { |
| | | // 数据过滤 todo |
| | | List<String> regionChildCodesList = new ArrayList<>();//SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdmin() == true ? 1 : 2; |
| | | List<String> regionChildCodesList = SysCache.getRegionChildCodesByDeptId(AuthUtil.getDeptId()); |
| | | Integer isAdministrator = AuthUtil.isAdministrator() == true ? 1 : 2; |
| | | List<TaskPlaceRectificationVO> taskPlaceRectificationVOS = baseMapper.selectTaskPlaceRectificationList(page, taskPlaceRectificationDTO, regionChildCodesList, isAdministrator); |
| | | for (TaskPlaceRectificationVO taskPlaceRectificationVO : taskPlaceRectificationVOS) { |
| | | StringBuilder builder = new StringBuilder(""); |