| | |
| | | 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> |
| | | |
| | | <!--查询公安相关的区域数据--> |
| | | <select id="getPoliceList" resultType="org.springblade.modules.system.entity.Region"> |
| | | SELECT id as code,parentId as parent_code,name,'' as ancestors,null as region_level,1 as sort FROM police_region |
| | | </select> |
| | | |
| | | |