添加查询所有市的接口

This commit is contained in:
sh
2026-01-21 17:43:35 +08:00
parent 5e3ec6ddae
commit e4bb4e55e3
5 changed files with 29 additions and 0 deletions

View File

@@ -24,4 +24,13 @@
order by code
</select>
<select id="getCityList" resultType="com.ruoyi.common.core.domain.entity.SysArea" parameterType="com.ruoyi.common.core.domain.entity.SysArea">
WITH top_area AS (
SELECT code, name, (name LIKE '%市%') AS is_municipality FROM sys_area WHERE del_flag='0' and parent_code IS NULL
)
SELECT sa.* FROM sys_area sa INNER JOIN top_area ta ON sa.code = ta.code WHERE ta.is_municipality = TRUE
UNION ALL
SELECT sa.* FROM sys_area sa INNER JOIN top_area ta ON sa.parent_code = ta.code WHERE ta.is_municipality = FALSE
</select>
</mapper>