| | |
| | | SELECT |
| | | code,parent_code,name,ancestors,region_level,sort |
| | | FROM blade_region |
| | | where ancestors like concat('%',#{regionCode},'%') |
| | | where (ancestors like concat('%',#{regionCode},'%') or code = #{regionCode}) |
| | | union all |
| | | ( |
| | | SELECT |
| | |
| | | jg.sort |
| | | FROM blade_region br |
| | | right join jczz_grid jg on jg.community_code = br.village_code and jg.is_deleted = 0 |
| | | where br.ancestors like concat('%',#{regionCode},'%') |
| | | where (br.ancestors like concat('%',#{regionCode},'%') or br.code = #{regionCode}) |
| | | ) |
| | | </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> |
| | | |
| | | |
| | | <!--查询公安对应的辖区树--> |
| | | <select id="getPoliceTreeList" resultType="org.springblade.common.node.TreeStringNode"> |