Commit 1cd555ef authored by zhaobiyan's avatar zhaobiyan

获取城市信息接口

parent 14f0ca3e
......@@ -208,4 +208,13 @@ public class RegionController {
return pNode;
}
@GetMapping("/getCityListByParent")
@ApiOperation("根据父节点获取城市列表")
public CommonResult<List<RegionRespVO>> getCityListByParent(@RequestParam("id") Long parentId) {
if (parentId == null) {
return CommonResult.success(Collections.emptyList());
}
List<RegionDO> cityList = regionService.getCityListByParentId(parentId);
return success(RegionConvert.INSTANCE.convertList(cityList));
}
}
......@@ -102,4 +102,5 @@ public interface RegionMapper extends BaseMapperX<RegionDO> {
List<RegionDO> getImportExportCountryList();
List<RegionDO> getCityListByParentId(@Param("parentId") Long parentId);
}
......@@ -90,5 +90,5 @@ public interface RegionService {
List<RegionDO> getImportExportCountryList();
List<RegionDO> getCityListByParentId(Long parentId);
}
......@@ -144,4 +144,9 @@ public class RegionServiceImpl implements RegionService {
public List<RegionDO> getImportExportCountryList() {
return regionMapper.getImportExportCountryList();
}
@Override
public List<RegionDO> getCityListByParentId(Long parentId) {
return regionMapper.getCityListByParentId(parentId);
}
}
......@@ -68,4 +68,13 @@
and b.status = 0
and b.type in (1, 3)
</select>
<select id="getCityListByParentId" resultType="cn.iocoder.yudao.module.ecw.dal.dataobject.region.RegionDO">
select b.* from ecw_region a
left join ecw_region b on a.id = b.parent_id
where a.parent_id = #{parentId}
AND a.deleted = 0
and b.deleted = 0
and a.status = 0
and b.status = 0
</select>
</mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment